Re: Minimum order for wholesale customers only.
Yes, it would. But use it normally, of course, without the above edit.
Re: Minimum order for wholesale customers only.
Roger that. Thanks!!!!:clap:
Re: Minimum order for wholesale customers only.
I was just noticing this post, Marg, that looks great.
My particular issue is I'm using Group Pricing instead of Dual Pricing. Is there a way to modify this sheet to do it for only the Group Pricing?
Thanks very much in advance...
Re: Minimum order for wholesale customers only.
I must have missed the email for this post. Did you find your answer, pensive?
Re: Minimum order for wholesale customers only.
Hi Marg,
Nope not yet... but still working on it.
Ill keep you posted if I get it right..!
Take care...
Re: Minimum order for wholesale customers only.
Quote:
Originally Posted by
Marg
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.
This code doesn't work. First I copy and pasted it all and it makes a blank page show up after pressing checkout. So then I just copied the lines thath ave 'customers_whole' in it. The blank page doesn't show up any more, but the minimum order no longer works. Do you have a solution?
http://www.fragrantrainsoap.com/store/
Re: Minimum order for wholesale customers only.
This is for 1.3.8a Zen Cart
If that's what you are using then use this:
http://www.zen-cart.com/forum/showthread.php?t=84613
To debug an dput your error here..
Re: Minimum order for wholesale customers only.
[21-May-2008 14:42:27] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/fragra5/public_html/store/includes/classes/observers/class.minimum_order_amount.php:61) in /home/fragra5/public_html/store/includes/functions/functions_general.php on line 44
Re: Minimum order for wholesale customers only.
You're welcome :c)
What is on the line 61:
home/fragra5/public_html/store/includes/classes/observers/class.minimum_order_amount.php:61
Cut and paste... There will be the issue
That simple
Re: Minimum order for wholesale customers only.
It was just the closing tag: ?>
But I think there was something hidden, because I copy over the old code for the bottom and now it's fine... There's no white screen after pressing checkout... but it also doesn't have the minimum order acvitavted anymore. It's letting me checkout.