Открыть: /modules/blockspecials/blockspecials.php и заменить:
Код:
if (Configuration::get('PS_CATALOG_MODE'))
return;
// We need to create multiple caches because the products are sorted randomly
$random = date('Ymd').'|'.round(rand(1, max(Configuration::get('BLOCKSPECIALS_NB_CACHES'), 1)));
if (!Configuration::get('BLOCKSPECIALS_NB_CACHES') || !$this->isCached('blockspecials.tpl', $this->getCacheId('blockspecials|'.$random)))
{
if (!($special = Product::getRandomSpecial((int)$params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY'))
return;
$this->smarty->assign(array(
'special' => $special,
'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2),
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
));
}
return $this->display(__FILE__, 'blockspecials.tpl', (Configuration::get('BLOCKSPECIALS_NB_CACHES') ? $this->getCacheId('blockspecials|'.$random) : null));
на:
Код:
if (!$this->isCached('blockspecials.tpl', $this->getCacheId('blockspecials|'.date('Ymd'))))
{
if (!$specials = Product::getPricesDrop((int)$params['cookie']->id_lang, 0, 100, false))
return;
$this->smarty->assign(array(
'specials' => $specials,
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
));
}
return $this->display(__FILE__, 'blockspecials.tpl', $this->getCacheId('blockspecials|'.date('Ymd')));
Открыть: /themes/шаблон/modules/blockspecials/blockspecials.tpl
и заменить:
Код:
{if $special}
на:
Код:
{if $specials}
{foreach from=$specials item=special}
Код:
{else}
на:
Код:
{/foreach}
{else}
для стандартного шаблона:
Код:
<div id="special_block_right" class="block">
<p class="title_block">
<a href="{$link->getPageLink('prices-drop')|escape:'html':'UTF-8'}" title="{l s='Specials' mod='blockspecials'}">
{l s='Specials' mod='blockspecials'}
</a>
</p>
<div class="block_content products-block">
{if $specials}
{foreach from=$specials item=special}
<ul>
<li class="clearfix">
<a class="products-block-image" href="{$special.link|escape:'html':'UTF-8'}">
<img
class="replace-2x img-responsive"
src="{$link->getImageLink($special.link_rewrite, $special.id_image, 'small_default')|escape:'html':'UTF-8'}"
alt="{$special.legend|escape:'html':'UTF-8'}"
title="{$special.name|escape:'html':'UTF-8'}" />
</a>
<div class="product-content">
<h5>
<a class="product-name" href="{$special.link|escape:'html':'UTF-8'}" title="{$special.name|escape:'html':'UTF-8'}">
{$special.name|escape:'html':'UTF-8'}
</a>
</h5>
{if isset($special.description_short) && $special.description_short}
<p class="product-description">
{$special.description_short|strip_tags:'UTF-8'|truncate:40}
</p>
{/if}
<div class="price-box">
{if !$PS_CATALOG_MODE}
<span class="price special-price">
{if !$priceDisplay}
{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}
{/if}
</span>
{if $special.specific_prices}
{assign var='specific_prices' value=$special.specific_prices}
{if $specific_prices.reduction_type == 'percentage' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))}
<span class="price-percent-reduction">-{$specific_prices.reduction*100|floatval}%</span>
{/if}
{/if}
<span class="old-price">
{if !$priceDisplay}
{displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}
{/if}
</span>
{/if}
</div>
</div>
</li>
</ul>
{/foreach}
{else}
<div>{l s='No specials at this time.' mod='blockspecials'}</div>
{/if}
</div>
</div>