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
    69,402
    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.5]
    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
    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
    69,402
    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.5]
    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
    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
    69,402
    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.5]
    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
    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
    69,402
    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.5]
    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
    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. v150 How to do flat rate for 1 or 2 items then another rate for 3+ items?
    By tedm in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 2 Apr 2012, 01:53 PM
  2. Table rate for usa, flate rate for foreign help please
    By fw541c in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 18 Sep 2010, 11:52 PM
  3. Chaning name for table rate and Zone Rate
    By undah in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 22 Feb 2009, 03:54 PM
  4. 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
  5. Flat Rate shipping challenge - need a separate rate for a few heavier items
    By Nigel Lew in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 27 Jun 2008, 10:07 PM

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