Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Buy per multiple? 
 
LisaMulti
Jr. Member
 
Total Posts:  1
Joined:  2009-08-27
 

Hi,

I want to sell bottle of juice on my website.
They are in boxes of 12.
I want to have the price per bottle.
Is it possible that the client can only buy 12,24,36 and so on…

 
Magento Community Magento Community
Magento Community
Magento Community
 
brennan.ag
Jr. Member
 
Total Posts:  7
Joined:  2009-06-19
 

I am very interested in this feature. In fact it is crucial for my store to be useful.
Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
brennan.ag
Jr. Member
 
Total Posts:  7
Joined:  2009-06-19
 

That helps for sure, but the real problem is we have one inventory system and sell the same products from a retail website.  If we do that then we need different SKUs for retail and wholesale, which makes maintaining inventory a big pain in the butt.

I would love for there to be a way to have minimum increments of products.

Widget A is sold in 6s

Widget B is sold in 12s

Is this something that is doable with code?

I’m open to hiring or learning more and doing it myself, I have some PHP experience.

I really appreciate your time responding!

EDIT: See here
http://tutorials.zen-cart.com/index.php?article=37

 
Magento Community Magento Community
Magento Community
Magento Community
 
bamich
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2008-03-24
Switzerland, Zürich
 

This is quite simple. You need to add an new attribute to your products to specify the amount in which the product is sold “product_boxes_size”.
Then, replace the input field for quantity in product detail view and cart with a select field having values x * product_boxes_size where x is a number between 1 and the maximum number of boxes you want to sell via the retail store.

Additionally you have to check that the total quantity per row in cart is really a multiple of “product_box_size” before allowing the customer to checkout.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brennan.ag
Jr. Member
 
Total Posts:  7
Joined:  2009-06-19
 

That is great and very helpful guys!

I’m working on it…

I think I have to add the attribute to the default set first though right?

 
Magento Community Magento Community
Magento Community
Magento Community
 
brennan.ag
Jr. Member
 
Total Posts:  7
Joined:  2009-06-19
 

Wow.  That was incredible.

Thank you so much!

I know others have wanted this solution too, hopefully they can find it easily.

 
Magento Community Magento Community
Magento Community
Magento Community
 
brennan.ag
Jr. Member
 
Total Posts:  7
Joined:  2009-06-19
 

The only other comment I have, for clarity for others, is I had to make the folders in the /local folder to put the updated item.php file in.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sean US
Member
 
Total Posts:  58
Joined:  2008-10-01
 

I think this solution is great and very useful for many people running wholesale websites, but it is not clear. I am not very good with PHP so I had problems following up. Can you please create a more detailed post? Also after entered the code, in the view.phtml where and how do I set up the count that is valid for each product?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sean US
Member
 
Total Posts:  58
Joined:  2008-10-01
 

Hey dd_gi
I am trying your second version of the code. In the last step you are asking to enter/replace some code into the “Item.php” but it is not clear in which location. Can you please me more specific?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
sean US
Member
 
Total Posts:  58
Joined:  2008-10-01
 

oh my god, I think its working. I am testing it right now

 
Magento Community Magento Community
Magento Community
Magento Community
 
sean US
Member
 
Total Posts:  58
Joined:  2008-10-01
 

okay, its working and its exactly what I needed. Just one more thing. where do I set up the different languages? Can you give me the path for the file?

thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Hi dd_gi,

Thanks very much for this excellent post. It takes away most of my headache, but not all grin.

I would like to take it even one step further and would like to offer my customers a quantity dropdown-box from which they can only select the appropriate values, instead of the regular quantity entry field.

These values I would have stored in a text attribute of all products, called ‘orderable_quantity’, which would contain something like “3, 6, 12, 18, 36” etc. These values should be used to populate the quantity dropdown-box in product-detail view and shopping cart view.

On other pages, where there is only a “Add to shopping cart” button and no quantity option, the quantity put into the cart should be set to the lowest value in the “orderable_quantity” attribute of that product.

How would I add this to your piece of code?

Thanks for already making my day!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

I assume that in the cart you would leave the quantity field as-is.

On the shopping cart page, there should also be a dropdown-box for quantity, since customers should have no escape of entering an non-valid quantity. Is this what you meant?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Let’s say you have a part in which you allow it to be purchased in 3,6,9,12 qty. in the product view page, if a user selects “9” and adds to the cart, then later goes back and adds “6” quantity of that same part then you will have more quantity in the cart than what is defined by your dropdown.

Good point, I didn’t think of that. But I think this will not be a regular practice for people. Most of them would ‘up’ the quantity in the cart screen. But to make it absolutely fool-proof, there could be a message that, if you reached a invalid quantity in the shopping cart screen through this loophole. A message that might read something like: “The product you added has been changed to the next deliverable quantity.” or something along that line.

I would recommend you implement a hybrid approach, first apply a buy per multiple rule that would keep the user from improperly changing the value in the cart, then also change the front-end quantity to drop-down to keep the user tied to certain values on the front-end.

But buy per multiple implies a regular series of numbers. But we want for example to deliver 3, 6, 12, - not 9 - hence the list of valid numbers I suggested.

The one drawback to a dropdown for quantity is that it limits the user adding (at one time) no more than the quantities you define.

True. Can only be solved by making a large drop-down list.

Can you do this? Or is it too complex to do?

Thanks again!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

Great, thanks! This helps a lot!

I am still concerned about how to handle this in the cart since when the user adds to the cart twice then the select menu in the cart would fall apart.

Maybe one way would be to set the qty field on items in the cart with this attribute to read-only so users can’t change them

Can’t this be done with the suggestion I did? When somebody submits a new quantity of an article already in the cart, check against the orderable_quantity list and round the total ordered quantity to the next-highest in the orderable_quantity list (or the max value if ordered value exceeds the max value in orderable_quantity)? And of course signal a message to the user that a change has been made to his ordered quantity.
And then, in the cart, also have the drop-down box? Then there would be no room for error.

PS: the first part of your solution works like a jiffy!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haraldinho
Jr. Member
 
Total Posts:  24
Joined:  2009-09-25
 

That works as long as you are OK with the user being limited to the max value you enter in the drop down.  Do you have custom options applied to your products?  If so, different combinations of options with the same simple product will create different cart line items, possibly causing an issue for the limiting.

I haven’t any options, nor will there be in this specific shop. I am curious if you could post the code for the cart modifications. I am excited to try to see it work wink I am looking so long for this solution!

Thanks pal!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2