dols4me Posted July 15, 2016 Report Share Posted July 15, 2016 Добрый день!Если есть несколько вариантов товаров то меняются они радиобутонамиЕсли вариант 1 то радиобутон показывается в карточке товара активным.Как выполнить условие при котором если вариант товара 1 то блок с радиобутонами скрывать код {if $related_product->variants|count > 0} <!-- Выбор варианта товара --> <form class="variants" action="/cart"> <table> {foreach $related_product->variants as $v} <tr class="variant"> <td> <input id="related_{$v->id}" name="variant" value="{$v->id}" type="radio" class="variant_radiobutton" {if $v@first}checked{/if} {if $related_product->variants|count<2} style="display:none;"{/if}/> </td> <td> {if $v->name}<label class="variant_name" for="related_{$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">{$v->price|convert} <span class="rur">{$currency->sign|escape}</span></span> </td> </tr> {/foreach} </table> <input type="submit" class="button" value="в корзину" data-result-text="добавлено"/> </form> <!-- Выбор варианта товара (The End) --> {else} Нет в наличии {/if} </li> <!-- Товар (The End)--> {/foreach} </ul> {/if} Quote Link to post Share on other sites
Kors Posted July 15, 2016 Report Share Posted July 15, 2016 В приведенном коде и так скрывается {if $related_product->variants|count<2} style="display:none;"{/if} Quote Link to post Share on other sites
dols4me Posted July 15, 2016 Author Report Share Posted July 15, 2016 так вот в том то и дело что не скрывается. Quote Link to post Share on other sites
ps-simpla Posted July 15, 2016 Report Share Posted July 15, 2016 Как бы вот это условие {if $related_product->variants|count<2} style="display:none;"{/if} если все равно видно, то смотрите в сторону !important в стилях CSS Quote Link to post Share on other sites
ps-simpla Posted July 15, 2016 Report Share Posted July 15, 2016 А лучше ссылку на сайт предоставьте, возможно что у вас стилизация input на уровне jqueryПишите в скайп ps-avatar, помогу решить проблему БЕСПЛАТНО Quote Link to post Share on other sites
dols4me Posted July 20, 2016 Author Report Share Posted July 20, 2016 Всем спасибо разобрался. Вынес variants в 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.