Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2009
    Posts
    39
    Plugin Contributions
    0

    Default table rate + base rate for few larger items?

    table rate + base rate for few larger items - is this possible?

    I have configured table rate for shipping and for 90% of our items it works out about right, however we have some larger items that I need to add a base charge onto of say $5 - $7 + the table rate if one of these items is added to the cart, is this possible? Any pointers much appreciated.


    Mark

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,194
    Plugin Contributions
    6

    Default Re: table rate + base rate for few larger items?

    You can check the cart to see if products_id are in there ...

    Do you need to base it on:

    Product A qty 1 is plus 5.00 * 1 = $5.00
    Product A qty 2 is plus 5.00 * 2 = $10.00

    Or ... does it need to just be $5.00 because 1 or more of Product A is in the 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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Jun 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: table rate + base rate for few larger items?

    Yeah the first one really, so the table rate which is 6,8,10,12 etc so the first shipping is $6 and $2 per extra item.

    Then if any of my larger items are added it will put an additional $5 (on top of the table rate)- does that make sense :|

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,194
    Plugin Contributions
    6

    Default Re: table rate + base rate for few larger items?

    See if this works for you to customize the Table Rate table shipping module:
    /includes/modules/shipping/table.php

    Code:
    // bof: add $5.00 if products_id 10 or 12 are in the cart add $7.00 if products_id 112 or 117 are in the cart
        global $cart;
        $chk_products = $_SESSION['cart']->get_product_id_list();
    
        $chk_products_array = preg_split("/[,]/" , $chk_products);
    
        echo print_r($chk_products_array);
    
        for($i=0; $i<sizeof($chk_products_array); $i++) {
          // add additional $5.00 if any of these are in the cart
          if (in_array($chk_products_array[$i], array('10', '12'))) {
            $add_extra_base = 5.00;
          }
          // add additional $7.00 if any of these are in the cart
          if (in_array($chk_products_array[$i], array('112', '117'))) {
            $add_extra_base2 = 7.00;
          }
        }
    
        $this->quotes = array('id' => $this->code,
        'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
        'methods' => array(array('id' => $this->code,
        'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
        'cost' => $add_extra_base + $add_extra_base2 + $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
    // eof: add $5.00 if products_id 10 or 12 are in the cart add $7.00 if products_id 112 or 117 are in 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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Jun 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: table rate + base rate for few larger items?

    Ok thanks I'll try it, 1 thing... how do I tell it which items please?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,194
    Plugin Contributions
    6

    Default Re: table rate + base rate for few larger items?

    You can see the products_id if you either in your Admin in the Catalog/Products which is next to the Products Name in the list ... or go to the Product _info page ...

    You can also see it in listings and sideboxes by running your mouse over it and looking at the URL ...

    Look at the comments in the code I posted to see how these examples 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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Jun 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: table rate + base rate for few larger items?

    Hmm, not having much luck with that code, the shipping option won't work.. I am pretty lame with code, does this replace a certain chunk of code or does it simply slot in anywhere?

    Sorry for the n00bness - I certainly do appreciate all your help!

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    67,194
    Plugin Contributions
    6

    Default Re: table rate + base rate for few larger items?

    You are replacing the original piece of code in the table.php that reads:
    Code:
        $this->quotes = array('id' => $this->code,
        'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
        'methods' => array(array('id' => $this->code,
        'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
        'cost' => $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
    with the new code ...
    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: v1.5.3]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  9. #9
    Join Date
    Jun 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: table rate + base rate for few larger items?

    Fatal error: Call to a member function get_product_id_list() on a non-object

    I am getting this inside zen-cart modules/shipping

  10. #10
    Join Date
    Jun 2009
    Posts
    39
    Plugin Contributions
    0

    Default Re: table rate + base rate for few larger items?

    Hey, thanks very much, getting somewhere now :)

    although it is printing the array at the top...


 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Table Rate shipping PLUS a handling fee for certain items
    By marvin in forum Built-in Shipping and Payment Modules
    Replies: 13
    Last Post: 19 Apr 2009, 05:20 PM
  2. Can I set up shipping for a base rate plus reduced cost on additional items?
    By buffalohole in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 6 Feb 2009, 09:40 PM
  3. Table rate showing 0.00 if over maximum rate defined
    By e-hol.co.uk in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 9 Oct 2008, 04:20 PM
  4. Table Rate does not show up, Zone Rate calculation is incorrect
    By salocreative.com.au in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 17 Mar 2008, 03:56 AM
  5. Table Rate Payment module , where to change base shipping weight?
    By b18cya in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 30 May 2007, 03:50 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
  •