picuslab Posted May 24, 2012 Report Share Posted May 24, 2012 Можно ли сделать, чтобы при установленной цене 0 руб. выводилось вместо этого - "цена по запросу"? Quote Link to post Share on other sites
daramal Posted May 24, 2012 Report Share Posted May 24, 2012 конечно. по умолчанию стоит "Нет в наличии", а это можно редактировать в файле products.tpl Quote Link to post Share on other sites
picuslab Posted May 24, 2012 Author Report Share Posted May 24, 2012 но необходимо, чтобы при этом можно было этот товар добавить в корзину Quote Link to post Share on other sites
nalvle Posted May 24, 2012 Report Share Posted May 24, 2012 В product.tpl,products.tpl,main.tpl находите строку - <span class="price">{$v->price|convert} <span class="currency">{$currency->sign|escape}</span></span>и меняете на - {if $v->price|convert <1} <span class="price">цена по запросу <span class="currency">{$currency->sign|escape}</span></span> {else} <span class="price">{$v->price|convert} <span class="currency">{$currency->sign|escape}</span></span> {/if} Quote Link to post Share on other sites
picuslab Posted May 27, 2012 Author Report Share Posted May 27, 2012 Спасибо большое!только после фразы "цена по запросу" осталось обозначение валюты "руб."можно ее как-то убрать у товаров со стоимостью 0 (цена по запросу)? Quote Link to post Share on other sites
Danya Posted May 27, 2012 Report Share Posted May 27, 2012 удалите в строке:<span class=\"price\">цена по запросу <span class=\"currency\">{$currency->sign|escape}</span></span>кусок кода:<span class=\"currency\">{$currency->sign|escape}</span> Quote Link to post Share on other sites
picuslab Posted May 27, 2012 Author Report Share Posted May 27, 2012 Спасибо! Quote Link to post Share on other sites
insider Posted June 1, 2015 Report Share Posted June 1, 2015 Отличное решение, а как сделать так, чтобы текст в корзине "0 руб" сменила надпись "цена по запросу" или "-" ? {* Цена за единицу *} <td class="price"> {($purchase->variant->price)|convert} {$currency->sign} </td> {* Цена *} <td class="price"> {($purchase->variant->price*$purchase->amount)|convert} {$currency->sign} </td> Quote Link to post Share on other sites
mishanya Posted June 1, 2015 Report Share Posted June 1, 2015 Отличное решение, а как сделать так, чтобы текст в корзине "0 руб" сменила надпись "цена по запросу" или "-" ? {* Цена за единицу *} <td class="price"> {($purchase->variant->price)|convert} {$currency->sign} </td> {* Цена *} <td class="price"> {($purchase->variant->price*$purchase->amount)|convert} {$currency->sign} </td> как-то так: {* Цена за единицу *} <td class="price"> {if $purchase->variant->price>0} {($purchase->variant->price)|convert} {$currency->sign} {else} цена по запросу {/if} </td> аналогично для цены: {* Цена *} <td class="price"> {if $purchase->variant->price>0} {($purchase->variant->price*$purchase->amount)|convert} {$currency->sign} {else} цена по запросу {/if} </td> Quote Link to post Share on other sites
rimov Posted January 14, 2019 Report Share Posted January 14, 2019 Всем привет, ребят хелпаните! У меня не стоковый шаблон. Код совсем другой или я не правильно правлю, в общем не получается! Product.tpl <div class="item_price"><div id="bx_{$product->variant->id}_price" class="item_current_price price"><span class="pr">{$product->variant->price|convert}</span> {$currency->sign}</div>{if $product->variant->compare_price > 0}<div id="bx_{$product->variant->id}_old_price" class="item_old_price crossed_price"><span class="cros">{$product->variant->compare_price|convert}</span> {$currency->sign|escape}</div>{/if} Main.tpl <div class="price_block">{if $product->variants|count > 0}<div class="new_price">{$product->variant->price|convert} <span> {$currency->sign|escape}</span></div>{else}Нет в наличии{/if}{if $product->variant->compare_price > 0}<div class="old_price">{$product->variant->compare_price|convert}<span> {$currency->sign|escape}</span></div>{/if}</div> Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.