[Skip to main content](#vessel-content)

#   Limit affiliates to product categories

##

- **[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")**
- [![mojweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5128-mojweb "View mojweb's Profile") Topic Author
- [ Offline](/forum/user/5128-mojweb)

Less More

- Posts: 431
- Thank you received: 22
-

1 year 2 months ago [\#368185](#368185) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368185 "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.")* was created by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 2 months ago [\#368199](#368199) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368199 "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.")*

Hi,

Thanks for your feedback. We'll be looking at adding this.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")**
- [![mojweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5128-mojweb "View mojweb's Profile") Topic Author
- [ Offline](/forum/user/5128-mojweb)

Less More

- Posts: 431
- Thank you received: 22
-

1 year 1 month ago [\#368431](#368431) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368431 "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.")*

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?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 1 month ago [\#368433](#368433) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368433 "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.")*

Hi,

This indeed is that feature.
Why would you think it isn't ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")**
- [![mojweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5128-mojweb "View mojweb's Profile") Topic Author
- [ Offline](/forum/user/5128-mojweb)

Less More

- Posts: 431
- Thank you received: 22
-

1 year 1 month ago [\#368440](#368440) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368440 "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."
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 ![;)](/media/kunena/emoticons/24.png ";)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 1 month ago [\#368443](#368443) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368443 "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.")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")**
- [![mojweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5128-mojweb "View mojweb's Profile") Topic Author
- [ Offline](/forum/user/5128-mojweb)

Less More

- Posts: 431
- Thank you received: 22
-

1 year 1 month ago -  1 year 1 month ago [\#368484](#368484) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368484 "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.")*

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?

Last edit: 1 year 1 month ago by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 1 month ago [\#368485](#368485) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368485 "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.")*

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-&gt;cart-&gt;order_products as $product) {
to:
foreach($order-&gt;cart-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")**
- [![mojweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5128-mojweb "View mojweb's Profile") Topic Author
- [ Offline](/forum/user/5128-mojweb)

Less More

- Posts: 431
- Thank you received: 22
-

1 year 1 month ago -  1 year 1 month ago [\#368514](#368514) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368514 "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.")*

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&#124;object, null given in /plugins/system/hikashopaffiliate/hikashopaffiliate.php on line 273

Last edit: 1 year 1 month ago by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")**
- [![mojweb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5128-mojweb "View mojweb's Profile") Topic Author
- [ Offline](/forum/user/5128-mojweb)

Less More

- Posts: 431
- Thank you received: 22
-

1 year 1 month ago -  1 year 1 month ago [\#368519](#368519) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#368519 "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.")*

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 month ago by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

8 months 11 hours ago [\#370657](#370657) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit affiliates to product categories](/forum/50-feature-request/909643-limit-affiliates-to-product-categories#370657 "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.")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MDk2NDMtbGltaXQtYWZmaWxpYXRlcy10by1wcm9kdWN0LWNhdGVnb3JpZXM/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.072 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
