Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 60
  1. #31
    Join Date
    Mar 2004
    Posts
    688
    Plugin Contributions
    0

    Default Re: Minimum order for wholesale customers only.

    Did minimum_order work prior to trying to use this file?

  2. #32
    Join Date
    Feb 2008
    Posts
    55
    Plugin Contributions
    0

    Default Re: Minimum order for wholesale customers only.

    Yes. The message pops up on the shopping cart page for everyone.

  3. #33
    Join Date
    Mar 2004
    Posts
    688
    Plugin Contributions
    0

    Default 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

  4. #34
    Join Date
    Nov 2005
    Posts
    51
    Plugin Contributions
    0

    Default Re: Minimum order for wholesale customers only.

    Is there a working version available yet? I can't wait to see it working

  5. #35
    Join Date
    Feb 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Minimum order for wholesale customers only.

    Hi, i just discovered this thread.GREAT!!
    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() > && $_SESSION['customers_whole'] == && 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() > && $_SESSION['customers_whole'] == && 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
    Best regards, Zoli.

  6. #36
    Join Date
    Feb 2008
    Posts
    27
    Plugin Contributions
    0

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

  7. #37
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default 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
    M.Valenti
    Contemporary Artist - Entrepreneur
    http://www.manuelavalenti.com - http://www.byvalenti.com

  8. #38
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default 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!
    M.Valenti
    Contemporary Artist - Entrepreneur
    http://www.manuelavalenti.com - http://www.byvalenti.com

  9. #39
    Join Date
    Dec 2008
    Posts
    4
    Plugin Contributions
    0

    Default Re: Minimum order for wholesale customers only.

    Quote Originally Posted by mvstudio View Post
    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 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;

    }

    }

    }

    ?>

  10. #40
    Join Date
    Dec 2008
    Posts
    4
    Plugin Contributions
    0

    Default 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() > && 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() > && MIN_ORDER_AMOUNT 0) {

                  if(
    $_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {

                    
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));

                  }

                }

              }

            }

            break;

          default:

            break;

        }

      }

    }

    ?>

 

 
Page 4 of 6 FirstFirst ... 23456 LastLast

Similar Threads

  1. v150 Help with Minimum Order for Group Pricing Customers Only
    By philip937 in forum General Questions
    Replies: 5
    Last Post: 14 Oct 2013, 03:55 AM
  2. Need to have wholesale pricing with quantity discounts for wholesale customers only..
    By littleturtlemama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 16 Dec 2010, 04:47 AM
  3. Better Together extension for Wholesale Customers Only
    By point4design in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 28 Oct 2010, 11:49 PM
  4. Setting minimum order for check/money order only
    By coldspag in forum Managing Customers and Orders
    Replies: 0
    Last Post: 26 Nov 2008, 02:18 PM
  5. Need to have wholesale pricing with quantity discounts for wholesale customers only..
    By littleturtlemama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 29 Sep 2007, 10:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR