Our usps.php is highly customized to restrict customers from choosing inappropriate shipping services for certain products (won't fit in padded envelope, for example). Each of the past updates has included an entry point for this custom code, so I was able to just transfer it from whatever current version we were using. But it's no longer there in the newest update, and I have not been able to determine where to insert our code. I finally just had to take the website down so people wouldn't have to choose a higher cost service if the item would ship in the former First Class.
The previous entry point for custom code read "// *** Customizations once per display ***." That no longer appears, and the code is so changed that I can't find the correct point at which to insert our restrictions on which services can be selected for certain products. It used to be after the section that began with
PHP Code:
if ($this->is_us_shipment) {
$PackageSize = count($uspsQuote['Package']);
// if object has no legitimate children, turn it into a firstborn:
if (isset($uspsQuote['Package']['ZipDestination']) && !isset($uspsQuote['Package'][0]['Postage'])) {
$uspsQuote['Package'][] = $uspsQuote['Package'];
$PackageSize = 1;
}
} else {
$PackageSize = count($uspsQuote['Package']['Service']);
}
I see that this section has been greatly expanded now, but I do not see precisely where to add our code. Should it go after
PHP Code:
if ($cost == 0) {
continue;
}
There is another section of added code later in the program, and I haven't even begun to look for where that needs to go.
Can you help, Cindy?
Bookmarks