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

#   set different carts for different product cat...

##

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 7 months ago [\#13256](#13256) by [Nello](/forum/user/1361-nello "View Nello's Profile")  *[set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13256 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")* was created by *[Nello](/forum/user/1361-nello "View Nello's Profile")*

It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#13277](#13277) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13277 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")*

There is no such option but could you explain a bit more what you're trying to do ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 7 months ago [\#13282](#13282) by [Nello](/forum/user/1361-nello "View Nello's Profile")  Replied by *[Nello](/forum/user/1361-nello "View Nello's Profile")* on topic *[Re: set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13282 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")*

OK, I try to explain.
I have Products A in Category A and Product B in Category B.
If I'm buying Product A I can't buy Product B in the same order, but first I have to complete the order of Product A of Category A and then I will be able to buy Product B.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#13295](#13295) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13295 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")*

It's not possible with an option but if you change a bit the code of the file show of the view product, you could load the categories of the products in the cart and only display the add to cart button when the category of the current product is the same as the products in the cart.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 7 months ago [\#13300](#13300) by [Nello](/forum/user/1361-nello "View Nello's Profile")  Replied by *[Nello](/forum/user/1361-nello "View Nello's Profile")* on topic *[Re: set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13300 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")*

Uhmmm... Ok! I think I've understood! I'm going to study the code, but... if you want to post an example it would be wonderful.

You're great! ![;)](/media/kunena/emoticons/24.png ";)")
Anyway, thank you so much!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 7 months ago [\#13326](#13326) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13326 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")*

Something like that (not tested): Code:

$cart = hikashop::get('class.cart'); $products = $cart-&gt;get(); if(!empty($products)){ $ids = array(); foreach($products as $k =&gt; $row){ $ids[]=$row-&gt;product_id; } $db =&amp; JFactory::getDBO(); $db-&gt;setQuery('SELECT category_id FROM '.hikashop::table('product_category').' WHERE product_id ='.$this-&gt;element-&gt;category_id); $current_category_id = $db-&gt;loadResult(); $db-&gt;setQuery('SELECT category_id FROM '.hikashop::table('product_category').' WHERE product_id IN ('.implode(',',$ids).')'); $category_id = $db-&gt;loadResult(); if($category_id==$current_category_id){ //display add to cart } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 7 months ago [\#13419](#13419) by [Nello](/forum/user/1361-nello "View Nello's Profile")  Replied by *[Nello](/forum/user/1361-nello "View Nello's Profile")* on topic *[Re: set different carts for different product cat...](/forum/4-how-to/13256-set-different-carts-for-different-product-cat#13419 "It is possible to set different carts for different product categories and therefore be able to buy only products from that specific category?")*

Thank you Nicolas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzEzMjU2LXNldC1kaWZmZXJlbnQtY2FydHMtZm9yLWRpZmZlcmVudC1wcm9kdWN0LWNhdD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) 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.067 seconds

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