Merge branch 'ticket-8048' into develop
This commit is contained in:
commit
2b86a3155c
BIN
modules/privatesales_similarproducts/logo.gif
Executable file
BIN
modules/privatesales_similarproducts/logo.gif
Executable file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
|
||||
class Privatesales_similarproducts extends Module
|
||||
{
|
||||
const HAS_ACCESSORIES_UNKNOWN = 0;
|
||||
@ -125,17 +125,20 @@ class Privatesales_similarproducts extends Module
|
||||
|
||||
if (Db::getInstance()->getValue($query)>0) {
|
||||
$this->has_accessories_state = self::HAS_ACCESSORIES_YES;
|
||||
$this->label = $this->l('Autres produits associés');
|
||||
$this->label = $this->l('Produits complémentaires');
|
||||
}
|
||||
else {
|
||||
$this->has_accessories_state = self::HAS_ACCESSORIES_NO;
|
||||
$this->family = ProductSale::getSaleFamily(
|
||||
$params['sale']->id,
|
||||
$params['sale']->id,
|
||||
$params['cookie']->id_lang
|
||||
);
|
||||
|
||||
if (!empty($this->family)) {
|
||||
$this->label = $this->l('Autres produits dans').' '.$this->family['name'];
|
||||
$bestsellers = ProductSale::getFamilyBestSales($this->family['id_category_family'], $params['cookie']->id_lang,3, 10,$params['product']->id);
|
||||
//$this->label = $this->l('Autres produits dans').' '.$this->family['name'];
|
||||
if(is_array($bestsellers) && !empty($bestsellers)) {
|
||||
$this->label = $this->l('À découvrir');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -152,7 +155,7 @@ class Privatesales_similarproducts extends Module
|
||||
|
||||
$accessories = $params['product']->getAccessories($params['cookie']->id_lang);
|
||||
if(is_array($accessories)) {
|
||||
|
||||
|
||||
$currency = new Currency((int)($params['cookie']->id_currency));
|
||||
|
||||
foreach ($accessories AS $accessory)
|
||||
@ -192,7 +195,7 @@ class Privatesales_similarproducts extends Module
|
||||
|
||||
$bestsellers = ProductSale::getFamilyBestSales(
|
||||
$this->family['id_category_family'],
|
||||
$params['cookie']->id_lang,
|
||||
$params['cookie']->id_lang,
|
||||
3, 10,
|
||||
$params['product']->id
|
||||
);
|
||||
@ -217,7 +220,7 @@ class Privatesales_similarproducts extends Module
|
||||
}
|
||||
|
||||
return $this->flushTemplateCache($cache_id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function isTemplateCached(&$cache_id)
|
||||
@ -237,7 +240,7 @@ class Privatesales_similarproducts extends Module
|
||||
$display = $this->display(__FILE__, 'front_similarproducts.tpl', $cache_id);
|
||||
Tools::restoreCacheSettings();
|
||||
$smarty->cache_lifetime = -1;
|
||||
return $display;
|
||||
return $display;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user