Hey,

I was looking at my user/136/affiliate/links page and noticed that somehow all product nodes were displayed there, even those that don't have a commission enabled at all.. Looking into the code there appear to be some snippets that should prevent that, but the issue is that when the uc_affiliate2_get_product_commission method gets called for that page, it is called without the product's model SKU and so the commission of a node is not collected properly..

Also, the check $product_commission->commission_structure == 0 is only sufficient when you have a commission set by default, with some nodes overriding it to 0.. however, if a site has the default commission set to 0, with only some nodes overriding that to something positive, then a $product_commission->commission_structure[0] == '0' check should be added as well.

Please review the attached patch, it should solve all the issues.

CommentFileSizeAuthor
uca_models.patch2.04 KBarski
Support from Acquia helps fund testing for Drupal Acquia logo