Buy multiple of the same product in different sizes
-
12-12-2019 - |
Question
I am creating a store for a brewery. They would like to sell a type of beer in small bottles and large bottles. So on the frontend I would like them to enter a quantity number next to a size option.
For example:
BEER NUMBER ONE
|3| x 250ml Bottle
|0| x 500ml Bottle
Can anyone suggest how I might set this up in the admin?
Thanks
Solution
You can do this by using a Grouped product. For this you need to create the different sizes you want to sell as simple products and then create a new Grouped product where you assign the simple products. In the frontend this will allow the user to enter a qty per size to easily order the amount needed.
OTHER TIPS
I don´t know how to set it up in the admin and I think you might have to change the phtml file. In your list .phtml where you have your add to cart button
<?php if($_product->isSaleable()): ?>
<p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
try this piece of code instead
<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form_<?php echo $_product->getId()?>"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
<?php if(!$_product->isGrouped()): ?>
<label for="qty"><?php echo $this->__('Qty') ?>:</label>
<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php echo ($this->getMinimalQty($_product)?$this->getMinimalQty($_product):1) ?>" />
<?php endif; ?>
<button type="button" class="button" onclick="this.form.submit()"><span><span><span><?php echo $this->__('Add to Cart') ?></span></span></span></button>
</form>