You need to add a new field, such as:
shipping_weight_total
to the table:
orders
use the sql:
which you can run in the Tools ... Install SQL Patches ...Code:alter table orders add shipping_weight_total decimal(14,5);
or, use phpMyAdmin, as be sure to address the table prefix if you use them ...
Then, you need to save the weight to a session variable, in the shipping class:
Next, you need to customize the order class to add the weight to the table:Code:switch (true) { // large box add padding case(SHIPPING_MAX_WEIGHT <= $shipping_weight): $shipping_weight = $shipping_weight + ($shipping_weight*($zc_large_percent/100)) + $zc_large_weight; break; default: // add tare weight < large $shipping_weight = $shipping_weight + ($shipping_weight*($zc_tare_percent/100)) + $zc_tare_weight; break; } // bof: save weight for later use $_SESSION['total_order_weight'] = $shipping_weight; // eof: save weight for later use
orders
with:
and that should work with most shipping modules ...Code:'order_total' => $this->info['total'], 'order_tax' => $this->info['tax'], 'currency' => $this->info['currency'], 'currency_value' => $this->info['currency_value'], 'shipping_weight' => $_SESSION['total_order_weight'], 'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] );
NOTE: be careful of shipping modules where there are other weight calculations in it that may be different than the weight calculation of shipping class and will need to be addressed differently ...


Reply With Quote

