diff --git a/controllers/front/landing.php b/controllers/front/landing.php index 8f349de..d2fb213 100644 --- a/controllers/front/landing.php +++ b/controllers/front/landing.php @@ -44,11 +44,11 @@ public function init() Tools::redirect('index.php?controller=404'); } - foreach ($this->landing_data['blocks'] as $block) { + foreach ($this->landing_data['blocks'] as &$block) { if ($products_result = $this->module->searchOnApi($block['query'], 1, self::RESULTS)) { - $this->products[] = $products_result['result']; + $block['products'] = $products_result['result']; } else { - $this->products[] = []; + $block['products'] = []; } } } @@ -87,18 +87,16 @@ private function renderProductList() $this->context->getTranslator() ); - $blocks_count = 0; - foreach ($this->products as $product) { + foreach ($this->landing_data['blocks'] as &$block) { $products = []; - foreach ($product as $productDetail) { + foreach ($block['products'] as $productDetail) { $products[] = $presenter->present( $presentationSettings, $assembler->assembleProduct($productDetail), $this->context->language ); } - $this->landing_data['blocks'][$blocks_count]['products'] = $products; - ++$blocks_count; + $block['products'] = $products; } $this->context->smarty->assign( @@ -188,7 +186,7 @@ private function getLandingData($name, $id_shop, $id_lang, $id_currency) $this->setLandingCache($name, $hashid, base64_encode(json_encode($data))); - return $response; + return $data; } } diff --git a/doofinder.php b/doofinder.php index 55a3e0e..32f4145 100644 --- a/doofinder.php +++ b/doofinder.php @@ -35,7 +35,7 @@ class Doofinder extends Module const DOOMANAGER_URL = 'https://admin.doofinder.com'; const GS_SHORT_DESCRIPTION = 1; const GS_LONG_DESCRIPTION = 2; - const VERSION = '4.7.1'; + const VERSION = '4.7.2'; const YES = 1; const NO = 0; @@ -43,7 +43,7 @@ public function __construct() { $this->name = 'doofinder'; $this->tab = 'search_filter'; - $this->version = '4.7.1'; + $this->version = '4.7.2'; $this->author = 'Doofinder (http://www.doofinder.com)'; $this->ps_versions_compliancy = ['min' => '1.5', 'max' => _PS_VERSION_]; $this->module_key = 'd1504fe6432199c7f56829be4bd16347'; diff --git a/upgrade/upgrade-4.7.1.php b/upgrade/upgrade-4.7.2.php similarity index 96% rename from upgrade/upgrade-4.7.1.php rename to upgrade/upgrade-4.7.2.php index 6d5b2df..6db4014 100644 --- a/upgrade/upgrade-4.7.1.php +++ b/upgrade/upgrade-4.7.2.php @@ -27,7 +27,7 @@ exit; } -function upgrade_module_4_7_1($module) +function upgrade_module_4_7_2($module) { return Db::getInstance()->delete('doofinder_landing'); }