Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Dec 2009
    Posts
    8
    Plugin Contributions
    0

    Default need 4 table rates

    I also need help.
    I installed Zen.cart 1.3.8 then multilanguage EZpages, then Polish Beta. This is due to the fact that I need a multilanguage cart with polish language as default + english+italian as second and third languages. My problems are about shipping methods : I NEED FOUR DIFFERENT TABLE RATES. 1. Poczta Polska, 2. Pozcta Polska cash on deliveries, 3. Kourier, 4.kourier cash on delivery, all based on weight.
    I cloned the 2 modules "table" as table1 (and table2-3-4 of course) and copied in their 2 different directories public_html/pl/zencart/includes/modules/shipping/table1.php and public_html/pl/zencart/includes/polish/shipping/table1.php.
    I received an error:Warning: include(/home/(sitename)/public_html/pl/zencart/includes/languages/english/modules/shipping/table1.php) [function.include]: failed to open stream: No such file or directory in /home/nutysm5/public_html/pl/zencart/admin/modules.php on line 173.
    my clones are following:


    <?php
    /**
    * @package shippingMethod
    * @copyright Copyright 2003-2005 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: table.php 6347 2007-05-20 19:46:59Z ajeh $
    */
    /**
    * Enter description here...
    *
    */
    class table1 extends base {
    /**
    * Enter description here...
    *
    * @var unknown_type
    */
    var $code;
    /**
    * Enter description here...
    *
    * @var unknown_type
    */
    var $title;
    /**
    * Enter description here...
    *
    * @var unknown_type
    */
    var $description;
    /**
    * Enter description here...
    *
    * @var unknown_type
    */
    var $icon;
    /**
    * Enter description here...
    *
    * @var unknown_type
    */
    var $enabled;
    /**
    * Enter description here...
    *
    * @return table1
    */
    function table1() {
    global $order, $db;

    $this->code = 'table1';
    $this->title = MODULE_SHIPPING_TABLE1_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE1_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE1_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE1_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE1_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_TABLE1_STATUS == 'True') ? true : false);
    }

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE1_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE1_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
    while (!$check->EOF) {
    if ($check->fields['zone_id'] < 1) {
    $check_flag = true;
    break;
    } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
    $check_flag = true;
    break;
    }
    $check->MoveNext();
    }

    if ($check_flag == false) {
    $this->enabled = false;
    }
    }
    }
    /**
    * Enter description here...
    *
    * @param unknown_type $method
    * @return unknown
    */
    function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes, $total_count;

    // shipping adjustment
    switch (MODULE_SHIPPING_TABLE1_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();
    break;
    }

    $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;

    $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE1_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;
    }
    }

    if (MODULE_SHIPPING_TABLE1_MODE == 'weight') {
    $shipping = $shipping * $shipping_num_boxes;
    // show boxes if weight
    switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
    case (0):
    $show_box_weight = '';
    break;
    case (1):
    $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
    break;
    case (2):
    $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . TEXT_SHIPPING_WEIGHT . ')';
    break;
    default:
    $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . TEXT_SHIPPING_WEIGHT . ')';
    break;
    }
    }

    $this->quotes = array('id' => $this->code,
    'module' => MODULE_SHIPPING_TABLE1_TEXT_TITLE . $show_box_weight,
    'methods' => array(array('id' => $this->code,
    'title' => MODULE_SHIPPING_TABLE1_TEXT_WAY,
    'cost' => $shipping + MODULE_SHIPPING_TABLE1_HANDLING)));

    if ($this->tax_class > 0) {
    $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
    }

    if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);

    return $this->quotes;
    }
    /**
    * Enter description here...
    *
    * @return unknown
    */
    function check() {
    global $db;
    if (!isset($this->_check)) {
    $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE1_STATUS'");
    $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
    }
    /**
    * Enter description here...
    *
    */
    function install() {
    global $db;
    $db->Execute("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_TABLE1_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE1_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items or count of the items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc<br />You can end the last amount as 10000:7% to charge 7% of the Order Total', '6', '0', 'zen_cfg_textarea(', now())");
    $db->Execute("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_TABLE1_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered or the total number of items orderd.', '6', '0', 'zen_cfg_select_option(array(\'weight\', \'price\', \'item\'), ', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE1_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
    $db->Execute("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_TABLE1_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_TABLE1_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
    $db->Execute("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_TABLE1_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE1_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
    }
    /**
    * Enter description here...
    *
    */
    function remove() {
    global $db;
    $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }
    /**
    * Enter description here...
    *
    * @return unknown
    */
    function keys() {
    return array('MODULE_SHIPPING_TABLE1_STATUS', 'MODULE_SHIPPING_TABLE1_COST', 'MODULE_SHIPPING_TABLE1_MODE', 'MODULE_SHIPPING_TABLE1_HANDLING', 'MODULE_SHIPPING_TABLE1_TAX_CLASS', 'MODULE_SHIPPING_TABLE1_TAX_BASIS', 'MODULE_SHIPPING_TABLE1_ZONE', 'MODULE_SHIPPING_TABLE1_SORT_ORDER');
    }
    }
    ?>


    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers |
    // | |
    // | http://www.zen-cart.com/index.php |
    // | |
    // | Portions Copyright (c) 2003 osCommerce |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license, |
    // | that is bundled with this package in the file LICENSE, and is |
    // | available through the world-wide-web at the following url: |
    // | http://www.zen-cart.com/license/2_0.txt. |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to |
    // | [email protected] so we can mail you a copy immediately. |
    // +----------------------------------------------------------------------+
    // $Id: table.php 277 2004-09-10 23:03:52Z wilt $
    //

    define('MODULE_SHIPPING_TABLE1_TEXT_TITLE', 'Poczta Polska');
    define('MODULE_SHIPPING_TABLE1_TEXT_DESCRIPTION', 'Opłata za przesyłkę wg Tabeli');
    define('MODULE_SHIPPING_TABLE1_TEXT_WAY', 'Zwykła Paczka');
    define('MODULE_SHIPPING_TABLE1_TEXT_WEIGHT', 'Waga');
    define('MODULE_SHIPPING_TABLE1_TEXT_AMOUNT', 'Ilość');

    ?>



    Thi error of course is multiplied for any of the other 3 shipping table rates.

    My question is where do I mistake?
    The site of course cannot be published and it won't be not until I can solve this.
    Furthermore and unfortunately there is no official site in Poland, a real shame because Zen-cart is a real good software.
    Thanks very much.

  2. #2
    Join Date
    Oct 2007
    Location
    Emporia, Kansas
    Posts
    1,762
    Plugin Contributions
    0

    Default Re: I need help

    @anka

    when you installed lightbox did it work?

    as for the other things I think it is best to make a whole new thread since it is maybe a whole different issue.

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: I need help

    My question is where do I mistake?
    The site of course cannot be published and it won't be not until I can solve this.
    Furthermore and unfortunately there is no official site in Poland, a real shame because Zen-cart is a real good software.
    anka..save yourself lot of time and trouble by visiting
    mod below...not free, but excellent
    http://dev.ceon.net/web/zen-cart/advshipper

  4. #4
    Join Date
    Dec 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: I need help

    p.s.
    On tha dmin I also riceive following message
    WARNING: YOU HAVE DUPLICATE SORT ORDERS WHICH WILL RESULT IN CALCULATION ERRORS
    PLEASE CORRECT THESE ISSUES NOW!

    Thank again

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: I need help

    Once again, your issues are totally different from the issues in this thread. You should start your own thread so your questions can be addressed clearly.

  6. #6
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: need 4 table rates

    Moderator's note - No need to start a new thread. This one has been split from the original.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  7. #7
    Join Date
    Dec 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: I need help

    This CEON Modules is of no use to me as I have no problem with location since I have 1 Zone, Poland only, furthermore the Ceon is centered on USA locations. My problem arises from shipping methods not with locations.
    Thanks anyway.

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

    Default Re: I need help

    Quote Originally Posted by anka View Post
    p.s.
    On tha dmin I also riceive following message
    WARNING: YOU HAVE DUPLICATE SORT ORDERS WHICH WILL RESULT IN CALCULATION ERRORS
    PLEASE CORRECT THESE ISSUES NOW!

    Thank again
    1 Only have shipping modules that you are using INSTALLED

    2 If you are not using a shipping module but you see a Sort Order value of 0 or higher, click on that shipping module and click REMOVE

    3 Check all Sort Orders and either ALL should be set to 0 or ALL should have unique Sort Orders, I like to set them as 10, 20, 30 etc.

    If you have duplicate Sort Orders the Modules will not work correctly ...
    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!]
    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
    Dec 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: I need help

    Thanks a lot Ajeh Oba-san alias Linda, I did have duplicate table. Great! It is a good suggestion to renumber sort orders should my boss wants to add more ... I still have another problem with these modules but I'd better go first to Faq. Thanks a lot.

  10. #10
    Join Date
    Dec 2009
    Posts
    8
    Plugin Contributions
    0

    Default Re: I need help

    Dear Ajeh Oba-san
    You could figure I was coming back, before my files would look like " a Cold-War spy's cryptic message" as Schoolboy said in a post, my troubles with shipping modules are not over yet. The little nice buttons are still on yellow/orange. These modules should work as options for the customer at the moment of buying and they are not linked to any product in particular, secondly the 2 cods shipping modules of course affect the payment methods what else should I modify?
    Second problem when I fill the new product form here it comes a warning :Warning: Does not show Quantity Box, Default to Qty 1 I cannot figure exactly to what it refers to in my admin.
    Thanks

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Table rates confusion
    By sandihudson in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 11 Jul 2011, 07:45 PM
  2. Need help shipping based on table rates
    By diktusit in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 29 May 2008, 04:52 PM
  3. Modifying Table Rates
    By dave010880 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 20 May 2008, 11:25 PM
  4. Table Rates
    By ojoonline in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 12 Feb 2008, 05:35 AM

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