From 259d98f9726c598b4754c9f17f0f8a1b56dc3a9f Mon Sep 17 00:00:00 2001 From: Romuald Date: Wed, 20 Jul 2016 11:20:33 +0200 Subject: [PATCH] conflict --- classes/Cart.php | 3 + index.php | 2 +- modules/advmenu/advmenu.php | 13 +- modules/advmenu/ajax.php | 2 +- modules/advmenu/classes/AdvMenuLink.php | 23 +++- modules/atos/views/templates/hook/payment.tpl | 2 +- modules/categorieshome/category.tpl | 5 +- .../views/templates/hook/lightbox_footer.tpl | 2 +- .../views/templates/accessories.tpl | 129 ++++++++++++++++++ 9 files changed, 164 insertions(+), 17 deletions(-) create mode 100644 themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl diff --git a/classes/Cart.php b/classes/Cart.php index 6db6f946..25539f2c 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1895,6 +1895,7 @@ class CartCore extends ObjectModel } unset($product); + // Step 3 : grouped product from grouped_by_warehouse by available carriers $grouped_by_carriers = array(); foreach ($grouped_by_warehouse as $id_address_delivery => $products_in_stock_list) { @@ -1929,6 +1930,7 @@ class CartCore extends ObjectModel } } + $package_list = array(); // Step 4 : merge product from grouped_by_carriers into $package to minimize the number of package foreach ($grouped_by_carriers as $id_address_delivery => $products_in_stock_list) { @@ -1983,6 +1985,7 @@ class CartCore extends ObjectModel } } + // Step 5 : Reduce depth of $package_list $final_package_list = array(); foreach ($package_list as $id_address_delivery => $products_in_stock_list) { diff --git a/index.php b/index.php index 85d9de4a..3c3905d0 100644 --- a/index.php +++ b/index.php @@ -22,7 +22,7 @@ * @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA - */ +*/ require(dirname(__FILE__).'/config/config.inc.php'); Dispatcher::getInstance()->dispatch(); diff --git a/modules/advmenu/advmenu.php b/modules/advmenu/advmenu.php index 8a08c520..4bf78bcb 100644 --- a/modules/advmenu/advmenu.php +++ b/modules/advmenu/advmenu.php @@ -101,14 +101,14 @@ class AdvMenu extends Module { if(Context::getContext()->controller instanceOf IndexController) { - if (!$this->isCached('advmenu.tpl', $this->getCacheId())) { + if (!$this->isCached('advmenu.tpl', $this->getCacheId('advmenu_'.$params['isCms']))) { $menuLinks = AdvMenuLink::getMenu(); if (!$menuLinks) { return false; } $this->smarty->assign('menuLinks', $menuLinks); } - return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId()); + return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId('advmenu_'.$params['isCms'])); } else { @@ -118,18 +118,19 @@ class AdvMenu extends Module } } - public function loadMenu() + public function loadMenu($isCms) { - if (!$this->isCached('advmenu.tpl', $this->getCacheId())) { + $this->smarty->assign('isCms', (int) $isCms); + if (!$this->isCached('advmenu.tpl', $this->getCacheId('advmenu_'.$isCms))) { $menuLinks = AdvMenuLink::getMenu(); if (!$menuLinks) { return false; } $this->smarty->assign('menuLinks', $menuLinks); } - return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId()); + return $this->display(__FILE__, 'advmenu.tpl', $this->getCacheId('advmenu_'.$isCms)); } - + public function hookHeader($params) { $this->context->controller->addJS($this->_path.'js/advmenu.js'); diff --git a/modules/advmenu/ajax.php b/modules/advmenu/ajax.php index 2046a39a..2d509e23 100644 --- a/modules/advmenu/ajax.php +++ b/modules/advmenu/ajax.php @@ -4,5 +4,5 @@ require dirname(dirname(__FILE__)).'/../init.php'; require dirname(__FILE__).'/advmenu.php'; $module = new AdvMenu(); -echo $module->loadMenu(); +echo $module->loadMenu(Tools::getValue('isCms')); die; \ No newline at end of file diff --git a/modules/advmenu/classes/AdvMenuLink.php b/modules/advmenu/classes/AdvMenuLink.php index da91b677..752f3b70 100644 --- a/modules/advmenu/classes/AdvMenuLink.php +++ b/modules/advmenu/classes/AdvMenuLink.php @@ -1,6 +1,10 @@ $link) { - ; + $menuLinks[$i]['children'] = self::getLinks($link['id_link'], $context); $menuLinks[$i]['nbChildren'] = count($menuLinks[$i]['children']); $menuLinks[$i]['ctaImgExist'] = $menuLinks[$i]['nbChildren'] < 5 && file_exists(_PS_IMG_DIR_ . 'menu/' . $link['id_link'] . '.jpg'); - foreach($menuLinks[$i]['children'] as $y => $children) + if($menuLinks[$i]['children']) { - $menuLinks[$i]['children'][$y]['children'] = self::getLinks($children['id_link'], $context); + foreach($menuLinks[$i]['children'] as $y => $children) + { + $menuLinks[$i]['children'][$y]['children'] = self::getLinks($children['id_link'], $context); + if($menuLinks[$i]['children'][$y]['children']) + { + foreach($menuLinks[$i]['children'][$y]['children'] as $z => $subchildren) + { + $menuLinks[$i]['children'][$y]['children'][$z]['children'] = self::getLinks($subchildren['id_link'], $context); + } + } + } } } diff --git a/modules/atos/views/templates/hook/payment.tpl b/modules/atos/views/templates/hook/payment.tpl index 1203a532..718f8d7e 100755 --- a/modules/atos/views/templates/hook/payment.tpl +++ b/modules/atos/views/templates/hook/payment.tpl @@ -6,7 +6,7 @@
- +
{l s='Payer par carte bancaire' mod='atos'} diff --git a/modules/categorieshome/category.tpl b/modules/categorieshome/category.tpl index f2a03e26..042ac80e 100644 --- a/modules/categorieshome/category.tpl +++ b/modules/categorieshome/category.tpl @@ -1,12 +1,13 @@ -

{l s='Tous nos produits' mod='categorieshome'}

+

{l s='Toutes nos rubriques' mod='categorieshome'}

{foreach from=$categories item=category name=category_index}
+

{$category->name} ({$category->nbProducts})

{$category->name} -

{$category->name} ({$category->nbProducts})

+
{/foreach}
diff --git a/modules/cms_pack/views/templates/hook/lightbox_footer.tpl b/modules/cms_pack/views/templates/hook/lightbox_footer.tpl index a790499f..160153fb 100644 --- a/modules/cms_pack/views/templates/hook/lightbox_footer.tpl +++ b/modules/cms_pack/views/templates/hook/lightbox_footer.tpl @@ -10,7 +10,7 @@
- + {l s='Continue reading' mod='cms_pack'} diff --git a/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl b/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl new file mode 100644 index 00000000..1ddf5b50 --- /dev/null +++ b/themes/toutpratique/modules/productaccessories/views/templates/accessories.tpl @@ -0,0 +1,129 @@ + +
+
+
+

{l s='Nos suggestions pour compléter votre panier' mod='productaccessories'}

+
+ +
+
+
+
\ No newline at end of file