Автор Тема: Вывод вместо цены "по запросу"  (Прочитано 2086 раз)

07 Февраль 2015, 12:18:56
  • Новичок
  • *
  • Сообщений: 10
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Добрый день.

Просьба помочь начинающим.
Интересует возможность вывода цены товара, у которого цена установлена "0 руб." в виде "по запросу". На форуме есть вот такая ветка: http://prestashop-forum.ru/index.php?topic=2176.0  , но у меня так ничего и не получилось. Подскажите, как правильно вставить код. Версия 1.6.
<!-- prices -->
<div class="price">
<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span>
<!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))}
{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
{/if}-->
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
{hook h="displayProductPriceBlock" product=$product type="price"}
{/if}
</p>
<p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}>
<span id="reduction_percent_display">
{if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if}
</span>
</p>
<p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}>
<span id="reduction_amount_display">
{if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0}
-{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval}
{/if}
</span>
</p>
<p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
{if $priceDisplay >= 0 && $priceDisplay <= 2}
{hook h="displayProductPriceBlock" product=$product type="old_price"}
<span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
<!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} -->
{/if}
</p>
{if $priceDisplay == 2}
<br />
<span id="pretaxe_price">
<span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span>
{l s='tax excl.'}
</span>
{/if}
</div> <!-- end prices -->
{if $packItems|@count && $productPrice < $product->getNoPackPrice()}
<p class="pack_price">{l s='Instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>
{/if}
{if $product->ecotax != 0}
<p class="price-ecotax">{l s='Including'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='for ecotax'}
{if $product->specificPrice && $product->specificPrice.reduction}
<br />{l s='(not impacted by the discount)'}
{/if}
</p>
{/if}
{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
{math equation="pprice / punit_price"  pprice=$productPrice  punit_price=$product->unit_price_ratio assign=unit_price}
<p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p>
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{/if}
{/if} {*close if for show price*}
{hook h="displayProductPriceBlock" product=$product type="weight"}
<div class="clear"></div>
</div> <!-- end content_prices -->

Заранее спасибо.
07 Февраль 2015, 12:38:55
Ответ #1
  • Модератор
  • Ветеран
  • *****
  • Сообщений: 86688
  • Репутация: +25428/-0
  • Сообщество PrestaShop
    • Просмотр профиля
В карточке товара заменить вывод цены на:
<span id="our_price_display">
    {if $productPrice == 0}
        {l s='по запросу'}
    {else}
        {convertPrice price=$productPrice}
    {/if}
</span>

Какой код вы добавляли?
07 Февраль 2015, 13:01:11
Ответ #2
  • Новичок
  • *
  • Сообщений: 10
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Да такой.

Но я полный ноль.

Огромная просьба показать куда именно и как его вставить.
07 Февраль 2015, 13:38:55
Ответ #3
  • Ветеран
  • *****
  • Сообщений: 1808
  • Репутация: +49/-1
  • Сообщество PrestaShop
    • Просмотр профиля
Находите код
{convertPrice price=$productPrice}заменяете его на код который дал Adik.
07 Февраль 2015, 13:49:25
Ответ #4
  • Новичок
  • *
  • Сообщений: 10
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Спасибо, буду пробовать.