From 5ee28563f1e8c2aace86661fd8aafbd53934035d Mon Sep 17 00:00:00 2001 From: Thibault UBUNTU Date: Mon, 7 Mar 2016 15:58:26 +0100 Subject: [PATCH] block canaries delivery --- override/controllers/OrderController.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/override/controllers/OrderController.php b/override/controllers/OrderController.php index 474c79fc..7116b7eb 100755 --- a/override/controllers/OrderController.php +++ b/override/controllers/OrderController.php @@ -3,6 +3,22 @@ class OrderController extends OrderControllerCore { public function preProcess() { global $isVirtualCart, $orderTotal; + // Bloque les canaries ES + if ($this->step == 2) { + $delivery = new Address(self::$cart->id_address_delivery); + $prefix_postcode = substr($delivery->postcode, 0 ,2); + + if ($delivery->id_country == 6 + && (intval($prefix_postcode) == 35 || intval($prefix_postcode) == 38) + ) { + Tools::redirect('order.php?step=1&canaries=1'); + } + } + if (Tools::getValue('canaries')) { + $this->errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos en Canarias. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'); + } + + if(Module::isInstalled('privatesales')) { $removed = FALSE;