I do no t believe you'd need to make any changes to that since it is run off the $cost ...
Be sure to test it out ... :smile:
Printable View
I do no t believe you'd need to make any changes to that since it is run off the $cost ...
Be sure to test it out ... :smile:
The cost did not work. I uploaded the new USPS.php and then went in and made the change. Was there something else?
Could you post the code from lines 218, start of the FOR loop to the end of the FOR loop in there?
Anything for you.:wink:
218 is a blank line, just for the record.
$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];
/*
$methods[] = array('id' => $type,
'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
*/
$cost = preg_replace('/[^0-9.]/', '', $cost);
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
}
FYI- Priority Shipping went up $0.50 online. At east there is a slight discount for using Priority Flat rate envelopes.
That was dumb.
This is everything:
$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];
/*
$methods[] = array('id' => $type,
'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
*/
/* $cost = preg_replace('/[^0-9.]/', '', $cost);
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
}
$this->quotes['methods'] = $methods;
*/
// BOF: USPS Minimum Shipping
if ($cost < 6.00) {
$methods[] = array('id' => $type,
'title' => $title,
'cost' => (6.00 + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
} else {
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
}
}
$this->quotes['methods'] = $methods;
// EOF: USPS Minimum Shipping
Works Today!
You code works great but you appear to have commented out this line:
Code:$cost = preg_replace('/[^0-9.]/', '', $cost);
Yeah that line of code could be useful :blush:
I inserted it right below where I added the tag BOF Minimum Shipping
Glad to hear that this still works for you ... :smile:
Good place to put the code so you don't exclude it in the future ... :cool:
How can I make a minimum shipping fee of 9.50 across the board? We're using the UPS shipping module.
Adapt the USPS code above for UPS and use 9.50 instead of 6.00 ...
The UPS shipping module is at:
/includes/modules/shipping/ups.php