diff --git a/modules/blockcartex/ajax.php b/modules/blockcartex/ajax.php index 95e475fb..8ea69d6e 100755 --- a/modules/blockcartex/ajax.php +++ b/modules/blockcartex/ajax.php @@ -1,6 +1,7 @@ getPrice(true, NULL, 2) * $quantity; } - + + $sale = Sale::getSaleFromCategory($product->id_category_default, false); + if (isset($sale)) { + $delivery_delay = (int)$sale->delivery_delay; + } + $bestSaleCart = Module::hookExec('bestSaleCart'); $link = new Link(); @@ -33,7 +39,8 @@ if($id_product){ 'img_dir' => '/themes/site/img/', 'quantity' => $quantity, 'bestSaleCart' => $bestSaleCart, - 'price' => $price + 'price' => $price, + 'delivery_delay' => (isset($delivery_delay) ? $delivery_delay : null) )); echo $rendu = $tpl->fetch(); diff --git a/modules/blockcartex/ajax_cart.tpl b/modules/blockcartex/ajax_cart.tpl index 16020abe..046705db 100755 --- a/modules/blockcartex/ajax_cart.tpl +++ b/modules/blockcartex/ajax_cart.tpl @@ -23,14 +23,20 @@ - + + {if $delivery_delay == 1}

{l s='Nos meilleures ventes' mod='blockcartex'}

{$bestSaleCart}
+ {/if}
diff --git a/override/controllers/CartController.php b/override/controllers/CartController.php index 94d6a8e0..b1cda8b2 100644 --- a/override/controllers/CartController.php +++ b/override/controllers/CartController.php @@ -75,9 +75,6 @@ class CartController extends CartControllerCore // Only one delivery id per cart, so we can break now break; } - /*if (Tools::getValue('ajax') == 'true') { - die('{"hasError" : true, "id_current_sale": '.$sale->id.',"id_delivery": '.$sale->delivery_delay.', "errors" : ["'.Tools::displayError('Sorry your cart already contains products from a sale shipped within 3 weeks. To continue, please confirm your order or empty your cart.', false).'"]}'); - }*/ /*$adding_sale = Db::getInstance()->getRow(' SELECT ps.`delivery_delay`, ps.`id_sale` FROM `'._DB_PREFIX_.'product_ps_cache` psc @@ -91,21 +88,20 @@ class CartController extends CartControllerCore 'delivery_delay'=> (int) $sale2->delivery_delay ); - if (!empty($current_sale)) { global $smarty; // Only classic delivery sales can be added together or product of the same sale - if ($current_sale['delivery_delay'] != 1 && $adding_sale['id_sale'] != $current_sale['id_sale']) { + if ((int)$current_sale['delivery_delay'] != 1 && (int)$adding_sale['id_sale'] != (int)$current_sale['id_sale']) { // Product in cart comes from special delivery sale - only products from the same sale can be added if (Tools::getValue('ajax') == 'true') { - die('{"hasError" : true, "popup_error_cart": true, "errors" : ["'.Tools::displayError('Sorry your cart already contains products from a sale shipped within a special period. To continue, please confirm your order or empty your cart.', false).'"]}'); + die('{"hasError" : true,"popup_error_cart": true, "errors" : ["'.Tools::displayError('Sorry your cart already contains products from a sale shipped within a special period. To continue, please confirm your order or empty your cart.', false).'"]}'); } else { $this->errors[] = Tools::displayError('Sorry your cart already contains products from a sale shipped within a special period. To continue, please confirm your order or empty your cart.', false); } - } elseif ($current_sale['delivery_delay'] == 1 && $adding_sale['delivery_delay'] != 1) { + } elseif ((int)$current_sale['delivery_delay'] == 1 && (int)$adding_sale['delivery_delay'] != 1) { // Product in cart comes from classic delivery sale - only products from classic delivery sale can be added if (Tools::getValue('ajax') == 'true') { - die('{"hasError" : true, "popup_error_cart": true, "errors" : ["'.Tools::displayError('Sorry your cart already contains products from a sale shipped within 3 weeks. To continue, please confirm your order or empty your cart.', false).'"]}'); + die('{"hasError" : true,"popup_error_cart": true, "errors" : ["'.Tools::displayError('Sorry your cart already contains products from a sale shipped within 3 weeks. To continue, please confirm your order or empty your cart.', false).'"]}'); } else { $this->errors[] = Tools::displayError('Sorry your cart already contains products from a sale shipped within 3 weeks. To continue, please confirm your order or empty your cart.', false); } diff --git a/themes/site/css/style.css b/themes/site/css/style.css index 228e44fe..75c76700 100755 --- a/themes/site/css/style.css +++ b/themes/site/css/style.css @@ -6652,6 +6652,10 @@ table#carrierTable tbody td { background: url("../img/achat_express.jpg") no-repeat scroll left center #f45bb7; } +.box_add_to_cart .content .others_links .show_fdp_info{ + text-align:center; +} + @keyframes slideInDown { 0% { -webkit-transform: translateY(-500px); diff --git a/themes/site/modules/blockcartex/ajax_cart.tpl b/themes/site/modules/blockcartex/ajax_cart.tpl index 16020abe..c4492353 100644 --- a/themes/site/modules/blockcartex/ajax_cart.tpl +++ b/themes/site/modules/blockcartex/ajax_cart.tpl @@ -23,14 +23,20 @@
- + + {if $delivery_delay == 1}

{l s='Nos meilleures ventes' mod='blockcartex'}

{$bestSaleCart}
+ {/if}
diff --git a/themes/site/product-add_to_cart.tpl b/themes/site/product-add_to_cart.tpl index 5b7dec31..a40fd192 100755 --- a/themes/site/product-add_to_cart.tpl +++ b/themes/site/product-add_to_cart.tpl @@ -23,15 +23,20 @@
- + {if isset($sale) && $sale->delivery_delay == 1}

{l s='Nos meilleures ventes'}

{$bestSaleCart}
+ {/if}
diff --git a/themes/site_mobile/product-add_to_cart.tpl b/themes/site_mobile/product-add_to_cart.tpl index 5b7dec31..b417f9c1 100644 --- a/themes/site_mobile/product-add_to_cart.tpl +++ b/themes/site_mobile/product-add_to_cart.tpl @@ -24,10 +24,15 @@
+ {if isset($sale) && $sale->delivery_delay == 1}

{l s='Nos meilleures ventes'}

{$bestSaleCart}