Forums / Built-in Shipping and Payment Modules / Trying to clone a Table Rate

Trying to clone a Table Rate

Results 1 to 4 of 4
02 Jul 2012, 06:26
#1
dellvi avatar

dellvi

New Zenner

Join Date:
Jul 2012
Posts:
2
Plugin Contributions:
0

Trying to clone a Table Rate

I have installed Zen Cart v1.5.0 and would like to have more than one Table Rate on my site. I couldn’t find any existing add-on that supports Zen Cart v1.5.0 so have to modify the code. I compare the Table Rate Clone for Zen Cart v1.3.8 with the current version of Zen Cart Table Rate code and found that the only difference starts from line 64 in the original table.php,

[PHP]if ($this->enabled) {
// check MODULE_SHIPPING_TABLE_HANDLING_METHOD is in
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_TABLE_HANDLING_METHOD'");
if ($check_query->EOF) {
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_TABLE_HANDLING_METHOD', 'Order', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\'Order\', \'Box\'), ', now())");
}
}[/PHP]

Should I modify these lines in order to clone extra rate table? If the answer is Yes, what should I change?
02 Jul 2012, 13:49
#2
ajeh avatar

ajeh

Oba-san

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

Re: Trying to clone a Table Rate

Yes you should change all references that follow the pattern of:
table to tablesomething
TABLE to TABLESOMETHING

except for things that start with:
TABLE_

Example:
TABLE_CONFIGURATION

as those are database table references ...
03 Jul 2012, 07:36
#3
dellvi avatar

dellvi

New Zenner

Join Date:
Jul 2012
Posts:
2
Plugin Contributions:
0

Re: Trying to clone a Table Rate

Hi Ajeh,

Thanks for you help!!! I have successfully cloned few working Table Rate by changing all the "table to tablesomething" (except TABLE_CONFIGURATION and TABLE_ZONES_TO_GEO_ZONES (line 74), you saved my life!!!!:D
03 Jul 2012, 12:50
#4
ajeh avatar

ajeh

Oba-san

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

Re: Trying to clone a Table Rate

You are most welcome thanks for the update that this is working for you now ... :smile: