Minimum order for wholesale customers only.
I am using the "Dual Pricing - Wholesale Pricing" module and want to set up a minimum order amount that only applies to customers in a wholesale group.
I installed the Minimum Order contribution and it's working prefectly, now I just need to figure out how to exclude non wholesale customers.
My thought was that this could be accomplished by editing the class.minimum_order_amount.php file and adding another if statement related to the customers wholesale group, but I can't seem to get it working.
Any help would be appreciated.
Re: Minimum order for wholesale customers only.
Does anyone have any suggestions for me?
Re: Minimum order for wholesale customers only.
I am interested in this information also.
Thanks!
Re: Minimum order for wholesale customers only.
I am interested too. Please help!
Re: Minimum order for wholesale customers only.
There is an add-on for Minimum Order in the Downloads ...
You could modify that with your wholesale identifier so that only those customers are looked at for this minimum order module ...
Re: Minimum order for wholesale customers only.
Quote:
Originally Posted by
Ajeh
You could modify that with your wholesale identifier so that only those customers are looked at for this minimum order module ...
Can anyone explain how to do this? Thanks!!!
Re: Minimum order for wholesale customers only.
How are you identifying wholesale from retail customers?
Re: Minimum order for wholesale customers only.
I was hoping to use the minimum order mod on my wholesale group pricing only. Can this be accomplished?
Re: Minimum order for wholesale customers only.
PHP Code:
<?php
/**
* class.minimum_order_amount.php
*
* @copyright Copyright 2005-2007 Andrew Berezin eCommerce-Service.com
* @copyright Portions Copyright 2003-2006 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: config.minimum_order_amount.php 1.0.1 20.09.2007 0:06 AndrewBerezin $
*/
/**
* Observer class used to check minimum order amount
*
*/
class minimum_order_amount extends base {
/**
* constructor method
*
* Attaches our class to the ... and watches for 4 notifier events.
*/
function minimum_order_amount() {
global $zco_notifier;
// $_SESSION['cart']->attach($this, array('NOTIFIER_CART_GET_PRODUCTS_START', 'NOTIFIER_CART_GET_PRODUCTS_END'));
$zco_notifier->attach($this, array('NOTIFY_HEADER_END_SHOPPING_CART', 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING', 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT', 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION'));
}
/**
* Update Method
*
* Called by observed class when any of our notifiable events occur
*
* @param object $class
* @param string $eventID
*/
function update(&$class, $eventID) {
global $messageStack;
global $currencies;
switch ($eventID) {
case 'NOTIFIER_CART_GET_PRODUCTS_END':
case 'NOTIFY_HEADER_END_SHOPPING_CART':
if ($_SESSION['cart']->count_contents() > 0 && $_SESSION['customers_whole'] == 1 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
$_SESSION['valid_to_checkout'] = false;
$messageStack->add('shopping_cart', sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format(MIN_ORDER_AMOUNT)) . '<br />', 'caution');
}
}
break;
case 'NOTIFY_HEADER_START_CHECKOUT_SHIPPING':
case 'NOTIFY_HEADER_START_CHECKOUT_PAYMENT':
case 'NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION':
if ($_SESSION['cart']->count_contents() > 0 && $_SESSION['customers_whole'] == 1 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
}
break;
default:
break;
}
}
}
?>
Replace your includes/classes/observers/class.minimum_order_amount.php
With the above code. Use this ONLY if you have Dual Pricing - Wholesale Pricing installed.
Re: Minimum order for wholesale customers only.
ok, I have a totally separate wholesale site. Is there a way to set up a minimum order there? would that mod work?