fix and translation

This commit is contained in:
Marion Muszynski 2016-09-23 18:04:55 +02:00
parent 8509789d5e
commit 205c04d522
2 changed files with 12 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

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