Skip to content

Commit

Permalink
Do not send quote requests from other pages than in the order tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
tbelliard committed Mar 27, 2018
1 parent acaae4e commit 14e3237
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lowcostexpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,15 @@ public function getOrderShippingCost($cart, $shipping_cost)

// No quote found. Generating a new one.
if (!$quote) {

// We only try to get new quotes when we are in the order tunnel.
// Otherwise, Prestashop has a tendency to try to always get a shipping cost,
// Which can significantly slow down user experience.
$controller_name = $this->context->controller->php_self;
if (!in_array($controller_name, array('order-opc', 'order', 'orderopc'))) {
return false;
}

$delivery_address = new Address((int) $cart->id_address_delivery);
$delivery_country = new Country((int) $delivery_address->id_country);

Expand Down

0 comments on commit 14e3237

Please sign in to comment.