- Posts: 431
- Thank you received: 22
Limit affiliates to product categories
1 year 1 month ago #368185
by mojweb
Limit affiliates to product categories was created by mojweb
The ability to limit affiliates to product categories or individual products would be very useful.
So the affiliate would only receive a fee for selling a product from a specific category or individual product.
So the affiliate would only receive a fee for selling a product from a specific category or individual product.
Please Log in or Create an account to join the conversation.
1 year 1 month ago #368199
by nicolas
Replied by nicolas on topic Limit affiliates to product categories
Hi,
Thanks for your feedback. We'll be looking at adding this.
Thanks for your feedback. We'll be looking at adding this.
Please Log in or Create an account to join the conversation.
1 year 2 weeks ago #368431
by mojweb
Replied by mojweb on topic Limit affiliates to product categories
In new 6.10 there is new feature:
There is now a "Affiliation category restriction" setting which allows you to restrict affiliation to only some categories of products.
This probably isn't that feature?
There is now a "Affiliation category restriction" setting which allows you to restrict affiliation to only some categories of products.
This probably isn't that feature?
Please Log in or Create an account to join the conversation.
1 year 2 weeks ago #368433
by nicolas
Replied by nicolas on topic Limit affiliates to product categories
Hi,
This indeed is that feature.
Why would you think it isn't ?
This indeed is that feature.
Why would you think it isn't ?
Please Log in or Create an account to join the conversation.
1 year 2 weeks ago #368440
by mojweb
Replied by mojweb on topic Limit affiliates to product categories
"So the affiliate would only receive a fee for selling a product from a specific category or individual product."
This means that each partner should have an individual filter. Now the option is only global for all partners.
Maybe we didn't understand each other very well
This means that each partner should have an individual filter. Now the option is only global for all partners.
Maybe we didn't understand each other very well
Please Log in or Create an account to join the conversation.
1 year 2 weeks ago #368443
by nicolas
Replied by nicolas on topic Limit affiliates to product categories
Hi,
I indeed didn't understand it like that. I understood it like you didn't want some products to generate affiliate fees, and thus, that you wanted to restrict the affiliate fees to only some specific categories.
We'll be looking at adding an override for individual partners.
I indeed didn't understand it like that. I understood it like you didn't want some products to generate affiliate fees, and thus, that you wanted to restrict the affiliate fees to only some specific categories.
We'll be looking at adding an override for individual partners.
Please Log in or Create an account to join the conversation.
1 year 2 weeks ago - 1 year 2 weeks ago #368484
by mojweb
Replied by mojweb on topic Limit affiliates to product categories
Thank you
I tried the new category restriction and I'm not sure if it works.
I selected xy category in the category restriction field. The partner sold the product (from that category), but no commission was calculated. Is this setting inclusive or exclusive?
I tried the new category restriction and I'm not sure if it works.
I selected xy category in the category restriction field. The partner sold the product (from that category), but no commission was calculated. Is this setting inclusive or exclusive?
Last edit: 1 year 2 weeks ago by mojweb.
Please Log in or Create an account to join the conversation.
1 year 2 weeks ago #368485
by nicolas
Replied by nicolas on topic Limit affiliates to product categories
Hi,
It is inclusive, as you understood it. So what you describe would indeed indicate a problem.
Did the product had several categories in its "categories" setting ? Did the product had variants ?
I've looked into it for a bit after your feedback, and I think I know what the problem is. There is a typo in the new code.
Change the line:
foreach($order->cart->order_products as $product) {
to:
foreach($order->cart->products as $product) {
in the file plugins/system/hikashopaffiliate/hikashopaffiliate.php and try again. It should hopefully work fine then.
We'll be including the patch on our end.
It is inclusive, as you understood it. So what you describe would indeed indicate a problem.
Did the product had several categories in its "categories" setting ? Did the product had variants ?
I've looked into it for a bit after your feedback, and I think I know what the problem is. There is a typo in the new code.
Change the line:
foreach($order->cart->order_products as $product) {
to:
foreach($order->cart->products as $product) {
in the file plugins/system/hikashopaffiliate/hikashopaffiliate.php and try again. It should hopefully work fine then.
We'll be including the patch on our end.
Please Log in or Create an account to join the conversation.
1 year 1 week ago - 1 year 1 week ago #368514
by mojweb
Replied by mojweb on topic Limit affiliates to product categories
Yes, product has several categories. No variants.
Will check.
The same row was throwing php warning:
PHP Warning: foreach() argument must be of type array|object, null given in /plugins/system/hikashopaffiliate/hikashopaffiliate.php on line 273
Will check.
The same row was throwing php warning:
PHP Warning: foreach() argument must be of type array|object, null given in /plugins/system/hikashopaffiliate/hikashopaffiliate.php on line 273
Last edit: 1 year 1 week ago by mojweb.
Please Log in or Create an account to join the conversation.
1 year 1 week ago - 1 year 1 week ago #368519
by mojweb
Replied by mojweb on topic Limit affiliates to product categories
Same result. I changed the file but affiliate do not get commision when category filter is selected. So still not working.
Last edit: 1 year 1 week ago by mojweb.
Please Log in or Create an account to join the conversation.
6 months 3 weeks ago #370657
by nicolas
Replied by nicolas on topic Limit affiliates to product categories
Hi,
Apologies for the long delay on this one, it fell through the cracks and I should have addressed it much sooner.
I've identified and fixed the bug causing the category restriction to not work. The commission calculation was failing because of a type mismatch when comparing product categories against the restricted categories, resulting in commissions always being zero when the feature was enabled.
The fix is included in the latest build of HikaShop. Please download and install it from our website, then test the category restriction feature again. Both the global setting and the per-partner override should now work correctly.
Sorry again for the wait, and thank you for your patience.
Apologies for the long delay on this one, it fell through the cracks and I should have addressed it much sooner.
I've identified and fixed the bug causing the category restriction to not work. The commission calculation was failing because of a type mismatch when comparing product categories against the restricted categories, resulting in commissions always being zero when the feature was enabled.
The fix is included in the latest build of HikaShop. Please download and install it from our website, then test the category restriction feature again. Both the global setting and the per-partner override should now work correctly.
Sorry again for the wait, and thank you for your patience.
Please Log in or Create an account to join the conversation.
Time to create page: 0.297 seconds