Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Feb 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: "Per item" for some products, table rate for the rest?

    Where in table.php? Hehe I know I'm a pain in the ###### here =) I either get a blank page at "index.php?main_page=checkout_shipping" or it doesn't recognize that
    $chk_excluded = $_SESSION['cart']->in_cart_check('master_categories_id','22');
    ... I was supposed to insert to table.php.

    Can you please post the entire table.php-file with the changes I have to make. And is it possible to make it so that all subcategories in ID 21 (that would be 22 and 23) are set up so that the table rate exclude them (if you were o add more subcategories to ID 21 in the future)

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

    Default Re: "Per item" for some products, table rate for the rest?

    I would have to work out all of the coding for this to work ...

    I will try to get some time later to write up the code, if no one has come up with it before then ...
    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. #13
    Join Date
    Feb 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: "Per item" for some products, table rate for the rest?

    Thanks ;) That would rule.

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

    Default Re: "Per item" for some products, table rate for the rest?

    You would have to customize the table.php and alter the following:
    Code:
      function quote($method = '') {
        global $order, $shipping_weight, $shipping_num_boxes, $total_count;
    
        // shipping adjustment
        switch (MODULE_SHIPPING_TABLE_MODE) {
          case ('price'):
            $order_total = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
            break;
          case ('weight'):
            $order_total = $shipping_weight;
            break;
          case ('item'):
            $order_total = $total_count - $_SESSION['cart']->free_shipping_items();
    
            $chk_excluded22 = $_SESSION['cart']->in_cart_check('master_categories_id','22');
            $chk_excluded23 = $_SESSION['cart']->in_cart_check('master_categories_id','23');
    
    echo 'COUNT IS: total: ' . $order_total . ' cat 22: ' . $chk_excluded22 . ' cat 23: ' . $chk_excluded23 . ' = ' . ($order_total - ($chk_excluded22 + $chk_excluded23));
    
            $order_total = ($order_total - ($chk_excluded22 + $chk_excluded23));
            break;
        }
    
        $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
    
        $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);
        $size = sizeof($table_cost);
        for ($i=0, $n=$size; $i<$n; $i+=2) {
          if (round($order_total,9) <= $table_cost[$i]) {
            if (strstr($table_cost[$i+1], '%')) {
              $shipping = ($table_cost[$i+1]/100) * $order_total_amount;
            } else {
              $shipping = $table_cost[$i+1];
            }
            break;
          }
        }
    
        $shipping = $shipping + (($chk_excluded22 + $chk_excluded23) * 12);
    
        if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
    The echo in there is just so you can see how this is working ... later comment it out ...

    NOTE: if you have other shipping modules running at the same time you may need to customize this code further ...
    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. #15
    Join Date
    Feb 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: "Per item" for some products, table rate for the rest?

    Awsome, can't thank you enough.

    Just one final question. If you only have products from category 22 or 23 in the shopping cart it calculates the table rate total for one product plus 12 dollars.

    Defined by ..
    $shipping = $shipping + (($chk_excluded22 + $chk_excluded23) * 12);

    if i change this to ...
    $shipping = (($chk_excluded22 + $chk_excluded23) * 12);

    The rest of the products becomes free.

    Is it possible to skip the "$shipping" and only use "(($chk_excluded22 + $chk_excluded23) * 12);" if there's only products from category 22 and 23 in the shopping cart.

    Thank's again

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

    Default Re: "Per item" for some products, table rate for the rest?

    Set your first amount to:
    0:0.00
    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!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Question using table rate per item for shipping
    By VH Freak in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 30 Sep 2009, 03:39 AM
  2. Replies: 2
    Last Post: 28 Nov 2008, 02:03 AM
  3. Checkout 1 of 3, Changing font colour of "flat rate" & "per item" headings?
    By singing_lad in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 15 Oct 2008, 02:36 AM
  4. Flat rate tied to item, UPS for the rest
    By Hazmat in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 26 Mar 2007, 07:59 AM
  5. 1 table rate for the UK, 1 for the rest of the world
    By monkeytastic in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 9 Feb 2007, 04:40 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