Originally Posted by
DrByte
Try using this:
Code:
$_SESSION['cart']->weight
$_SESSION['cart']->weight returns what's same as $total_weight.
Below (within the notifier class' function update), derived from class shipping did the job calculating proper [actual] shipping weight.
Code:
function update(&$callingClass, $eventID) {
if (!$this->xml_config_switch()) return;
global $order, $insert_id;
//Begin Shipping Weight Calculation
$shipping_weight = $order->total_weight;
$za_tare_array = split("[:,]" , SHIPPING_BOX_WEIGHT);
$zc_tare_percent= $za_tare_array[0];
$zc_tare_weight= $za_tare_array[1];
$za_large_array = split("[:,]" , SHIPPING_BOX_PADDING);
$zc_large_percent= $za_large_array[0];
$zc_large_weight= $za_large_array[1];
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;
} //End Shipping Weight Calculation
Bookmarks