Post by Qphoria » Wed Oct 21, 2009 9:51 am

The problem is, the quote data runs once on page load, and then on form submit, it posts back to itself, so it loads a second time.

Luckily the fix for this double load is very easy. It's simply that the POST check is too far down the page. Instead of putting the POST check after the quote check, move it before it and it works perfect.

Please be sure to add this to 1.3.3 before release.

1. EDIT catalog/controller/checkout/shipping.php
2. MOVE THIS CODE:

Code: Select all

	if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			$shipping = explode('.', $this->request->post['shipping']);
			
			$this->session->data['shipping_method'] = $this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]];
			
			$this->session->data['comment'] = strip_tags($this->request->post['comment']);

	  		$this->redirect($this->url->https('checkout/payment'));
    	}
3. TO RIGHT BEFORE:

Code: Select all

$this->load->model('checkout/extension');
That will prevent it from loading twice. You won't notice it with localized shipping like zone and free. But when using things like UPS and FedEx, you notice a huge unnecessary delay while it does the second quote lookup

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Wed Oct 21, 2009 10:41 pm

Fixed file attached for easy adding (v1.3.2).

Attachments


Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by tbeigle » Mon Nov 02, 2009 11:42 am

First off, thanks Qphoria! I really appreciate the work you do.

I'm using your FedEx module and Guest Checkout and I love them both. I'm having some issues, though.

Everything works perfectly after making the change you posted here unless the user plugs in incorrect address information and FedEx is the only shipping option. In those cases guest_shipping comes up as a blank screen. As long as there's another shipping option, though, an error message will come up telling the user the address information is incorrect. Any ideas on how to fix this so the error message still comes up even when FedEx is the only shipping option?

Thanks!

- Tom

Newbie

Posts

Joined
Wed Sep 23, 2009 1:07 am

Post by Qphoria » Mon Nov 02, 2009 12:09 pm

This isn't meant to be used on the guest_shipping.php page. That has other custom code. I will pm you a version for guest shipping.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by amplifywebdesign » Mon Nov 02, 2009 7:47 pm

Thanks for this!

User avatar
New member

Posts

Joined
Sat Aug 22, 2009 1:56 am
Location - Sheffield & North Wales

Post by tbeigle » Tue Nov 03, 2009 10:22 pm

Qphoria wrote:This isn't meant to be used on the guest_shipping.php page. That has other custom code. I will pm you a version for guest shipping.
I truly appreciate the help. When can I expect the pm? I'd like to get this updated as soon as possible.

Thanks!

Newbie

Posts

Joined
Wed Sep 23, 2009 1:07 am
Who is online

Users browsing this forum: No registered users and 10 guests