Results 1 to 7 of 7

Price-based table rate shipping

This is a discussion on Price-based table rate shipping within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; I have a client who wants table rate shipping based on price. I've gone in the admin interface and set ...

      
  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default Price-based table rate shipping

    I have a client who wants table rate shipping based on price. I've gone in the admin interface and set the table rate to price based, and entered the ranges the client wants (49.99:7.50,99.99:9.50, etc.). When purchasing an item (or several items), it is giving "Table Rate, Best Way" as the shipping option, but is not actually charging the shipping.

    Yes, all items in the store have a weight. If I change the table rate shipping to weight-based, it charges shipping. Any ideas why this is doing this? This is my first osCMax store - I have a standard osCommerce store with price-based, table rate shipping and have no problems with it.

    While we're at it, they would also like table rate shipping for overnight, 2nd day and 3rd day delivery, as well as Saturday delivery. Any ideas on how to accomplish this?

    I'm desperate - I need this solved by Sunday at the very latest.

  2. #2
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default RE: Price-based table rate shipping

    Well, this is getting interesting - I have my store set up so it only charges sales tax in the state of origin (the state the physical store is located in). If the buyer is from that state, it charges the shipping along with the tax. If the buyer is NOT from that state - no tax, but no shipping either.

    Help?

  3. #3
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,501
    Rep Power
    567


    Default RE: Price-based table rate shipping

    If your products have zero weight, no shipping will be charged.

    Did you set the zone for the shipping module? If so, that is why it will not charge shipping in any other zone. The zone determines the ONLY place that the module will be used. All other zones will be skipped...
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default RE: Price-based table rate shipping

    Michael,

    Yes, all items have a weight of 1 lb. Nope - didn't set a zone for it. It's showing table rate shipping as the shipping option, but has an amount of $0.00, unless the purchaser is from Louisiana, which is the only state that gets charged sales tax (they have multiple brick-and-mortar stores in that state).

    I'm about at my wits' end - I fly to New Orleans on Monday to train them on the admin interface and this is the only issue that's left before the store goes live.

  5. #5
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default RE: Price-based table rate shipping

    Never mind...I installed the contribution that allows multiple methods of shipping (ground, 2 day, etc), and the problem seems to have solved itself.

  6. #6
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,501
    Rep Power
    567


    Default RE: Price-based table rate shipping

    What contribution? Please post the link and maybe we can add it to the next release...
    Michael Sasek
    osCMax Developer


    osCmax installation service - Have our professionals install osCmax on your server - same day service!
    osCmax 2.0 User Manual - the must have beginners guide to osCmax v2.0

    Stay Up To Date with everything osCMax:
    Free osCMax Newsletters - Security notices, New Releases, osCMax News
    osCMax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  7. #7
    Member
    Join Date
    Aug 2004
    Posts
    49
    Rep Power
    0


    Default

    osCommerce: Additional Shipping Options for Table Module

    Sorry about that Micheal. It was really simple to install (it was a whiz compared to QTPro), although you can't just replace the table.php file in includes/modules/shipping like the instructions state (not for ocCMax, anyway) - you do have to make some minor modifications.

    Since this BB doesn't allow .php files as an attachment, I'm posting my modified code here, for anyone who wants it.

    PHP Code:
    <?php
    /*
      $Id: table.php,v 1.27 2003/02/05 22:41:52 hpdl Exp $

      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com

      Copyright (c) 2003 osCommerce

      Released under the GNU General Public License
    */

      
    class table {
        var 
    $code$title$description$icon$enabled;

    // class constructor
        
    function table() {
          global 
    $order;

          
    $this->code 'table';
          
    $this->title MODULE_SHIPPING_TABLE_TEXT_TITLE;
          
    $this->description MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
          
    $this->sort_order MODULE_SHIPPING_TABLE_SORT_ORDER;
          
    $this->icon '';
          
    $this->tax_class MODULE_SHIPPING_TABLE_TAX_CLASS;
          
    $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true false);

          if ( (
    $this->enabled == true) &amp;&amp; ((int)MODULE_SHIPPING_TABLE_ZONE 0) ) {
            
    $check_flag false;
            
    $check_query tep_db_query("select zone_id from " TABLE_ZONES_TO_GEO_ZONES " where geo_zone_id = '" MODULE_SHIPPING_TABLE_ZONE "' and zone_country_id = '" $order->delivery['country']['id'] . "' order by zone_id");
            while (
    $check tep_db_fetch_array($check_query)) {
              if (
    $check['zone_id'] &lt1) {
                
    $check_flag true;
                break;
              } elseif (
    $check['zone_id'] == $order->delivery['zone_id']) {
                
    $check_flag true;
                break;
              }
            }

            if (
    $check_flag == false) {
              
    $this->enabled false;
            }
          }
        }

    // class methods
        
    function quote($method '') {
          global 
    $order$cart$shipping_weight$shipping_num_boxes;

          if (
    MODULE_SHIPPING_TABLE_MODE == 'price') {
            
    $order_total $cart->show_total();
          } else {
            
    $order_total $shipping_weight;
          }
            
    // jgp - when processing the shipping option, check the method and use the appropriate cost table
            
    if ($method) {
                
                
    // jgp - shipping is free if the order total is 0 (optional)   
                
    if ($order_total != 0)
                    
    $table_cost split("[:,]" MODULE_SHIPPING_TABLE_COST);
                else
                    
    $table_cost=0;        
                    
                
    $table_cost_2day split("[:,]" MODULE_SHIPPING_TABLE_COST_2DAY);
                
    $table_cost_3day split("[:,]" MODULE_SHIPPING_TABLE_COST_3DAY);
                
    $table_cost_nextday split("[:,]" MODULE_SHIPPING_TABLE_COST_NEXTDAY);
        
                if (
    $method == 'table2day'){

                    
    $size sizeof($table_cost_2day);
                    for (
    $i=0$n=$size$i&lt;$n$i+=2) {
                    if (
    $order_total &lt;= $table_cost_2day[$i]) {
                    
    $shipping $table_cost_2day[$i+1];
                    break;
                    }
                    }
                
                    if (
    MODULE_SHIPPING_TABLE_MODE == 'weight') {
                    
    $shipping $shipping $shipping_num_boxes;
                    }
                    
                    
    $this->quotes = array('id' => $this->code,
                                
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                                
    'methods' => array(array('id' => 'table2day',
                                            
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY_2DAY,
                                            
    'cost' => $shipping MODULE_SHIPPING_TABLE_HANDLING)));
                }
                elseif (
    $method == 'table3day'){

                    
    $size sizeof($table_cost_3day);
                    for (
    $i=0$n=$size$i&lt;$n$i+=2) {
                    if (
    $order_total &lt;= $table_cost_3day[$i]) {
                    
    $shipping $table_cost_3day[$i+1];
                    break;
                    }
                    }
                
                    if (
    MODULE_SHIPPING_TABLE_MODE == 'weight') {
                    
    $shipping $shipping $shipping_num_boxes;
                    }
                    
    $this->quotes = array('id' => $this->code,
                                
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                                
    'methods' => array(array('id' => 'table3day',
                                            
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY_3DAY,
                                            
    'cost' => $shipping MODULE_SHIPPING_TABLE_HANDLING)));
                }
                elseif (
    $method == 'tablenextday'){

                    
    $size sizeof($table_cost_nextday);
                    for (
    $i=0$n=$size$i&lt;$n$i+=2) {
                    if (
    $order_total &lt;= $table_cost_nextday[$i]) {
                    
    $shipping $table_cost_nextday[$i+1];
                    break;
                    }
                    }
                
                    if (
    MODULE_SHIPPING_TABLE_MODE == 'weight') {
                    
    $shipping $shipping $shipping_num_boxes;
                    }
                    
                    
    $this->quotes = array('id' => $this->code,
                                
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                                
    'methods' => array(array('id' => 'tablenextday',
                                            
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY_NEXTDAY,
                                            
    'cost' => $shipping MODULE_SHIPPING_TABLE_HANDLING)));
                }
                else        
                {
                    
    $size sizeof($table_cost);
                    for (
    $i=0$n=$size$i&lt;$n$i+=2) {
                    if (
    $order_total &lt;= $table_cost[$i]) {
                    
    $shipping $table_cost[$i+1];
                    break;
                    }
                    }
                
                    if (
    MODULE_SHIPPING_TABLE_MODE == 'weight') {
                    
    $shipping $shipping $shipping_num_boxes;
                    }
                                                                                  
                    
    $this->quotes = array('id' => $this->code,
                                
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                                
    'methods' => array(array('id' => $this->code,
                                            
    'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
                                            
    'cost' => $shipping MODULE_SHIPPING_TABLE_HANDLING)));            
            }
            } else {

                
    // jgp - added 2-day shipping cost
                    
                
    if ($order_total != 0)
          
    $table_cost split("[:,]" MODULE_SHIPPING_TABLE_COST);
                else
                    
    $table_cost=0;                                            
                
                
    // jgp - added 2-day shipping cost  
                    
                
    $table_cost_2day split("[:,]" MODULE_SHIPPING_TABLE_COST_2DAY);
                
    $table_cost_3day split("[:,]" MODULE_SHIPPING_TABLE_COST_3DAY);
                
    $table_cost_nextday split("[:,]" MODULE_SHIPPING_TABLE_COST_NEXTDAY);
          
    $size sizeof($table_cost);
          for (
    $i=0$n=$size$i&lt;$n$i+=2) {
            if (
    $order_total &lt;= $table_cost[$i]) {
              
    $shipping $table_cost[$i+1];
              break;
            }
          }

          if (
    MODULE_SHIPPING_TABLE_MODE == 'weight') {
            
    $shipping $shipping $shipping_num_boxes;
          }
                
    // jgp - duplicated the shipping cost application for 2-day shipping
                    
                
    $size sizeof($table_cost_2day);
                for (
    $j=0$n=$size$j&lt;$n$j+=2) {
                if (
    $order_total &lt;= $table_cost_2day[$j]) {
                
    $shipping_2day $table_cost_2day[$j+1];
                break;
                }
                }

                
    $size sizeof($table_cost_3day);
                for (
    $k=0$n=$size$k&lt;$n$k+=2) {
                if (
    $order_total &lt;= $table_cost_3day[$k]) {
                
    $shipping_3day $table_cost_3day[$k+1];
                break;
                }
                }

                
    $size sizeof($table_cost_nextday);
                for (
    $l=0$n=$size$l&lt;$n$l+=2) {
                if (
    $order_total &lt;= $table_cost_nextday[$l]) {
                
    $shipping_nextday $table_cost_nextday[$l+1];
                break;
                }
                }
            
                if (
    MODULE_SHIPPING_TABLE_MODE == 'weight') {
                
    $shipping_2day $shipping_2day $shipping_num_boxes;
                
    $shipping_3day $shipping_3day $shipping_num_boxes;
                
    $shipping_nextday $shipping_nextday $shipping_num_boxes;

                
                }      
            
                
    // jgp - added 2day shipping to methods array
                
    $this->quotes = array('id' => $this->code,
                            
    'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                            
    'methods' => array(array('id' => $this->code'title' => MODULE_SHIPPING_TABLE_TEXT_WAY'cost' => $shipping MODULE_SHIPPING_TABLE_HANDLING), 
                            array(
    'id' => 'table3day''title' => MODULE_SHIPPING_TABLE_TEXT_WAY_3DAY'cost' => $shipping_3day MODULE_SHIPPING_TABLE_HANDLING),                                                        
                            array(
    'id' => 'table2day''title' => MODULE_SHIPPING_TABLE_TEXT_WAY_2DAY'cost' => $shipping_2day MODULE_SHIPPING_TABLE_HANDLING),
                            array(
    'id' => 'tablenextday''title' => MODULE_SHIPPING_TABLE_TEXT_WAY_NEXTDAY'cost' => $shipping_nextday MODULE_SHIPPING_TABLE_HANDLING)));                                                              
            }
          if (
    $this->tax_class 0) {
            
    $this->quotes['tax'] = tep_get_tax_rate($this->tax_class$order->delivery['country']['id'], $order->delivery['zone_id']);
          }

          if (
    tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon$this->title);

          return 
    $this->quotes;
        }

        function 
    check() {
          if (!isset(
    $this->_check)) {
            
    $check_query tep_db_query("select configuration_value from " TABLE_CONFIGURATION " where configuration_key = 'MODULE_SHIPPING_TABLE_STATUS'");
            
    $this->_check tep_db_num_rows($check_query);
          }
          return 
    $this->_check;
        }

        function 
    install() {
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array('True', 'False'), ', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
          
    // jgp - added additional (2day) shipping type
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table 2-Day', 'MODULE_SHIPPING_TABLE_COST_2DAY', '25:8.50,50:5.50,10000:0.00', '', '6', '0', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table 3-Day', 'MODULE_SHIPPING_TABLE_COST_3DAY', '25:8.50,50:5.50,10000:0.00', '', '6', '0', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table Next-Day', 'MODULE_SHIPPING_TABLE_COST_NEXTDAY', '25:8.50,50:5.50,10000:0.00', '', '6', '0', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array('weight', 'price'), ', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
          
    tep_db_query("insert into " TABLE_CONFIGURATION " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
        }

        function 
    remove() {
          
    tep_db_query("delete from " TABLE_CONFIGURATION " where configuration_key in ('" implode("', '"$this->keys()) . "')");
        }

        function 
    keys() {
          
    // jgp - added 2day shipping key    
          
    return array('MODULE_SHIPPING_TABLE_STATUS''MODULE_SHIPPING_TABLE_COST''MODULE_SHIPPING_TABLE_COST_2DAY''MODULE_SHIPPING_TABLE_COST_3DAY''MODULE_SHIPPING_TABLE_COST_NEXTDAY''MODULE_SHIPPING_TABLE_MODE''MODULE_SHIPPING_TABLE_HANDLING''MODULE_SHIPPING_TABLE_TAX_CLASS''MODULE_SHIPPING_TABLE_ZONE''MODULE_SHIPPING_TABLE_SORT_ORDER');
        }
      }
    ?>

Similar Threads

  1. Need Help setting up Price Based Multi-Zone Shipping Rates
    By heathyre in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 12-02-2006, 05:46 PM
  2. variable shipping based on weight and price
    By darren777 in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 11-01-2005, 09:16 AM
  3. Setting up Table based shipping based on price
    By royjones in forum osCmax v1.7 Discussion
    Replies: 5
    Last Post: 04-14-2005, 07:19 PM
  4. Shipping table as percent of price above $xx.xx
    By Anonymous in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 07-10-2004, 02:06 PM
  5. table rate shipping fees
    By sheikyerbouti in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 10-17-2002, 09:09 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
  •