cancel
Showing results for 
Search instead for 
Did you mean: 

Allow only multiple of X in shopping cart

SOLVED

Allow only multiple of X in shopping cart

I own a shop that sells wine in boxes of 6, 12, 18 or any other multiple of 6.

In my current Magento 1 setup I have a custom made extension that allows only checkout of shopping carts that contain 6, 12, 18 or any other multiple of 6. If you try to checkout with any other number, a notification warns the customer that you can only checkout when having multiples of 6.

Can Magento 2 do this out of the box?

If not, are there extensions out there that will allow me to do this, or do I need to rewrite my current Magento 1 extension?

Any help is appreciated!

 

Ronald

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Allow only multiple of X in shopping cart

Hi,

 

I ended up writing my own extension. You can find it at https://github.com/ron273/CheckCartQuantityM2

 

cheers,

 

ronald

View solution in original post

6 REPLIES 6

Re: Allow only multiple of X in shopping cart

Hi @ron273,

Magento 2 doesn't provide abilty to set multiple of X item in shopping cart. 

But you can set minimum quanity for an item. 

If you want multiple of X item then you need to customize the code. 

for more info:
https://docs.magento.com/m2/ce/user_guide/catalog/inventory.html

You can set minimum qty globally for store configurations as well.

I hope it will help you!

Re: Allow only multiple of X in shopping cart

Hi Ronald,

 

There are some extensions that may be helpful at achieving a similar result. For instance, with an extension, you can set restrictions on shipping, to only allow a particular shipping method if the quantity of items in the cart is one of a particular set of numbers (ie. 6, 12, 18, 24, 30, 36, 42, 48, etc.):  https://marketplace.magento.com/amasty-shiprestriction.html

 

With this particular extension, you can set a Restriction Message, explaining that you only ship in multiples of 6.

 

The same company makes another extension that will allow you to automatically display a banner on the Cart page using a similar rules system. In this case, you could show a banner about the quantity automatically if the user doesn't have a purchasable quantity of items in the cart: https://marketplace.magento.com/amasty-module-promo-banners.html . I don't think that this extra step would be necessary, but it may improve the user experience.

 

Best of luck!

Re: Allow only multiple of X in shopping cart

Hi all,

 

I ultimately decided to write the plugin myself.

It can be found at: https://github.com/ron273/CheckCartQuantityM2

 

Cheers,

 

Ronald (new account)

Re: Allow only multiple of X in shopping cart

Hi @ron273 ,

Unfortunately, the default Magento 2 functions don't support the store owner to set the order quantity as your description.

But you can impose certain limitations on the quantity of the purchase and price, allows admin to set up the fixed purchased quantity drop-down options for customers to select instead of the quantity input box.

There are a lot of Magento 2 extensions that can help you with this. 

Ex: (https://landofcoder.com/magento-2-quantity-dropdown.html/) It is the Magento 2 quantity dropdown extension. You can use to set a minimum and maximum range in the drop-down list from the back-end, the admin can control the sale volume, and increase sale effectively.

Magento-2-quantity-dropdown-frontend-display-1.jpg

 

Re: Allow only multiple of X in shopping cart

Hi,

 

I ended up writing my own extension. You can find it at https://github.com/ron273/CheckCartQuantityM2

 

cheers,

 

ronald

Fourth avenue residence

Regardless, should you consider this to be an occasion to investigate District 10 and D11 Fourth avenue residence apartment suites along the Downtown Line (be it for your own remain or for venture), here are five townhouse ventures with units of various sizes and psf value focuses — from extravagance to magnificent worth. Gracious, and we've explicitly picked freehold/999-year choices, seeing as this structures the greater part of the properties here.