Thread: Zone Rates

Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23
  1. #21
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,769
    Plugin Contributions
    30

    Default Re: Zone Rates

    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #22
    Join Date
    Mar 2011
    Posts
    56
    Plugin Contributions
    0

    Default Re: Zone Rates

    I have updated from ZC v1.5.5 to v2.0.1.
    In v1.5.5 I had "Zone 2 Handling Fee" set 4% and it calculated 4% of the order total on top of the "Zone 2 Shipping Table" rate.
    In v2.0.1 I am getting error "Unsupported operand types: int + string in .../htdocs/includes/modules/shipping/zones.php:307" and the 4% is not calculated on top of the Shipping table rate.
    Can anybody help me fix that?

  3. #23
    Join Date
    Mar 2011
    Posts
    56
    Plugin Contributions
    0

    Default Re: Zone Rates

    Quote Originally Posted by siilike1232 View Post
    I have updated from ZC v1.5.5 to v2.0.1.
    In v1.5.5 I had "Zone 2 Handling Fee" set 4% and it calculated 4% of the order total on top of the "Zone 2 Shipping Table" rate.
    In v2.0.1 I am getting error "Unsupported operand types: int + string in .../htdocs/includes/modules/shipping/zones.php:307" and the 4% is not calculated on top of the Shipping table rate.
    Can anybody help me fix that?
    Fixed that!
    Deleted part of the code: // Handling fee per box or order

    if (constant('MODULE_SHIPPING_ZONES_HANDLING_METHOD_' . $dest_zone) == 'Box') {
    $shipping_cost = ($shipping * $shipping_num_boxes) + (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)) * $shipping_num_boxes;
    } else {
    $shipping_cost = ($shipping * $shipping_num_boxes) + (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));
    }

    And replaced with:

    // Retrieve the handling fee configuration
    $handling_fee_config = constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);

    // Check if the handling fee is a percentage (e.g., "5%")
    if (strpos($handling_fee_config, '%') !== false) {
    // Extract the percentage value
    $handling_fee_percentage = floatval($handling_fee_config);

    // Calculate the handling fee as a percentage of the order total
    $handling_fee = ($order_total_amount * $handling_fee_percentage) / 100;
    } else {
    // Use the handling fee as a fixed amount
    $handling_fee = floatval($handling_fee_config);
    }

    // Calculate the shipping cost with the handling fee
    if (constant('MODULE_SHIPPING_ZONES_HANDLING_METHOD_' . $dest_zone) == 'Box') {
    $shipping_cost = ($shipping * $shipping_num_boxes) + ($handling_fee * $shipping_num_boxes);
    } else {
    $shipping_cost = ($shipping * $shipping_num_boxes) + $handling_fee;
    }

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Adding a zone in Zone Rates module
    By ampm11 in forum General Questions
    Replies: 2
    Last Post: 13 Dec 2010, 05:18 PM
  2. Zone Rates, one country, two Islands, two rates.
    By scanhead in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Mar 2010, 11:35 PM
  3. Zone Rates and Flat Rates
    By busiherb in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 28 Sep 2009, 08:50 PM
  4. Zone rates
    By RobWUK in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 17 Apr 2008, 07:15 PM
  5. Zone Rates using Zone Code & Country ISO Codes?
    By dcmall in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 8 Aug 2007, 09:08 AM

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