New Zenner
- Join Date:
- Jul 2012
- Posts:
- 60
- Plugin Contributions:
- 0
Coding help needed for USPS weight restriction for shipping option
Sorry this is a similar post, but I've taken from other posts but since they are older versions of the USPS module, I'm afraid I'm missing something. I need to restrict the weight to less than 2 lbs for intl sm flat rate box. Here is the code I have:
$methods = array();
$size = sizeof($uspsQuote);
for ($i=0; $i<$size; $i++) {
list($type, $cost) = each($uspsQuote[$i]);
// BOF: UPS USPS
$title = ((isset($this->types[$type])) ? $this->types[$type] : $type);
if(in_array('Display transit time', explode(', ', MODULE_SHIPPING_USPS_OPTIONS))) $title .= $transittime[$type];
// strip the ** from the titles
$title = str_replace('**', '', $title);
$cost = preg_replace('/[^0-9.]/', '', $cost);
// add $this->usps_countries to title to test actual country
/*
$methods[] = array('id' => $type,
'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
*/
if ($type == 'Priority Mail International Small Flat Rate Box' && $shipping_weight >= 2.00) {
// skip Priority Mail International Small Flat Rate Box on >= 2.00
} else {
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? $usps_handling_fee * $shipping_num_boxes : $usps_handling_fee) );
// bof: sort by contributed by Marco B
// Sort the options
if (MODULE_SHIPPING_USPS_QUOTE_SORT != 'Unsorted') {
usort($methods,'usps_sort_'.MODULE_SHIPPING_USPS_QUOTE_SORT);
}
// eof: sort by contributed by Marco B
}
}
$this->quotes['methods'] = $methods;
when I go over the weight in the cart, the flat rate option for any international country is still showing :wacko: Anyone know how to fix?
Thanks in advanced!
What do the / and / mean?