bananovsv Posted January 26, 2017 Report Share Posted January 26, 2017 (edited) Есть блок с просмотренными товарами: {get_browsed_products var=browsed_products limit=20} {if $browsed_products} <h2>Вы просматривали:</h2> <ul id="browsed_products"> {foreach $browsed_products as $browsed_product} <li> <a href="products/{$browsed_product->url}"><img src="{$browsed_product->image->filename|resize:50:50}" alt="{$browsed_product->name|escape}" title="{$browsed_product->name|escape}"></a> </li> {/foreach} </ul> {/if} Хочу добавить туда название со ссылкой, цену и кнопку покупки. Беру код из блока с обычным товаром: <!-- Название товара --> <h3><a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a></h3> <!-- Название товара (The End) --> {if $product->variants|count > 0} <!-- Выбор варианта товара --> <form class="variants" action="/cart"> <table> {foreach $product->variants as $v} <tr class="variant"> <td> <input id="featured_{$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="featured_{$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="currency">{$currency->sign|escape}</span></span> </td> </tr> {/foreach} </table> <input type="submit" class="button" value="в корзину" data-result-text="добавлено"/> </form> <!-- Выбор варианта товара (The End) --> {else} Нет в наличии {/if} Название работает, а цена с кнопкой — нет. Почему? Как сделать, чтобы у просмотренных товаров была цена и кнопка добавления в корзину? Edited January 26, 2017 by bananovsv Quote Link to post Share on other sites
Maksclub Posted January 26, 2017 Report Share Posted January 26, 2017 (edited) Да, проделал в демо-магазина, такой же результат, может во view не передаются данные просмотренным товарам? Edited January 26, 2017 by Maksclub Quote Link to post Share on other sites
Noxter Posted January 26, 2017 Report Share Posted January 26, 2017 Да, проделал в демо-магазина, такой же результат, может во view не передаются данные просмотренным товарам?Именно так и есть, чуть позже напишу статью как это сделать. Quote Link to post Share on other sites
mishanya Posted January 26, 2017 Report Share Posted January 26, 2017 решение уже было, почему не пользуетесь поиском http://forum.simplacms.ru/topic/10013-вывод-цены-у-просмотренных-товаров/?p=75468 Quote Link to post Share on other sites
Noxter Posted January 26, 2017 Report Share Posted January 26, 2017 решение уже было, почему не пользуетесь поиском http://forum.simplacms.ru/topic/10013-вывод-цены-у-просмотренных-товаров/?p=75468Тогда и статья не нужна Quote Link to post Share on other sites
bananovsv Posted January 26, 2017 Author Report Share Posted January 26, 2017 Спасибо! Чёт я затупил и не додумался поискать сначала. Quote Link to post Share on other sites
crfxtr123 Posted September 20, 2019 Report Share Posted September 20, 2019 подскажите цепочку файлов, которая отвечает за вывод просмотренных товаров. А то у меня перестали показываться)) Quote Link to post Share on other sites
shooroop Posted September 20, 2019 Report Share Posted September 20, 2019 подскажите цепочку файлов, которая отвечает за вывод просмотренных товаров. А то у меня перестали показываться)) index.php ProductView.phpсессия 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.