USPS Shipping Module

Tare Weight - USPS Shipping Module

Tare Weight

by DKarr » Tue Oct 05, 2021 4:27 am

My cart is not adding the Tare weight to the postage quotes. Is there something I need to change in this file to get it to?
DKarr
VIP Member
VIP Member
Posts: 2
Joined: Wed Aug 04, 2021 10:30 pm
Contact:

Re: Tare Weight

by zipurman » Tue Oct 05, 2021 5:20 am

You can edit the file:
includes/modules/shipping/zipusps.php

And change the calcWeight method to include SHIPPING_BOX_WEIGHT as follows:

Code: Select all

private function calcWeight() {

            global $order;
            $this->shipment_details['shipment'] ['weight'] = SHIPPING_BOX_WEIGHT;
            foreach ( $order->products as $product ) {
                $this->shipment_details['shipment'] ['weight'] += $product['qty'] * $product['weight'];
            }

            if (empty($this->shipment_details['shipment'] ['weight'])){
                $this->shipment_details['shipment'] ['weight'] = SHIPPING_BOX_WEIGHT;
            }
            $this->shipment_details['shipment'] ['weight'] = round( $this->shipment_details['shipment'] ['weight'], 3 );

}
zipurman
aka Preston Lord
-----------
Happy to help where I can ;)

https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Image
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Contact: