0
votes

I'm setting up a Magento site for a client who sells Fabric and other related materials. There is a minimum of .5 yard for any one Fabric product, After that, it can go to any amount, but the minimum is .5. Currently I'm able to type in .25, .125, etc. and add those to the shopping cart.

I only want this to apply to the Fabric products (there are around 2000 different fabric products) but not to the other types she sells on her site, like Rulers, needles, buttons, etc... I don't want people to be able to purchase .5 buttons.

Thanks

1
you can limit the 'minimum quantity' of a product in the shopping cart by editing the value on the 'Inventory' tab in product infromation when editing a product.Manju
Its not letting me enter in a decimal for this.Christina Rule

1 Answers

0
votes

You might need an observer for this that monitors the checkout_cart_product_add_after event. This event passes the following parameter:

array('quote_item' => $result, 'product' => $product)

Here, you could check the quantity via quote_item and the product's category (if it's fabric or not) via product. What I imagine you could do here is remove the specific quote item from cart if it is a decimal value and not a member of the 'Fabric' category.

Good luck.