Magento – Bundled product: Max quantity per sub-product, not whole shoppingcart

bundled-productquantity

I have a bundled product called "Virtual Server" which has three simple products: CPU, Memory and Diskspace. A single server may not have more than 16 Gb of memory, 4 CPU's, etc. I have limited the maximum quantity for CPU, Memory and Diskspace per server ordered by setting the "Maximum Qty Allowed in Shopping Cart" on each simple product.

The problem is: I need people to be able to order multiples of the same virtual server at the same time. For example, a user should be able to order 4 x server with each server having a maximum of 16 Gb of memory. (There is no limit on the maximum number of servers a user can order).

In my current setup, the maximum quantity is enforced per shopping cart. Since 4 x 16 Gb = 64 Gb, Magento complains that the maximum quantity is exceeded.

After extensive googling, I can't figure out how I can do that. Can anybody shine a light on how to accomplish this?

Best Answer

This is going to be unpopular if you've already done a lot of work on your catalog. So - take it with a grain of salt.

In reality you're not really selling a bundle of products that have varying quantities - having 64GB of RAM in a server may equate to 4x 16GB but does your customer have to know or intuit that? It should just be an option in-and-of itself and not have to deal with quantities. It also sounds like there is a relationship between all of the attributes.

So in this case you're really describing a configurable product.

A configurable product is a product that has many variations that all have fixed specifications. Take a tshirt for instance:

  • It can come in red, blue, green
  • It can come in small, large, xlarge
  • It can come in male, female, tanktop varieties

Each of these products is actually a separate product - e.g. a small red tanktop or a large green male tshirt and for each of these you have a finite quantity available. That is to say that you can sell out of the small size but still have an xlarge available in the same color and style.

So I would recommend that you reconfigure your catalog to these specifications. You would have the following configurable attributes on a Virtual Server:

  • RAM quantities (2, 4, 8, 16, 32, 64GB)
  • CPU quantities (1x, 2x, 4x, 8x, 16x)
  • HDD space (100, 250, 500, 1000GB)

And then you would have physical products that represent each of those configurations. E.g. a 100GB 2xCPU server with 16GB RAM.

Magento helps you create these by defining the pivot attributes and then in the parent configurable product creation screen suggesting that it create the products on your behalf. That helps speed some of this up.

This also lets you avoid the situation where you know you won't be able to accomodate a 16CPU/64GB/1TB box - just mark that option out of stock.

When added to the cart this appears as a single line item with a description and they can then change the quantities at-will.

Hope that helps.

Related Topic