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

#   multiple vendors

##

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

Less More

- Posts: 37
- Thank you received: 3
-
-

10 years 8 months ago [\#233928](#233928) by [Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")  *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#233928 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")* was created by *[Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")*

-- HikaShop version -- : HikaShop Business 2.6.1
-- HikaMarket version -- : 1.6.7
-- Joomla version -- : 3.5.0

Hello,
I do shop for multiple vendors, each vendor will require their own checkout/payment
I turned on one vendor option in the cart
and since in the cart may be goods only one vendor that makes the confusion for customers.
I want to make that the client can initially buy each time only one type of product
1 variant: How I do that one product is replaced by another product if the customer did not buy first?
2 variant: that the products are not being saved in a shopping cart and was always empty

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 8 months ago [\#233969](#233969) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#233969 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

Hi,

In HikaShop, you have a lot of "trigger" which allow to plug custom plugins for specific behaviors.
For example, you can use the trigger "onBeforeCartUpdate" to control the content of the cart (and the product which is being added) when the customer want to update his cart (add a new product, remove one, change the quantity...).
[ www.hikashop.com/support/documentation/6...umentation.html#cart](http://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#cart)

Thanks to that, you can implement the first variant you mentioned.
For the second variant you listed, I'm not sure I understand clearly what you want to achieve.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 37
- Thank you received: 3
-
-

10 years 8 months ago -  10 years 8 months ago [\#234023](#234023) by [Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")  Replied by *[Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#234023 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

Thanks for the answer,
I'm not good at programming but like all did as you said,

[ ![10.jpg](/forum/attachment/30260) ](/forum/attachment/30260 "10.jpg")

but yet function does not work, it is still one product does not substitute another product
and it turns out that if a one item in the cart of the seller and the customer wants to buy another item of another vendor, he can not do that while he did not remove the item from the Cart

plugins/hikashop/cart/cart.php Code:

&lt;?php defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php class plgHikashopCart extends JPlugin { function plgHikashopCart(&amp;$subject, $config){ parent::__construct($subject, $config); } function onBeforeCartUpdate(&amp;$cartClass,&amp;$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force,&amp;$do) { } }

- [ ![10.jpg](/forum/attachment/30260) ](/forum/attachment/30260 "10.jpg") [ ](/forum/attachment/30260?download=1 "10.jpg")

Last edit: 10 years 8 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice

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

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

Less More

- Posts: 37
- Thank you received: 3
-
-

10 years 8 months ago -  10 years 8 months ago [\#234072](#234072) by [Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")  Replied by *[Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#234072 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

I searched the forum and got the desired code Code:

function onBeforeCartUpdate(&amp;$cartClass,&amp;$cart,$product_id,$quantity,$add,$type,$resetCartWhenUpdate,$force,&amp;$do) { $cartClass = hikashop_get('class.cart'); $cartClass-&gt;resetCart(); $cartContent = $cartClass-&gt;get(); $cartClass-&gt;updateEntry($quantity,$cartContent,(int)$product_id,1,false,$type,$force); }

Last edit: 10 years 8 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 8 months ago [\#234090](#234090) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#234090 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

Hi,

There is no need to perform the hikashop_get for the variable $cartClass because you already have that variable (the first parameter of the function).
And there is also no need to get the cart content (the second parameter) and do the updateEntry (you are currently updating the cart).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [Ilya.bps](/forum/user/40127-ilya-bps "View Ilya.bps's Profile")

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

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

Less More

- Posts: 424
- Thank you received: 11
-
-

5 years 7 months ago [\#331623](#331623) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#331623 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

Hi,

Where can i find the right file to add this code in version 4.1.1
so we also can establish this so cart will be emptied when switching vendor..
Thanks

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 7 months ago [\#331628](#331628) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#331628 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

Hello,

There is no file to edit, the code is related to the creation of a custom plugin.
For more details regarding the creation of plugins for Joomla, I recommend you the Joomla documentation website :
[ docs.joomla.org/J3.x:Creating\_a\_Plugin\_for\_Joomla](https://docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla)

The same trigger would be needed if you want to detect that the customer is added a products from another vendor into a cart which have products from a different vendor.
Afterwards you can use the HIkaShop cart API in order to empty the cart.

But since that thread is 5 years old and your question is not the exact same than the original one, it might be better to create a new thread if you have further questions.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 424
- Thank you received: 11
-
-

5 years 7 months ago [\#331901](#331901) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[multiple vendors](/forum/23-market-how-to/883257-multiple-vendors#331901 "-- HikaShop version -- : HikaShop Business 2.6.1 -- HikaMarket version -- : 1.6.7 -- Joomla version -- : 3.5.0  Hello, I do shop for multiple vendors, each vendor will require their own checkout/payment I turned on one vendor option in the cart and since in the cart may be goods only one vendor that makes the confusion for customers. I want to make that the client can initially buy each time only one type of product 1 variant: How I do that one product is replaced by another product if the customer did not buy first? 2 variant: that the products are not being saved in a shopping cart and was always empty")*

found a setting in the hikamarket, the email is now working..

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODgzMjU3LW11bHRpcGxlLXZlbmRvcnM/dG1wbD1tYXJrZG93bg==) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.062 seconds

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