Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping module


Guest

Recommended Posts

Posted

Hi all

 

I need to extract the shipping module data (I'm writing a function to return the shipping costs for a given source, destination and product) - afaics this should be stored in the configuration table but I can find nothing in there?

 

Any ideas?

 

Thanks

Posted

Good Question.

 

It seems that most of the shipping modules have their own code for calculating shipping tax based on country and zones.

 

Most seem to be using the tabble zones_to_geo_zones and pulling the fields zone_id and zone_country_id

 

 

For example here are 3 common pieces of code from most shipping mods:

 

$this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;

 

 

if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_SPU_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_SPU_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'] < 1) {

$check_flag = true;

break;

} elseif ($check['zone_id'] == $order->delivery['zone_id']) {

$check_flag = true;

break;

}

}

 

if ($check_flag == false) {

$this->enabled = false;

}

}

}

 

 

if ($this->tax_class > 0) {

$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

}

Posted

Thanks insomniac2 - we use the Postage & Packaging Shipping Module where it shows the data stored in a Zone n Shipping Table the data of which are (for example) :

 

10.0:0.00,300:3.00,450:4.00,750:5.10,950:5.80,1500:6.75,2000:7.00,3500:8.25,6000

:8.50,10000:10.50,12000:14.50,20000:18.00,

33000:20.00

 

Now I figure this must be stored in a table somewhere - I've looked in configuration, zones, geo_zones, zones_to_geo_zones, tax_class, tax_rates and any other table that might be relevant (except, of course, the correct one)...

 

Does anyone know where the Shipping Table data is stored in MySQL (if it is)...I'm beginning to doubt my own sanity over this.

 

Thanks!

Posted

Whoa! the ukpp.php file contains...

 

function install() {

...

...

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_ukpp_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_ukpp_COST_" . $i ."', '.10:3.75,.50:4.05,1.00:5.20,2.00:6.55,10.00:18.5,999.99:999.99', '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())");

...

...

}

 

I have looked to see where the constants MODULE_SHIPPING_ukpp_COST_... are defined but can find them nowhere...help?

 

Thanks!

Posted

The answer I have found is in the Configuration table after all - I was just being utterly stupid...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...