Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Apr 2006
    Posts
    113
    Plugin Contributions
    0

    Default Re: Minimum FIRST TIME order fee

    Quote Originally Posted by ALiepinieks View Post
    i think it will cause you more headaches than granny buying her cotton balls. from a pure business perspective, you want to put as few obstacles as possible in front of your customer base, especially whoelsale or B2B customers as their business is more lucrative via its frequency and it's volume.

    losing a $200 order will prbably hurt more than shipping to granny (we're really getting on the granny bandwagon aren't we?), so i suspect a better solution would be to find another solution.

    i don't have an answer, however can see custom code being the best solution as it would not take much to check the number of previous orders before applying a restriction.

    andy

    I entirely agree with you except the OP said his boss was insisting on this system which we all agree is a bad idea. For our new site, we've decided to go with a flat rate shipping fee which more than covers the real cost for very tiny orders but FREE shipping for modest to large orders. We're trying to attract larger buyers and dont want to fiddle around with very low value small orders so free shipping and a flat rate that easily covers the small orders should work (I hope - we're not up and running on this one yet). We can switch back to actual cost if we find it is necessary but trying to offer something really simple and attractive.

    Simple is best of course - it is really nice to be able to explain our shipping policy in one short sentence. And I do think it would be best to try and change the boss' mind on this one.

    cheers
    Leah

  2. #12
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Minimum FIRST TIME order fee

    Have you looked at the Minimum Order in the Free Software Add Ons ...
    http://www.zen-cart.com/index.php?ma...roducts_id=599

    You could probably adapt that to check if the customer has made an order or not and use this to prevent checkouts of less than $100.00 if the customer does not yet have their first order ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #13
    Join Date
    Nov 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Minimum FIRST TIME order fee

    Quote Originally Posted by Ajeh View Post
    Have you looked at the Minimum Order in the Free Software Add Ons ...
    http://www.zen-cart.com/index.php?ma...roducts_id=599

    You could probably adapt that to check if the customer has made an order or not and use this to prevent checkouts of less than $100.00 if the customer does not yet have their first order ...
    This would help with my current project.

    It looks like this is the section of the addon to edit:

    Code:
              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');
              }
    How would I amend statement to check if customer has ordered before?

    Thanks for any help :)

  4. #14
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Minimum FIRST TIME order fee

    Code:
    // check for at least 1 existing order 
    $sql = "SELECT orders_id from " . TABLE_ORDERS . " WHERE customers_id = '" . $_SESSION['customer_id'] . "' limit 1";
    $chk_customers_orders = $db->Execute($sql);
    if (!$chk_customers_orders->fields['orders_id'] > 0) {
      $charge_minimum = true;
    } else {
      $charge_minimum = false;
    }
    
              if($charge_minimum && $_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');
              }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #15
    Join Date
    Nov 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Minimum FIRST TIME order fee

    Thanks for your help.

    I tried that and it doesn't work. Causes white screen.

    I think I should have posted more of the code.

    This is the whole class.minimum_order_amount.php file in includes/classes/observers

    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 && MIN_ORDER_AMOUNT > 0) {
    		
    		// check for at least 1 existing order 
    			$sql = "SELECT orders_id from " . TABLE_ORDERS . " WHERE customers_id = '" . $_SESSION['customer_id'] . "' limit 1";
    			$chk_customers_orders = $db->Execute($sql);
    			if (!$chk_customers_orders->fields['orders_id'] > 0) {
    				$charge_minimum = true;
    			} else {
      $charge_minimum = false;
    			}
              if($charge_minimum && $_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 && MIN_ORDER_AMOUNT > 0) {
              if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
                zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
              }
            }
            break;
          default:
            break;
        }
      }
    }
    ?>

  6. #16
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Minimum FIRST TIME order fee

    And if you add a
    global $db;

    above the line that starts:
    $sql

    what happens?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #17
    Join Date
    Nov 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Minimum FIRST TIME order fee

    It works like a charm. Thank you for your help Ajeh

    If anyone is interested in Minimum Order for first order only, use the Minimum Order addon and substitute includes/classes/observers/class.minimum_order_amount.php with the code below:
    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 && MIN_ORDER_AMOUNT > 0) {
    		
    		// check for at least 1 existing order 
    			global $db;
    			$sql = "SELECT orders_id from " . TABLE_ORDERS . " WHERE customers_id = '" . $_SESSION['customer_id'] . "' limit 1";
    			$chk_customers_orders = $db->Execute($sql);
    			if (!$chk_customers_orders->fields['orders_id'] > 0) {
    				$charge_minimum = true;
    			} else {
      $charge_minimum = false;
    			}
              if($charge_minimum && $_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 && MIN_ORDER_AMOUNT > 0) {
              if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
                zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
              }
            }
            break;
          default:
            break;
        }
      }
    }
    ?>
    Also edit the language files to something more suitable for First Order.

  8. #18
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Minimum FIRST TIME order fee

    You are most welcome ...

    Thanks for the update that this code is now working properly for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #19
    Join Date
    Nov 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Minimum FIRST TIME order fee

    Sorry but I didn't test thoroughly enough.

    If I try and order a 2nd time there are no messages or errors but attempting to go to checkout_shipping page just loads the Shopping Cart page.

  10. #20
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Minimum FIRST TIME order fee

    Put the IF test above the case statement then add the results to both case statements that are checking the cart ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Minimum Order Fee module
    By jdw1979 in forum General Questions
    Replies: 13
    Last Post: 30 Nov 2011, 04:44 PM
  2. Coupon for first time order?
    By makenoiz in forum General Questions
    Replies: 1
    Last Post: 26 May 2010, 07:15 PM
  3. Minimum Order Fee
    By prosam in forum Managing Customers and Orders
    Replies: 5
    Last Post: 17 Jun 2008, 04:35 PM
  4. Charge a one-time shipping and handling fee per order
    By dharma in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 30 Apr 2007, 03:36 PM
  5. Added charge, one-time deposit/fee, minimum order
    By Pozitech in forum Managing Customers and Orders
    Replies: 2
    Last Post: 7 Nov 2006, 03:40 PM

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