Post by BigBProductions » Sat Mar 20, 2010 7:01 am

I am running 1.4.4 and when i try to checkout and use UPS for the shipping, i get this message:

Error: Shipping method required!

I have the access key and all other info set according to what ups sent me. Any suggestions?


Posts

Joined
Fri Jan 15, 2010 11:54 am

Post by Qphoria » Wed Mar 24, 2010 4:43 am

There are 2 things I noticed with this module.

1. The problem where clicking next takes you back to the shipping choices with "Error: Shipping Method Required"
2. It has a hardcoded conversion to USD for some reason.

The fix for the first one is very simple. And the reason is clear as well.
In all shipping modules, it uses the individual id for each quote as the same name as the key (say wha?)

INCORRECT:
Image

CORRECT:
Image


The fix is simple.... As shown in the picture
1. EDIT: catalog/model/shipping/ups.php
2. FIND:

Code: Select all

'id'           => 'ups.' . strtolower($this->config->get('ups_origin')) . '_' . $code,
3. REPLACE WITH:

Code: Select all

'id'           => 'ups.' . $code,
I am unsure of the reason for forcing all rates to USD.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jlg89 » Wed Mar 24, 2010 4:58 am

HALLELUJAH!!!

Q, you're a genius, a lifesaver, and the sexiest individual on the planet. Nay, in the Universe. If you were standing in front of me, I might just kiss you full on the mouth.

If you're ever in Texas, call me and I'll buy you a beer. Unless you don't like Texas beers, in which case I'll treat you to some good BBQ and a Dublin Dr. Pepper.

(And I won't kiss you, really. I promise.)
Last edited by jlg89 on Wed Mar 24, 2010 5:05 am, edited 1 time in total.

New member

Posts

Joined
Tue Aug 04, 2009 11:32 am

Post by RonA » Wed Mar 24, 2010 4:59 am

You are a genius Q!!! Works like a charm and I really appreciate you taking the time to help us.

All my best to you!

~ Ron

New member

Posts

Joined
Tue Mar 09, 2010 4:11 pm

Post by Qphoria » Wed Mar 24, 2010 5:33 am

Thanks for the beer donation. I'll pass on the kiss :-* :D ;D

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SuperJuice » Wed Mar 24, 2010 6:51 am

While on the topic of broken shipping modules in 1.4.4, has anyone tested the fedex module?

When I was troubleshooting the weight conversion code, I noticed fedex was referring to weight_class_id which I thought was deprecated a few versions back.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by Qphoria » Wed Mar 24, 2010 8:38 am

There is no fedex module in 1.4.4

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SuperJuice » Wed Mar 24, 2010 8:51 am

Qphoria wrote:There is no fedex module in 1.4.4
If that's so

/catalog/model/shipping/fedex.php

and

/catalog/language/english/shipping/fedex.php

can probably be removed.

Active Member

Posts

Joined
Thu Aug 13, 2009 12:06 pm

Post by Qphoria » Wed Mar 24, 2010 9:06 am

well they are old placeholders. That is why the filename is admin/controller/shipping/fedex.php_ in the admin path

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Wed Mar 24, 2010 9:50 am

many thanks!

the fix will be in the next release!

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by ThatScriptGuy » Sun Mar 28, 2010 2:23 am

While on the topic of the UPS module, it seems to be broken. Instead of printing the error message (Ex: If a user enters a zip code that doesn't match the zone they've chosen), it prints a nasty PHP error. The fix for the PHP error is:

On lines 218-220, change

Code: Select all

$error .= $error->getElementsByTagName('ErrorCode')->item(0)->nodeValue;
	$error .= ': ' . $error->getElementsByTagName('ErrorDescription')->item(0)->nodeValue;
to

Code: Select all

$error .= $response->getElementsByTagName('ErrorCode')->item(0)->nodeValue;
$error .= ': ' . $response->getElementsByTagName('ErrorDescription')->item(0)->nodeValue;

However, it still doesn't print the $error to the screen like it should. Instead it just shows step 2 with no shipping methods listed. I'm still trying to figure that one out.

Newbie

Posts

Joined
Thu Mar 25, 2010 4:12 am

Post by yank » Sun Mar 28, 2010 4:15 pm

I found the bug report a little late... I had already found what I thought was the problem and made the following changes.

$quote_data[$code] = array(
// 'id' => 'ups.' . strtolower($this->config->get('ups_origin')) . '_' . $code,// commented this line
'id' => 'ups.' . $code,// added this line



Please let me know if this solution is good enough or if I need to make the changes Q suggested. I don't want the site blowing up while I'm on holiday.

Thanks,

Yank

Newbie

Posts

Joined
Sun Mar 28, 2010 4:08 pm

Post by Jeremy54 » Tue Apr 06, 2010 4:22 am

There are 2 problems with the error response reporting (both in catalog/model/shipping/ups.php):

First the variable $error is supposed to be a string but is set to an xml node. Change the lines:

Code: Select all

$error = $response->getElementsByTagName('Error')->item(0);
					
$error .= $error->getElementsByTagName('ErrorCode')->item(0)->nodeValue;

$error .= ': ' . $error->getElementsByTagName('ErrorDescription')->item(0)->nodeValue;
To:

Code: Select all

$errorNode = $response->getElementsByTagName('Error')->item(0);
					
$error .= $errorNode->getElementsByTagName('ErrorCode')->item(0)->nodeValue;

$error .= ': ' . $errorNode->getElementsByTagName('ErrorDescription')->item(0)->nodeValue;
And then at the bottom it is currently only creating the $method_data array if there is quote data. If there is an error there is no quote data, so you need to test for the error as well.
Change the lines:

Code: Select all

if ($quote_data) {
      			$method_data = array(
        			'id'         => 'ups',
        			'title'      => $this->language->get('text_title'),
        			'quote'      => $quote_data,
					'sort_order' => $this->config->get('ups_sort_order'),
        			'error'      => $error
      			);
		}
To:

Code: Select all

if ($quote_data || strlen($error)>0) {
      			$method_data = array(
        			'id'         => 'ups',
        			'title'      => $this->language->get('text_title'),
        			'quote'      => $quote_data,
					'sort_order' => $this->config->get('ups_sort_order'),
        			'error'      => $error
      			);
		}

Newbie

Posts

Joined
Sat Sep 19, 2009 3:45 am
Who is online

Users browsing this forum: No registered users and 3 guests