prevratnik Posted June 18, 2012 Report Share Posted June 18, 2012 Как не отображать товары с нулевой ценой на главной странице в новинках?И соответственно как убрать отображение 0 цены в продукте. Quote Link to post Share on other sites
Kasha Posted June 19, 2012 Report Share Posted June 19, 2012 Если через тему то название_темы/html/main.tpl там после строк {foreach $new_products as $product} добавить код{if $product->variants[0]->price|convert != "0"}и перед <!-- Товар (The End)--> {/foreach} добавить {/if}Поправьте если где-то не прав Quote Link to post Share on other sites
prevratnik Posted June 20, 2012 Author Report Share Posted June 20, 2012 Не помогает... Вообще изменений не нашел Quote Link to post Share on other sites
prevratnik Posted June 20, 2012 Author Report Share Posted June 20, 2012 Как я понимаю колдовать нужно над этой строкой:<span class="price_cena"><span class="currency_cena_">Цена </span>{$v->price|convert} <span class="currency_cena">{$currency->sign|escape}</span></span> Quote Link to post Share on other sites
Kasha Posted June 20, 2012 Report Share Posted June 20, 2012 Тупанул, сейчас поправлю.Всё исправил, проверил, работает с разными валютами. Если стоят копейки то нужно добавить формат в конец первой строки (вместо "0" поставить "0.00" или как у вас). Только не убирает товары если есть несколько вариантов с разными ценами (если один артикль с нулевой ценой а второй нет то будут показаны оба) Quote Link to post Share on other sites
prevratnik Posted June 24, 2012 Author Report Share Posted June 24, 2012 Всеравно не получается... Вопервых не нашел {foreach $new_products as $product} у меня {foreach $products as $product}. Во вторых как я понял это должно скрыть товар, а мне охото скрыть только само значение "0" цены Quote Link to post Share on other sites
filth Posted June 24, 2012 Report Share Posted June 24, 2012 Так для главной нужно редактировать main.tpl Quote Link to post Share on other sites
prevratnik Posted June 24, 2012 Author Report Share Posted June 24, 2012 да ступил, но в main.tpl вообще с этими изменениями вылетает Quote Link to post Share on other sites
prevratnik Posted June 24, 2012 Author Report Share Posted June 24, 2012 500ую ошибку выдает Quote Link to post Share on other sites
Kasha Posted June 24, 2012 Report Share Posted June 24, 2012 Сначала говоритеКак не отображать товары с нулевой ценойПотом заявляетеВо вторых как я понял это должно скрыть товар, а мне охото скрыть только само значение "0" цены Во первых нужно точнее выражать свои мысли.Во вторых найдите строчку<span class="price">{$v->price|convert} <span class="currency">{$currency->sign|escape}</span></span>И замените её на {if $v->price == "0"} Уточняйте цену{else} {$v->price|convert} {$currency->sign|escape} {/if} Если таких строк несколько меняйте во всех.В третьих... Quote Link to post Share on other sites
prevratnik Posted October 7, 2012 Author Report Share Posted October 7, 2012 Огромное СПАСИБО! <!-- Выбор варианта товара --> <form class="variants" action="/cart"> <table> {foreach $product->variants as $v} <tr class="variant"> <td> <input id="variants_{$v->id}" name="variant" value="{$v->id}" type="radio" class="variant_radiobutton" {if $v@first}checked{/if} {if $product->variants|count<2}style="display:none;"{/if}/> </td> <td> {if $v->name}<label class="variant_name" for="variants_{$v->id}">{$v->name}</label>{/if} </td> <td> {if $v->compare_price > 0}<span class="compare_price">{$v->compare_price|convert}</span>{/if} <span class="price">{if $v->price == "0"}{else} {$v->price|convert} {$currency->sign|escape} {/if} </span> </td> </tr> {/foreach} </table> <span class="price">{if $v->price == "0"}{else} <input type="submit" class="button" value="в корзину" data-result-text="добавлено"/> {/if} </span> <!-- Выбор варианта товара (The End) --> Quote Link to post Share on other sites
Al_Ary Posted March 14, 2013 Report Share Posted March 14, 2013 Нужно доработать идею. Допустим в новинках {get_new_products var=new_products limit=6} значение 6, но из шести товаров не нулевая цена только у трёх. Как сделать так чтобы подгружало 6 товаров с ненулевой ценой? И вообще, как сделать так, чтобы на сайте нигде (т.е. в products.tpl) тоже не выводились товары с нулевой ценой. 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.