This hack is for no shipping charge calculated for zero weight items, such as download files or free shipping offers on certain items. It is a repost from the Agora2 Forum by Dr. Vreeman.
Message numbers 14322 and 14323 (Original and correction) - Agora2 Forum
----- Original Message -----
From: djvreeman
To:
agora2@yahoogroups.com
Sent: Saturday, December 13, 2003 00:12
Subject: [AgoraCart] FOUND IT --- Re: Any answer?? UPS/USPS and zero weight items...
For the UPS SBW module:
In the shipping_lib.pl file, find the "sub calc_ups" routine and the
line:
if ($item_wt <= 1) {
$item_wt = 1;
}
Replace with:
if ($item_wt <= 0.1) {
next;
}
if (($item_wt <= 1) && (item_wt > 0.1)) {
$item_wt = 1;
}
This would skip calculating shipping for any items with weight less
than or equal to 0.1 (e.g. 0), and round up the weight of anything
less than 1 but greater than 0.1 to 1.
For USPS look for the line:
if ($item_wt <= 1) { # min
$item_wt = 1;
}
and modify similar to above.
This seems to work well for my items that are available
electronically and not shipped by UPS. Hope this helps for others
with similar situations...
Regards,
Dr. Vreeman
Quote: