I have one manufacturer that has a $500 minimum order. No other manufacturer has it

Post By:user_5849 | Reply

I have a manufacturer that has a min $500 order before shipping. How can I set this up so anything below that threshold only to that manufacturer can be accomplised?

Any ideas?

Thanks in advace.
user_227Wed, 08 Aug 2012

The easiest way to do this would be to "override" the shopping_cart class; it's one of the auto-loaded classes, so an override is possible.

1) Create the folder /includes/classes/overrides and copy /includes/classes/shopping_cart.php into it.

2) Copy the file /includes/auto_loaders/config.core.php into /includes/auto_loaders/overrides and edit lines 63:64 (both 1.3.9 and 1.5.0):

Code:
$autoLoadConfig[0][] = array('autoType'=>'class',
                                'loadFile'=>'overrides/shopping_cart.php');
3) Edit the function get_products in /includes/classes/overrides/shopping_cart.php. You're interested in the path when $check_for_valid_cart is true. In the while-loop that checks each product in the cart, sum up the value of all products from your "special" manufacturer and just prior to returning from the function, if $check_for_valid_cart is true and the total of products from your manufacturer is less than $500, set $_SESSION['valid_to_checkout'] = false and append your custom error message to $_SESSION['cart_errors'].

P.S. If the notifier NOTIFIER_CART_GET_PRODUCTS_START raised by the shopping cart class included the value of $check_for_valid_cart, you could accomplish this using an observer class.

user_7498Wed, 08 Aug 2012

Could use this as well, any suggestions on where to go to get it done ?

user_314Wed, 11 Jul 2012

You're going to have to write custom code. Nothing is built in to handle a situation such as this.

`Reply Or Comment!
Please LogIn to Reply!