From 96ca86fe850f5cd251ac268cffead72f1f52fedb Mon Sep 17 00:00:00 2001 From: Marion Muszynski Date: Wed, 1 Jun 2016 10:57:31 +0200 Subject: [PATCH] modif error message --- override/controllers/OrderController.php | 19 ++++++++++++------- .../controllers/ParentOrderController.php | 4 ++-- themes/site/order-address.tpl | 6 ++++-- themes/site_mobile/order-address.tpl | 10 ++++++++++ 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/override/controllers/OrderController.php b/override/controllers/OrderController.php index 325e1578..c8c7d68d 100755 --- a/override/controllers/OrderController.php +++ b/override/controllers/OrderController.php @@ -30,7 +30,7 @@ class OrderController extends OrderControllerCore { if(Module::isInstalled('privatesales')) { $removed = FALSE; - + $products_only_fr = array(); foreach(self::$cart->getProducts() as $product) { if(($sale = Sale::getSaleFromCategory($product['id_category_default'])) !== NULL) { if($sale->isFinished() || !$sale->enabled) { @@ -39,12 +39,17 @@ class OrderController extends OrderControllerCore { } } // shipping only in france - if ($this->step > 1){ - $delivery = new Address(self::$cart->id_address_delivery); - if($sale->shipping_fr == 1 && $delivery->id_country != 8 && !Tools::getValue('ajax')) { - $this->step = 1; - Tools::redirect('order.php?step=1&onlyfr=1'); - } + if($sale->shipping_fr == 1) { + $products_only_fr[] = $product['name']; + self::$smarty->assign('products_fr',$products_only_fr); + } + } + + if (!empty($products_only_fr) && $this->step == 2) { + $delivery = new Address(self::$cart->id_address_delivery); + if ($delivery->id_country != 8 && !Tools::getValue('ajax')) { + $this->step = 1; + Tools::redirect('order.php?step=1&onlyfr=1'); } } diff --git a/override/controllers/ParentOrderController.php b/override/controllers/ParentOrderController.php index e61e1073..4857efd6 100755 --- a/override/controllers/ParentOrderController.php +++ b/override/controllers/ParentOrderController.php @@ -168,9 +168,9 @@ class ParentOrderController extends ParentOrderControllerCore { // distinction "at home" et "out of home" $carriers_ah = array(); $carriers_ooh = array(); - $config_carrier_ooh = array(88,89); // prod + // $config_carrier_ooh = array(88,89); // prod $config_carrier_ooh = array(47,48); // dev - // $config_carrier_ooh = array(40,45); // local + // $config_carrier_ooh = array(40,45); // local foreach ($carriers as $carrier) { // if($shipping_only_athome && $carrier['id_carrier'] != 87) { // prod if($shipping_only_athome && $carrier['id_carrier'] != 45) { // dev diff --git a/themes/site/order-address.tpl b/themes/site/order-address.tpl index fa046362..579495a5 100755 --- a/themes/site/order-address.tpl +++ b/themes/site/order-address.tpl @@ -166,9 +166,11 @@ {include file="$tpl_dir./errors.tpl"} {if $smarty.get.onlyfr}
-

{l s='There is an error'} :

+

{l s='Nous sommes désolé, un ou plusieurs produits de votre panier ne peuvent être livrés en dehors de la France. Nous nous excusons pour le désagrément causé'} :

    -
  1. {l s='Nous sommes désolé, un ou plusieurs produits de votre panier ne peuvent être livrés en dehors de la France. Nous nous excusons pour le désagrément causé'}
  2. + {foreach from=$products_fr item=product key=key} +
  3. {$product}
  4. + {/foreach}
{/if} diff --git a/themes/site_mobile/order-address.tpl b/themes/site_mobile/order-address.tpl index 4b024552..870e121d 100755 --- a/themes/site_mobile/order-address.tpl +++ b/themes/site_mobile/order-address.tpl @@ -162,6 +162,16 @@ {include file="$tpl_dir./order-steps.tpl"} {include file="$tpl_dir./errors.tpl"} +{if $smarty.get.onlyfr} +
+

{l s='Nous sommes désolé, un ou plusieurs produits de votre panier ne peuvent être livrés en dehors de la France. Nous nous excusons pour le désagrément causé'} :

+
    + {foreach from=$products_fr item=product key=key} +
  1. {$product}
  2. + {/foreach} +
+
+{/if} {if $smarty.get.domtom || $smarty.get.canaries}

{l s='There is'} {l s='error'} :