Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / How to restrict minimum quantity per product attribute?

How to restrict minimum quantity per product attribute?

Locked

Views: 1,151

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
7 Nov 2010, 8:40 PM
#1
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

How to restrict minimum quantity per product attribute?

Hi, I am building a new zen cart with 1.3.9h. I have configured products with attributes (three different colours for the same type of product). I need to set a minimum quantity. I have set the minimum quantity in the products setup page, but I need a further level of restriction. I need every colour (attribute) to have a minimum of 10.

I would like to create a work around solution, which is to set a global minimum of 10 that can be added to the cart, regardless of product type and attribute. Could one of the Zen Cart experts please point towards the script that controls where quantity is added to the cart? I want to make simple mod, e.g., "if quantity < 10, quantity = 10"

Many thanks.

7 Nov 2010, 10:28 PM
#2
wilorc avatar

wilorc

New Zenner

Join Date:
Sep 2009
Posts:
65
Plugin Contributions:
0

Re: How to restrict minimum quantity per product attribute?

Please ignore, I have found what I'm looking for. The answer was to add the following to the section with label ```
//echo 'I SEE actionAddProduct: ' . $_POST['products_id'] . '<br>';


Line 1624 in version 1.3.9g of includes/classes/shopping_cart.php

    if ($new_qty < 20) {
            $new_qty = 20;
    }