Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    May 2008
    Location
    Ukraine
    Posts
    71
    Plugin Contributions
    0

    help question Different free shipping depending on customer discount group

    Hi! I need to provide two different free shipping options depending on the customer's discount group. For instance, retail customer would get free shipping if his total is over $300. But for a wholesale customer I need to provide a different free shipping option, which is when their order is over $500.

    I will appreciate your help very much.

    Thank you.
    Zen-cart 1.3.8a
    www.api.kharkov.ua

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

    Default Re: Different free shipping depending on customer discount group

    How do you identify your Retail customer vs Wholesaler customer now?
    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. #3
    Join Date
    May 2008
    Location
    Ukraine
    Posts
    71
    Plugin Contributions
    0

    Default Re: Different free shipping depending on customer discount group

    Quote Originally Posted by Ajeh View Post
    How do you identify your Retail customer vs Wholesaler customer now?
    I use dual pricing mod, and also I put wholesalers into a distributor pricing group.
    Zen-cart 1.3.8a
    www.api.kharkov.ua

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

    Default Re: Different free shipping depending on customer discount group

    If you have a "flag" as in something that distinguishes the customer type you can use that on the modules to enable or disable a feature ...

    I am guessing that you are using the Modules ... Order Totals ... Shipping ot_shipping with the Free Shipping on Orders >= XX.XX setting ...

    You would want to customize the module for the value of where the:
    MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING

    key is and base that value instead on the customer type and the values you want to use ...
    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. #5
    Join Date
    May 2008
    Location
    Ukraine
    Posts
    71
    Plugin Contributions
    0

    Default Re: Different free shipping depending on customer discount group

    Quote Originally Posted by Ajeh View Post
    If you have a "flag" as in something that distinguishes the customer type you can use that on the modules to enable or disable a feature ...

    I am guessing that you are using the Modules ... Order Totals ... Shipping ot_shipping with the Free Shipping on Orders >= XX.XX setting ...

    You would want to customize the module for the value of where the:
    MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING

    key is and base that value instead on the customer type and the values you want to use ...
    Thank you very much for the answer. I am not good at code. Could you please specify which line of the code I need to change, and how?
    Zen-cart 1.3.8a
    www.api.kharkov.ua

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

    Default Re: Different free shipping depending on customer discount group

    Change the code in the ot_shipping.php from:
    Code:
            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
              $order->info['shipping_method'] = $this->title;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
    To read:
    Code:
    // check for customer group where wholesale group = 2
    $group_check = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    if ($group_check->fields['customers_group_pricing'] == 2) {
    // whole sale for over 500
      $over_total = 500;
    } else {
    // retail sale for over set amount
      $over_total = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
    }
            if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= $over_total) ) {
              $order->info['shipping_method'] = $this->title;
              $order->info['total'] -= $order->info['shipping_cost'];
              $order->info['shipping_cost'] = 0;
            }
    Change the = 2 to be the customers_group_pricing for the whole salers ...

    Set the value of the Free Shipping over XX.XX to be the 300.00 or what ever you want for retail to be ...

    This should work ... but, you are the guinea pig as I haven't had time to test it yet ...

    But it should work ... in theory ...
    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. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different free shipping depending on customer discount group

    Scratch that ... needs more customization so I am going to have to work on this a bit ... but getting there ...
    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!

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

    Default Re: Different free shipping depending on customer discount group

    Step 2 is to change the code in:
    /includes/modules/pages/checkout_shipping/header_php.php

    from:
    Code:
        $free_shipping = false;
        if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          $free_shipping = true;
        }
    to read:
    Code:
    // check for customer group where wholesale group = 2
    global $db, $cart;
    $group_check = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    
    if ($group_check->fields['customers_group_pricing'] == 2) {
    // whole sale for over 500
      $over_total = 500;
    } else {
    // retail sale for over set amount
      $over_total = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
    }
    
        $free_shipping = false;
        if ( ($pass == true) && ($_SESSION['cart']->show_total() >= $over_total) ) {
          $free_shipping = true;
        }
    Still need to fix the display on the template to know which value to show ... that will be step 3 ...
    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. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different free shipping depending on customer discount group

    Step 2B ... forgot the shipping estimator ...

    Change the file:
    /includes/modules/shipping_estimator.php

    the lines:
    Code:
        $free_shipping = false;
        if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) {
          $free_shipping = true;
          include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/ot_shipping.php');
        }
    Should read:
    Code:
    // check for customer group where wholesale group = 2
    global $db, $cart;
    $group_check = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    
    if ($group_check->fields['customers_group_pricing'] == 2) {
    // whole sale for over 500
      $over_total = 500;
    } else {
    // retail sale for over set amount
      $over_total = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
    }
    
        $free_shipping = false;
        if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) {
          $free_shipping = true;
          include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/ot_shipping.php');
        }
    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!

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

    Default Re: Different free shipping depending on customer discount group

    Step 3 ...

    Change the template file for:
    /includes/templates/template_default/templates/tpl_checkout_shipping_default.php

    where it reads:
    Code:
    <div id="defaultSelected"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . zen_draw_hidden_field('shipping', 'free_free'); ?></div>
    to read:

    Code:
    <?php
    // check for customer group where wholesale group = 2
    global $db, $cart;
    $group_check = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    
    if ($group_check->fields['customers_group_pricing'] == 2) {
    // whole sale for over 500
      $over_total = 500;
    } else {
    // retail sale for over set amount
      $over_total = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
    }
    ?>
    <div id="defaultSelected"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format($over_total)) . zen_draw_hidden_field('shipping', 'free_free'); ?></div>
    Then change the template file for the shipping estimator:
    /includes/templates/template_default/templates/tpl_modules_shipping_estimator.php

    where it reads:
    Code:
    <?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)); ?>
    to read:
    Code:
    <?php
    // check for customer group where wholesale group = 2
    global $db, $cart;
    $group_check = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
    
    if ($group_check->fields['customers_group_pricing'] == 2) {
    // whole sale for over 500
      $over_total = 500;
    } else {
    // retail sale for over set amount
      $over_total = MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER;
    }
    echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format($over_total));
    ?>
    NOTE: on all of these changes be sure to use your templates and override directories where applicable ...

    Wasn't that a fun time to write? Remember us when you are rich and famous!
    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 1 of 3 123 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 17 Sep 2013, 10:32 AM
  2. Is it possible to enable free shipping for only a certain customer group?
    By green couch designs in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 19 Apr 2011, 04:35 PM
  3. Free shipping for a group customer
    By charley518 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 14
    Last Post: 21 Jan 2010, 01:51 AM
  4. Free Standard Shipping only for Customers who DO NOT receive Group Discount Pricing?
    By lauriek in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 28 Aug 2009, 02:19 PM
  5. Free Shipping for Customer Group
    By Oozle in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 31 May 2009, 02:23 AM

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