-
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?
-
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.
-
Re: Minimum order for wholesale customers only.
What's on the line 44 in /home/fragra5/public_html/store/includes/functions/functions_general.php?
-
Re: Minimum order for wholesale customers only.
header('Location: ' . $url);
-
Re: Minimum order for wholesale customers only.
Is it possible there was a line break at the end of the file? After the closing php tag?
-
Re: Minimum order for wholesale customers only.
In the functions file or class.minimum_order_amount.php?
-
Re: Minimum order for wholesale customers only.
class.minimum_order_amount.php
-
1 Attachment(s)
Re: Minimum order for wholesale customers only.
Nope. And I know I'm logged in as a whole account because I can see both prices. See attached. But it's letting me check out. And I have the minimum set to $200.
-
Re: Minimum order for wholesale customers only.
I thought you had said you replaced the file with the older one... What older one file? The one that came with minimum_order?
-
1 Attachment(s)
Re: Minimum order for wholesale customers only.
It's the one you added to.
-
Re: Minimum order for wholesale customers only.
Hm... So for certain, line 50 look like this?
if ($_SESSION['cart']->count_contents() > 0 && $_SESSION['customers_whole'] ==1 && MIN_ORDER_AMOUNT > 0) {
-
Re: Minimum order for wholesale customers only.
if ($_SESSION['cart']->count_contents() > 0 && $_SESSION['customers_whole'] == 1 && MIN_ORDER_AMOUNT > 0) {
-
Re: Minimum order for wholesale customers only.
Did minimum_order work prior to trying to use this file?
-
Re: Minimum order for wholesale customers only.
Yes. The message pops up on the shopping cart page for everyone.
-
Re: Minimum order for wholesale customers only.
This code is incomplete... do not use the file I stated on this topic, it will not work. I am working on getting a formal contribution addition together...
Marg
-
Re: Minimum order for wholesale customers only.
Is there a working version available yet? I can't wait to see it working
-
Re: Minimum order for wholesale customers only.
Hi, i just discovered this thread.GREAT!!:clap::clap:
i have dual pricing and minimum order and wanted for a long time limit the minimim order to some customers only.
I am using 1.38a and the folowing code worked for me, i coppyed all and then pasted over in my .../includes/classes/observers/class.minimum_order_amount.php
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;
}
}
}
?>
Great work again Marg :clap::clap::clap::clap:
Best regards, Zoli.
-
Re: Minimum order for wholesale customers only.
It's me again.As i sayd it works for me.
I think that this only works if you have the latest version of DualPrice(i have it) beacuse it relies on $_SESSION['customers_whole'] defined in /includes/modules/pages/login/header.php
Or you could do the follwing:
-create a new table in the database customers callled customers_morder (or what you want)
-edit /includes/modules/pages/login/header.php and the following
arround line 48 add customers_morder before FROM " . TABLE_CUSTOMERS . " WHERE customers_email_address = :emailAddress";
PHP Code:
$check_customer_query = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, customers_authorization, customers_referral, customers_whole, customers_morder
FROM " . TABLE_CUSTOMERS . " WHERE customers_email_address = :emailAddress";
-arround line 90 after $_SESSION['customer_whole'] = $check_customer->fields['customers_whole']; add $_SESSION['customer_morder'] = $check_customer->fields['customers_morder'];
PHP Code:
$_SESSION['customer_whole'] = $check_customer->fields['customers_whole'];
$_SESSION['customer_morder'] = $check_customer->fields['customers_morder'];
-change in /includes/classes/observers/class.minimum_order_amount.php (in 2 places) $_SESSION['customers_whole'] to $_SESSION['customers_morder']
- thats all, maybe you want control this over the admin for each customer, thats also possibel.
If you want to use this feature only for wholeslae customers i suggest to upgrade your DualPricing version.
Hope this is helpfull to some one.
Best regards Zoli.
-
Re: Minimum order for wholesale customers only.
Hello, this mod is not working for me at all. Not for retail nor for wholesale.
I'm using the latest version of dual pricing and simple checkout.... any ideas on how to make this work??
Thank you in advance
-
Re: Minimum order for wholesale customers only.
One more thing, would it possible to have a field in the admin - customers area to manually enter the minimum amount order?
I have two sets of wholesale customers and with one I need a minimum amount order but not with the other.
I'm pretty sure there are others in my ame situation who would benefit tremendously by this mod.
Thank you!
-
Re: Minimum order for wholesale customers only.
Quote:
Originally Posted by
mvstudio
Hello, this mod is not working for me at all. Not for retail nor for wholesale.
I'm using the latest version of dual pricing and simple checkout.... any ideas on how to make this work??
Thank you in advance
mvstudio -
I have been :frusty: this for some time now and look to have figured out a solution. So far this is working on my test site. I am by no means a programmer so it may not be the cleanest.
Feedback is always welcome.
replace code in: /includes/classes/observers/class.minimum_order_amount.php code
with the following:
<?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 (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
if ($_SESSION['customer_whole'] != '' > 0) {
if ($_SESSION['cart']->count_contents() > 0 && 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 (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
if ($_SESSION['customer_whole'] != '' > 0) {
if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
}
}
}
break;
default:
break;
}
}
}
?>
-
Re: Minimum order for wholesale customers only.
Let's try to make that last post a little easier to use....
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 (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
if ($_SESSION['customer_whole'] != '' > 0) {
if ($_SESSION['cart']->count_contents() > 0 && 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 (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
if ($_SESSION['customer_whole'] != '' > 0) {
if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
}
}
}
break;
default:
break;
}
}
}
?>
-
Re: Minimum order for wholesale customers only.
Nicely done. Works like a charm.
-
Re: Minimum order for wholesale customers only.
I'm afraid with the latest version of Dual Pricing this change is not working. Minimum order amount is being ignored completely and checkout is allowed regardless of order amount.
-
Re: Minimum order for wholesale customers only.
Is there any way to make it only work with one set of wholesale customers, I have 4 wholesale groups and only need it on 1???
-
Re: Minimum order for wholesale customers only.
I am looking for some assistance with my website. www.flyfishingsigns.com .
In particular, I am looking for somebody who is familiar with this Wholesale Mod.
http://www.zen-cart.com/index.php?ma...roducts_id=166
I would like to utilize this site as retail and wholesale. The site works as retail until the order reaches $200. I would like to have a box in the check-out page of the site say “Attention Wholesale Customes: Once the $ total amount of your order reaches $200, these retail prices will automatically change the wholesale prices.” How do I make sure that the wholesale buyer purchases the $200 minimum order?
If you are not familiar with this mod or would like to suggest somebody who is more familiar and comfortable with this install, please forward their contact information.
Thanks,
Erik I. Pieper
307-237-3733 Office
307-259-6164 Cell
[email protected]
-
Re: Minimum order for wholesale customers only.
Correcting my last post. The latest works, but it throws a blank checkout_shopping.php page. Any ideas?
-
Re: Minimum order for wholesale customers only.
This code is only for:
Minimum Amount for Wholesale Customers with Dual Pricing Module After Bug Fix Only.
Bug fix for Dual Pricing Module at page #69 http://www.zen-cart.com/forum/showth...=35450&page=69
After the bug fix, replace the code in this file:
/includes/classes/observers/class.minimum_order_amount.php
With this code:
Quote:
<?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_wholesale'] == 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_wholesale'] == 1 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
}
break;
default:
break;
}
}
}
?>
*Note: Thanks to Marg http://www.zen-cart.com/forum/showthread.php?t=91542 for the code, i just changed "customers_whole" to "customers_wholesale" to make it work with the Dual Pricing Bug fix.
Goodluck.:bigups:
-
Re: Minimum order for wholesale customers only.
In addition to the previous post:
If you want to allow a few wholesale customers to purchase from your site with no minimum amount.
Go to admin controls>Customer>customer>edit which ever customer you want to allow buy wholesale without minimums and change their "Wholesale pricing level" to 2 instead of 1.
Assuming you've only set 1 level of wholesale pricing.
- 0 Automatic retail pricing for retail customers only.
- 1 This level is for wholesale customers with a minimum amount that you set.
- 2 This level is for wholesale customers with NO minimum amount.
Note* This is only for Minimum Amount for Wholesale Customers with Dual Pricing Module After Bug Fix Only.
Bug fix for Dual Pricing Module at page #69 http://www.zen-cart.com/forum/showth...=35450&page=69
Goodluch Zenning. :smile:
-
Re: Minimum order for wholesale customers only.
thank you for the update on this. I made the changes and like you say it works for wholesale customers level 1. Is there any way to make it work for customers wholesale level 2 and 3? We have minimum order amounts on each level. It would be nice if this could be applied to other wholesale levels as well.
-
Re: Minimum order for wholesale customers only.
Work for me too. Is there anyway to change it to minimum quantity per product?
-
Re: Minimum order for wholesale customers only.
Has anyone got this wholesale minimum order to work alongside the minimum order for retail?
I am needing both wholesale and retail minimum first orders and minimum orders after that.
Does anyone have any suggestions? :unsure:
-
Re: Minimum order for wholesale customers only.
Just to chime in and hopefully help someone else on the thread; the best way is to use 'not equal to' instead, so you can catch all the higher level of wholesale customers too (not just the 1st level). Also notice singular 'customer_whole' (that may be different depending on your Dual Pricing version).
Code:
if ($_SESSION['cart']->count_contents() > 0 && $_SESSION['customer_whole'] != 0 && MIN_ORDER_AMOUNT > 0)
-
Re: Minimum order for wholesale customers only.
Hello,
I am reading this post and I have installed the php as suggested. I now have box in my product box a product quantity add minimum unit mix yes or no. I have yes on and I have in wholesale prices the price. I have tried all the boxes relating to product min amount etc. In the main web (retail) the box shows in the catalog either with 1 if I set 1 or 5 if I set 5 to these figures. How do I work this script should I have to change something in the script?
Any help is greatly appreciated as I just can't figure it out.
Thanks
Ron
-
Re: Minimum order for wholesale customers only.
Hi Ron,
Please let us know the following to help you troubleshoot:
- A link to your store
- What version of ZenCart
- What PHP did you install? Which module/version, and did you customize it?
- If you did customize, please provide the code here so we can have a look.
-
Re: Minimum order for wholesale customers only.
Hello,
My website is www.stuffwholesale.com I have install this code and have not modified it.
My zencart store is on V1.50 and I am using dual pricing 2.1
Code:
Quote:
/includes/classes/observers/class.minimum_order_amount.php
<?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_wholesale'] == 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_wholesale'] == 1 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
}
break;
default:
break;
}
}
}
?>
-
Re: Minimum order for wholesale customers only.
I can't seem to find a product with multiple prices/attributes, or a minimum order amount in the cart. Can you provide a link directly to an affected product, and explain exactly what you would like it to do?
-
Re: Minimum order for wholesale customers only.
Here is the link You will need to login use my login "stuffwholesale###################### pass 6KAN95k" This is my wholesale account level in dual pricing. You will see that the minimum quantity is on both pages 5 I want it to be 1 on the retail page then when you log in wholesale you would get your appropriate pricing but have to order the minimum of 5. Thanks for your help.
-
Re: Minimum order for wholesale customers only.
Ah, I see what you mean now. There is no built-in functionality to Dual Pricing or to the Minimum Order, to make wholesalers purchase a minimum quantity of a product. This Minimum Order applies to dollar amounts for the total order. I recommend you hire a skilled developer to build a Wholesale Minimum Quantity feature for you. Here's a link to the developer listings: http://www.zen-cart.com/forumdisplay...rt-Contractors
-
Re: Minimum order for wholesale customers only.
Thanks very much for your help, I have contacted a person, do you do this work?
-
Re: Minimum order for wholesale customers only.
Quote:
Originally Posted by
RonGin
Thanks very much for your help, I have contacted a person, do you do this work?
Hi, Can anyone advise me please! www.ew-trading.com
Have today installed dual pricing as want to separate retail and wholesale sections - all fine. Installed Minimum order module and all ok but seems to be an issue with the auto_loaders/config.minimum_order_amount.php, was showing blank sceens and trial and error leaves me with this file removed so site can function, and as such, module isn't working... all other files ok but each time I try and load this I get blank screens. Any advice?? Using 1.3.9 zencart.
Thanks!
-
Re: Minimum order for wholesale customers only.
Quote:
Originally Posted by
bumpspt
Let's try to make that last post a little easier to use....
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 (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
if ($_SESSION['customer_whole'] != '' > 0) {
if ($_SESSION['cart']->count_contents() > 0 && 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 (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
if ($_SESSION['customer_whole'] != '' > 0) {
if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
}
}
}
break;
default:
break;
}
}
}
?>
im not sure where this code can work on 1.5.5f for minimum order.
my website not using minimum order, instead using minimum quantity.
i just straightly use your code and do some changes from order to quantity.
works like charm! thanks bro.
zc 1.5.5f