Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Handling fee with zone module

    Our store uses zone rates shipping module. We want to charge handling fee based on purchase price. Based on a suggestion in a previous forum thread for UPS module I added the code
    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
    'methods' => array(array('id' => $this->code,
    'title' => $shipping_method,
    'cost' => $shipping_cost+($order->info['subtotal'] * MODULE_SHIPPING_ZONES_HANDLING_)) * $shipping_num_boxes));
    The code crashed. Obviously there is an error in the line
    'cost' => $shipping_cost+($order->info['subtotal'] * MODULE_SHIPPING_ZONES_HANDLING_)) * $shipping_num_boxes));
    Can someone help? Coffee and donuts for the good samaritan.

  2. #2
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

  3. #3
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Handling fee with zone module

    I have and the zone module is working perfectly. The problem is adding the handling fee as a percent of purchase price. That is where I followed the idea given below. I am not sure how to set the handling fee correctly as percent of purchase price.
    http://www.zen-cart.com/forum/showthread.php?t=60865

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

    Default Re: Handling fee with zone module

    The Handling Fee is added in with this case statement:
    Code:
              switch (MODULE_SHIPPING_ZONES_METHOD) {
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Weight'):
                  // charge per box when done by Weight
                  // Handling fee per box or order
                  if (constant('MODULE_SHIPPING_ZONES_HANDLING_METHOD_' . $dest_zone) == 'Box') {
                    $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) * $shipping_num_boxes;
                  } else {
                    $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
                  }
                  break;
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Price'):
                  // don't charge per box when done by Price
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
                break;
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Item'):
                  // don't charge per box when done by Item
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
                break;
              }
    You can alter the method of the Handling Fee from being added in to be a percentage instead using the:
    $order->info['subtotal']
    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
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Handling fee with zone module

    Thanks a million. Just bought the team coffee and donut. I will report on the success soon.

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

    Default Re: Handling fee with zone module

    Quote Originally Posted by Arunachala View Post
    Thanks a million. Just bought the team coffee and donut. I will report on the success soon.
    Thanks very much for the support! We really appreciate it greatly ... keeps us humming along ...
    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: Handling fee with zone module

    NOTE: for use with Shipping Estimator and Guests etc. ... a better choice on obtaining the subtotal of the cart for the calculation is:
    $_SESSION['cart']->show_total()

    Something along the lines of:
    Code:
    global $cart;
    echo 'Handling: ' . 'subtotal: ' . $_SESSION['cart']->show_total() . ' ' . constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) * $_SESSION['cart']->show_total() . ' = ' . (strstr(constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone), '%') ? constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) /100 * $_SESSION['cart']->show_total() : constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone)) . '<br>';
    Then change the current calculations of the handling fee to use the calculation included in that echo:
    Code:
    (strstr(constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone), '%') ? constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) /100 * $_SESSION['cart']->show_total() : constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone))
    This would allow you to change the Handling from 10% to 7.00 on a per Zone basis ... without having to do a lot of extra work ...
    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
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Handling fee with zone module

    Quote Originally Posted by Ajeh View Post
    NOTE: for use with Shipping Estimator and Guests etc. ... a better choice on obtaining the subtotal of the cart for the calculation is:
    $_SESSION['cart']->show_total()

    Something along the lines of:
    Code:
    global $cart;
    echo 'Handling: ' . 'subtotal: ' . $_SESSION['cart']->show_total() . ' ' . constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) * $_SESSION['cart']->show_total() . ' = ' . (strstr(constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone), '%') ? constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) /100 * $_SESSION['cart']->show_total() : constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone)) . '<br>';
    Then change the current calculations of the handling fee to use the calculation included in that echo:
    Code:
    (strstr(constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone), '%') ? constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) /100 * $_SESSION['cart']->show_total() : constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone))
    This would allow you to change the Handling from 10% to 7.00 on a per Zone basis ... without having to do a lot of extra work ...
    Bear with me. Does this statement go inside the switch case or is it a stand alone. I have coded in C++ but new to PHP

 

 

Similar Threads

  1. Handling fee does not work freeshipping with zone rate
    By Arunachala in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 26 Jul 2011, 06:35 PM
  2. Zone table- Handling Fee is not added to the shopping basket
    By joe1joe1 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 27 Oct 2010, 06:37 PM
  3. Handling Fee per item with zipship module
    By xtracool in forum Addon Shipping Modules
    Replies: 0
    Last Post: 9 May 2009, 04:04 AM
  4. Fedex Module / Handling Fee
    By dietcokelemon in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 1 Dec 2008, 10:35 PM
  5. Handling Fee for One Zone.
    By laydiefa in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 4 Jun 2008, 04:44 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