Zen Cart Logo
Forums / All Other Contributions/Addons / Minimum order for wholesale customers only.

Minimum order for wholesale customers only.

Views: 15,214

Results 1 to 20 of 60
14 Mar 2008, 5:57 PM
#1
pjb923 avatar

pjb923

Zen Follower

Join Date:
Jan 2005
Location:
NY
Posts:
135
Plugin Contributions:
0

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.

3 Apr 2008, 1:56 PM
#2
pjb923 avatar

pjb923

Zen Follower

Join Date:
Jan 2005
Location:
NY
Posts:
135
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

Does anyone have any suggestions for me?

10 Apr 2008, 5:22 PM
#3
akknifemaker avatar

akknifemaker

New Zenner

Join Date:
Apr 2008
Posts:
1
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

I am interested in this information also.

Thanks!

20 Apr 2008, 11:16 PM
#4
hgrubb avatar

hgrubb

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

I am interested too. Please help!

20 Apr 2008, 11:21 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ...

21 Apr 2008, 1:19 AM
#6
hgrubb avatar

hgrubb

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

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!!!

21 Apr 2008, 1:27 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Minimum order for wholesale customers only.

How are you identifying wholesale from retail customers?

21 Apr 2008, 1:31 AM
#8
hgrubb avatar

hgrubb

New Zenner

Join Date:
Mar 2008
Posts:
26
Plugin Contributions:
0

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?

22 Apr 2008, 10:46 AM
#9
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

<?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.

24 Apr 2008, 2:49 AM
#10
mooncavecrystals avatar

mooncavecrystals

Zen Follower

Join Date:
Sep 2006
Posts:
455
Plugin Contributions:
0

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?

24 Apr 2008, 8:25 AM
#11
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

Yes, it would. But use it normally, of course, without the above edit.

24 Apr 2008, 2:17 PM
#12
mooncavecrystals avatar

mooncavecrystals

Zen Follower

Join Date:
Sep 2006
Posts:
455
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

Roger that. Thanks!!!!:clap:

24 Apr 2008, 10:42 PM
#13
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

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...

12 May 2008, 11:28 AM
#14
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

I must have missed the email for this post. Did you find your answer, pensive?

12 May 2008, 6:46 PM
#15
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

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...

21 May 2008, 9:25 PM
#16
shokuf avatar

shokuf

New Zenner

Join Date:
Feb 2008
Posts:
56
Plugin Contributions:
0

Re: Minimum order for wholesale customers only.

Marg:

<?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/>
21 May 2008, 9:32 PM
#17
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

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..

21 May 2008, 9:43 PM
#18
shokuf avatar

shokuf

New Zenner

Join Date:
Feb 2008
Posts:
56
Plugin Contributions:
0

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

21 May 2008, 10:01 PM
#19
marg avatar

marg

Totally Zenned

Join Date:
Mar 2004
Posts:
642
Plugin Contributions:
0

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

21 May 2008, 10:07 PM
#20
shokuf avatar

shokuf

New Zenner

Join Date:
Feb 2008
Posts:
56
Plugin Contributions:
0

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.