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 @@