Helpcenter +918010117117" [email protected]
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India
call to replace anchor tags contains '/admin' in href

Restricting cart for single seller

You can add restrict cart for single seller functionality in your store. After adding this feature, the users can only add those items to a cart that are from a single seller. StoreHippo provides the startup widgets feature. Startup widgets contain logic to add behavior to storefronts. With the help of a startup widget, you can implement this feature in your store. 


Suppose you want that the customers can only add products from one seller to the cart.


To restrict cart for a single seller, follow the steps mentioned below:

  • Go to the Site > Startup Widgets section in the StoreHippo Admin Panel.
  • Click the Add New button to add a new widget. A page will open up with multiple fields. 
  • In the Name field, enter the widget name.
  • Paste the following code in the Controller section.{entity: 'ms.carts', command: 'addItem'}, function(req, res, next) {
      if(!(ms.cart  && ms.cart.items && ms.cart.items.length)) return next()
    var checkseller = true;
        if(checkseller && item.seller !={
          checkseller = false;
          alert("Only one seller items can be purchased at a time")
          return res.error(406 ,"Only one seller items can be purchased at a time");
      if(checkseller) next()
  • In the Append To field, select the Head option.
  • Select the Publish option to activate the widget.
  • Click the Save button to apply the changes. 

Now, the user will be allowed to add items from the single seller only. If the user tries to add an item from the other seller, the popup opens up notifying about the restriction.