Zen Cart Logo

need 4 table rates

Locked

Views: 2,450

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
11 Jan 2010, 10:20 AM
#1
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

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.

11 Jan 2010, 10:30 AM
#2
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: need 4 table rates

@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.

11 Jan 2010, 10:49 AM
#3
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: need 4 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.
**anka..**save yourself lot of time and trouble by visiting
mod below...not free, but excellent
http://dev.ceon.net/web/zen-cart/advshipper

11 Jan 2010, 10:50 AM
#4
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

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

11 Jan 2010, 3:06 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: need 4 table rates

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.

11 Jan 2010, 4:36 PM
#6
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,603
Plugin Contributions:
0

Re: need 4 table rates

Moderator's note - No need to start a new thread. This one has been split from the original.

12 Jan 2010, 8:57 AM
#7
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

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.

12 Jan 2010, 5:53 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: need 4 table rates

anka:

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 ...

12 Jan 2010, 6:39 PM
#9
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

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.

13 Jan 2010, 12:32 PM
#10
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

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

13 Jan 2010, 5:43 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: need 4 table rates

On the shipping modules, if you have Zones set or they are set to Disabled you will see the yellow icons ...

If the shipping modules is set to Disabled, then you should REMOVE it ...

The Quantity Box warning means you have set the Product on the Add/Edit with:

Products Quantity Box Shows: No, Do not show Quantity Box
Warning: Does not show Quantity Box, Default to Qty 1

This means that the input box for the quantity will NOT show ... if this is not what you mean, you need to change the setting to:

Products Quantity Box Shows: Yes, Show Quantity Box

so you will see the quantity input box for the Product ...

14 Jan 2010, 12:39 AM
#12
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: need 4 table rates

that warning shows up in my admin product description input section when adding items...because I have the qty box turned off, ours are zips and art items that they don't always need to buy more than one unless they really want to...lol

virtual downloads not shipped items in my store

15 Jan 2010, 1:16 PM
#13
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

Yellow icons: just mods in use are installed, in among these there is no zone module. Still yellow icons.
Admin warning on new product: as long as the warning doesn't afect the cart I don't care since I don't want to show my inventory on cart.
Thanks for your time.
Anka

15 Jan 2010, 2:16 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: need 4 table rates

That warning and its associated setting have nothing to do with your inventory; they are about the customer's ability to choose to buy more than one of the item. If you don't want to let them buy more than one, you can leave it as is.

15 Jan 2010, 4:47 PM
#15
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

Thanks, this is good to know .
Thanks again.
Do you have, gjh42, the faintest idea why i can still have yellow icons in my admin about shipping mods?:frusty:
anka

15 Jan 2010, 5:29 PM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: need 4 table rates

No more than what Ajeh said above...

15 Jan 2010, 11:49 PM
#17
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: need 4 table rates

for those payment mods that have the yellow dot...look to the right and if you see a remove button.

That is the way to totally turn it off...click the remove button. It will remove it from the active/pending list but still leave it in the list should you decide one day to utilize it.

16 Jan 2010, 9:07 PM
#18
anka avatar

anka

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: need 4 table rates

I'm gonna try and see what happens.
Thanks.