Shipping quote checks run twice
Posted: 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:
3. TO RIGHT BEFORE:
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
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'));
}
Code: Select all
$this->load->model('checkout/extension');