Contributions
MultiGeoZone MultiTable Shipping
=========================================
SUMMARY
=========================================
Allows shipping to multiple Geo Zones using multiple tables.
Geo Zones are defined in the osCommerce administration tool, so exactly what makes up each zone is left in the hands of the
user. Geo Zones can be just specific zones of a country, a number of different countries, or any combination thereof.
Expand All / Collapse All
I've made a small change to the MZMT script to calculate shipping based on the cost per additional weight. e.g. most post offices will list the price for the first 0.5kg, 1kg, and after that, the cost will be for each additional 0.5kg.
For this change, I've used the * symbol to indicate that this will be the cost per additional weight. This MUST be the last item on the rate table.
e.g. your MZMT rate table will look like this:
.01:$3,1.5:$4,2:0.5*
To explain the above table, the cost from 0.1 lb to 1.49 lb is $3, 1.5 lb to 1.99 lb costs $4, then each additional 0.5 lb (2 lb - 1.5 lb) is an additional $0.50
To change it so that it is calculated based on 1 lb, just change the table so that the last two fields is a difference of 1 instead of 0.5.
Example rate table:
.01:$3,1:$4,2:0.5*
Changes made:
Line 152, look for:
$shipping_factor = $table_cost[$i+1];
Add the following after the line:
$previous_weight = $table_cost[$i-2];
$previous_cost = $table_cost[$i-1];
$current_weight = $table_cost[$i];
Line 160, look for:
$shipping = ((($this->order_total*10)/10)*((str_replace('%', '', $shipping_factor))/100));
Add the following after the line:
} elseif (substr_count($shipping_factor, '*') > 0) {
$weight_measure = $current_weight - $previous_weight; //Find out how much is each additional factor eg. additional 0.5 lb or additional 1 lb
$add_cost = ceil((($this->order_total - $previous_weight)/$weight_measure)) * (str_replace('*', '', $shipping_factor)); //How many additional shipping cost
$shipping = str_replace('$', '', $previous_cost) + $add_cost;
You can also just replace the mzmt.php with the included file.
Updated mzmt.php, and language files for Multi Zone Multi Table Shipping Module
Solution provided by David Samblas (david at tuxbrain.com)
April 28, 2009
DESCRIPTION:
Fix showing total oder weigth and allows to define the units in the language file
Files attached also includes th Fix 1.21
in file includes/modules/shipping/mzmt.php
arround line 49
replace
// class methods
function quote($method = '') {
global $order;
$this->quotes = array('id' => $this->code,
'module' => constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TEXT_TITLE') . ' (' . $shipping_weight . ' 'lbs.)',
'methods' => array());
with
// class methods
function quote($method = '') {
global $order, $shipping_weight;
$this->quotes = array('id' => $this->code,
'module' => constant('MODULE_SHIPPING_MZMT_GEOZONE_' . $this->delivery_geozone . '_TEXT_TITLE') . ' (' . $shipping_weight . ' '.MODULE_SHIPPING_MZMT_TEXT_UNIT.')',
'methods' => array());
in file includes/includes/languages/english/modules/shipping/
add the following line
define('MODULE_SHIPPING_MZMT_TEXT_UNIT', 'kg');
Updated catalog/includes/modules/shipping/mzmt.php file which fixes an error when trying to use the Order Editor on an order that uses this shipping module.
The error was as follows:
Fatal error: Call to a member function show_total() on a non-object in
/catalog/includes/modules/shipping/mzmt.php on line 137
This package includes only the updated mzmt.php file as well as instructions for replacing the function manually.
All credit goes to Jim Keebaugh (kymation on the OsC Forums) for the fix and to Robert Fisher for helping.
This version truly fixes the shipping weight displaying incorrectly in the shopping cart, the version below does not. Also I have updated the readme on how the % increase in price works for the count method as it was very confusing.
FULL VERSION
SUPPORT FORUM:
http://forums.oscommerce.com/index.php?showtopic=119085
This is a fixed version that will display the weight of the products during the checkout proccess. (19kb zip file)
A re-packcage or the ver. v1.100 in zip format, not tar.
Some people (including I) can't open the tar ver.
No other changes in this package.
Fixed a bug in multiple packages.
=========================================
SUMMARY
=========================================
Allows shipping to multiple Geo Zones using multiple tables.
Geo Zones are defined in the osCommerce administration tool, so exactly what makes up each zone is left in the hands of the
user. Geo Zones can be just specific zones of a country, a number of different countries, or any combination thereof.
Note: Contributions are used at own risk.