Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

zone rates shipping module hack 3 zone


elari

Recommended Posts

i changed a little bit module shipping zone to support 3 zone

1 your country (FR by default)

2 -> other zone country you want to set price (Other European Countries)

3 (lastest zone) -> all other country by default without need to check all iso code.

 

you can still add other zone if needed

first disallow zone.php in admin panel to remove value from database

 

change in catalog/includes/modules/zones.php (v1.14 Snap Nov 02)

0/ find line 109

$this->num_zones = 1;

replace by

$this->num_zones = 3;

 

 

1/ find in function quote near line 129

if ($dest_zone == 0) {

$error = true;

} else {

Add before

// elari - Added to select default country if not in listing

if ($dest_zone == 0) {

$dest_zone = $this->num_zones;

$i--;

}

// elari - Added to select default country if not in listing

 

 

 

2/ find in function install near line 178

if ($i == 1) {

$default_countries = 'US,CA';

}

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '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 ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");

 

 

replace by

// elari - Added to select default country if not in listing

if ($i == 1) {

$default_countries = 'FR';

$shipping_table = '3:6,7:10.50,99:20.00';

}

if ($i == 2) {

$default_countries = 'AT,BE,GB,DE,GL,IS,IE,IT,NO,NL,DK,PL,ES,SE,CH,FI,PT,IL,GR';

$shipping_table = '3:7,7:11,99:23.00';

}

if ($i == 3) {

$default_countries = 'Others'; // this must be the lastest zone

$shipping_table = '3:8,7:12,99:25.00';

}

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '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 ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '" . $shipping_table . "', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");

// elari - Added to select default country if not in listing

 

 

you can change the default value before running the module

if you want to add more defined zone you must only let the Others to be the lastest one

Link to comment
Share on other sites

Thanks for your tip!

I managed to change it to 4 zones, which are used in the Netherlands (2003 Prices). The changes:

 

$this->num_zones = 4;

 

and:

 

$default_countries = 'NL';

$shipping_table = '5.00:5.50,10.00:7.25,20.00:10.12,30.00:12.20';

}

if ($i == 2) {

$default_countries = 'AT,BE,FR,GB,DE,IE,IT,LU,MC,NL,DK,ES,SE,FI,PT,IL,GR';

$shipping_table = '0.25:3.00,0.50:5.00,1.00:8.00,20.00:10.50,5.00:18.50,10.00:25.50,15.00:32.50,20.

00:39.00';

}

if ($i == 3) {

$default_countries = 'AL,AD,BA,BG,CY,EE,FO,GI,GL,HU,YU,HR,LV,LI,LT,MK,MT,MD,NO,UA,PL,RO,RU,SM,SI,SK,CZ

,TR,VA,BY,IS,CH';

$shipping_table = '0.25:3.00,0.50:5.00,1.00:8.00,2.00:10.50,5.00:20.00,10.00:28.00,15.00:37.00,20.0

0:43.00';

}

if ($i == 4) {

$default_countries = 'Others'; // this must be the lastest zone

$shipping_table = '0.25:5.00,0.50:10.00,1.00:18.00,2.00:21.00,5.00:27.00,10.00:48.00,15.00:80.00,20

.00:105.00';

}

 

Zone 2 are countries in the Europian Union (EU).

Zone 3 are countries in Europe but not in EU.

Link to comment
Share on other sites

Please delete IL (Israel) from this line:

 

if ($i == 2) {

$default_countries = 'AT,BE,FR,GB,DE,IE,IT,LU,MC,NL,DK,ES,SE,FI,PT,IL,GR';

 

so it would be:

 

if ($i == 2) {

$default_countries = 'AT,BE,FR,GB,DE,IE,IT,LU,MC,NL,DK,ES,SE,FI,PT,GR';

Link to comment
Share on other sites

I dont really understand by the following :

 

1/ find in function quote near line 129

if ($dest_zone == 0) {

$error = true;

} else {

Add before

// elari - Added to select default country if not in listing

if ($dest_zone == 0) {

$dest_zone = $this->num_zones;

$i--;

}

 

Where do we paste the coding at? I need to add those countries not selected into the listing under 'Others', will someone please enlightened me? THanks!!

 

PS: I am using 2.2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...