Thanks for the update and for posting the solution that worked for you ...![]()
Thanks for the update and for posting the solution that worked for you ...![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Since the USPS update to the usps.php file, my changes I made to the file got overwritten. Thus I put the same code into the new usps.php file, but it doesn't work entirely correctly. It does toggle the shipping methods based on weight, but I think some of the names of the shipping methods changed. I've tried to change them, but I can't get it to work so I was hoping you could shed some light on what I'm doing wrong. The Priority methods work, but the GXG and Express don't.
Here is some code from the usps.php file that I think tells the correct names, but changing it to either of the names doesn't seem to work (I've only included the methods I need working below):
PHP Code:$this->intl_types = array(
'Global Express' => 'Global Express Guaranteed',
'Global Express Envelopes' => 'USPS GXG Envelopes',
'Express Mail Int' => 'Express Mail International',
'Express Mail Int Flat Rate Env' => 'Express Mail International Flat Rate Envelope',
'Priority Mail International' => 'Priority Mail International',
'Priority Mail Int Flat Rate Env' => 'Priority Mail International Flat Rate Envelope',
);
Upon further work, I was able to get the Express methods to show up by making the values in my previous code equate to the values on the right side of the names given directly above:
I still can't get the Global Express and Global Express Envelopes to work though. I've changed them to both of the names on either side of the defined names above but nothing comes up in my store.PHP Code:$methods = array();
$size = sizeof($uspsQuote);
for ($i=0; $i<$size; $i++) {
list($type, $cost) = each($uspsQuote[$i]);
// echo 'I SEE usps type: ' . $type . '<br>';
// 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);
*/
$show_it = false;
if ($usps_shipping_weight <= 0.99) {
// if less than or equal to 0.99 and $type is Global Express Guaranteed, Express Mail International (EMS) Flat-Rate Envelope, or Priority Flat-Rate show it
if ($type == 'Global Express Guaranteed') {
$show_it = false;
}
if ($type == 'USPS GXG Envelopes') {
$show_it = true;
}
if ($type == 'Express Mail International') {
$show_it = false;
}
if ($type == 'Express Mail International Flat Rate Envelope') {
$show_it = true;
}
if ($type == 'Priority Mail International') {
$show_it = false;
}
if ($type == 'Priority Mail International Flat Rate Envelope') {
$show_it = true;
}
// always show Domestic Shipping
if ($type == 'EXPRESS') {
$show_it = true;
}
if ($type == 'PRIORITY') {
$show_it = true;
}
} else {
// if greater than 0.99 show it
if ($type == 'Global Express Guaranteed') {
$show_it = true;
}
if ($type == 'USPS GXG Envelopes') {
$show_it = false;
}
if ($type == 'Express Mail International') {
$show_it = true;
}
if ($type == 'Express Mail International Flat Rate Envelope') {
$show_it = false;
}
if ($type == 'Priority Mail International') {
$show_it = true;
}
if ($type == 'Priority Mail International Flat Rate Envelope') {
$show_it = false;
}
// always show Domestic Shipping
if ($type == 'EXPRESS') {
$show_it = true;
}
if ($type == 'PRIORITY') {
$show_it = true;
}
}
if ($show_it == true) {
$methods[] = array('id' => $type,
'title' => $title,
'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
}
}
Any ideas?
Perhaps the Jan 4, 2010 USPS Update will be of help to you:
http://www.zen-cart.com/forum/showthread.php?t=144992
Let us know if that works for you ...
On your code, uncomment the echo so you can see exactly what to use in your IF statements for the type ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Just had to change all instances referencing "Global Express Guaranteed" to "Global Express Guaranteed (GXG)" and it works.
Thanks!