n1c Posted November 3, 2015 Report Share Posted November 3, 2015 Здравствуйте форумчане. Наткнулся на проблему, при смене валюты пропадает описание "о магазине" на главной. Также блоки которые показываются только на главной кодом:{if $page && $page->url == ''}тоже пропадают, если сменить валюту. Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 почему не используете условие {if $module=='MainView'}{/if} Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 почему не используете условие {if $module=='MainView'}{/if} А как чтобы описание в main.tpl показывалось при смене валюты? - {$page->body} Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 А как чтобы описание в main.tpl показывалось при смене валюты? - {$page->body} main.tpl это и есть контент для главной страницы. все что в main.tpl не нужно оборачивать ни во что. оно и так будет выводиться на главной. Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 main.tpl это и есть контент для главной страницы. все что в main.tpl не нужно оборачивать ни во что. оно и так будет выводиться на главной. А что обернуть в {if $module=='MainView'}{/if} ? Обернул $content и в main, не работает Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 еще раз, в main.tpl ничего не нужно оборачивать, это и есть главная страница. в index.tpl нужно обернуть те блоки, которые вы хотите показывать ТОЛЬКО на главной нельзя оборачивать {$content} - это блок вывода всех страниц категорий товаров, блогов и остального Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 да, работает, но а как показать описание? Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 да, работает, но а как показать описание? в main.tpl должен быть код, который выводит заголовок и текст описания, по умолчанию так {* Заголовок страницы *} <h1>{$page->header}</h1> {* Тело страницы *} {$page->body} если у вас такой код есть, а выше вы писали что он есть. значит описание должно выводится. возможно вы его не заполнили Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 Есть такое. Описание заполнено. Описание показывается, но стоит сменить валюту как пропадает Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 Есть такое. Описание заполнено. Описание показывается, но стоит сменить валюту как пропадает покажите код main.tpl Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 покажите код main.tpl {* Главная страница магазина *} {* Для того чтобы обернуть центральный блок в шаблон, отличный от index.tpl *} {* Укажите нужный шаблон строкой ниже. Это работает и для других модулей *} {$wrapper = 'index.tpl' scope=parent} <div id="slider_prod2"> <!-- Список товаров--> {get_featured_products var=featured_products} {if $featured_products} <div class="coda-slider" id="slider-id"> <h1>Популярные товары</h1> <div> <p> <!-- Список товаров--> <ul class="tiny_products"> {foreach name="fproducts" from=$featured_products item=product} <!-- Товар--> <li class="product"> <!-- Название товара --> <h3><a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a></h3> <!-- Название товара (The End) --> <!-- Фото товара --> {if $product->image} <div class="image"> <ul class="wishlike"> <li> {if $compare->ids && in_array($product->id, $compare->ids)} <span class='mylist_add'><img src="design/{$settings->theme|escape}/images/compare2.png" /></span> {else} <span class='mylist_add'><a href="/compare?id={$product->id}" class='addps' data-id='{$product->id}' data-key='compare' data-informer='1' data-result-text='<img src="design/{$settings->theme|escape}/images/compare2.png" />'><img src="design/{$settings->theme|escape}/images/compare.png" title="Добавить в сравнение" /></a></span> {/if} </li> <li> {if $page->url !== 'wishlist'} {if $wishlist->ids && in_array($product->id, $wishlist->ids)} <span class='mylist_add'><img src="design/{$settings->theme|escape}/images/str2.png" /></span> {else} <span class='mylist_add'><a href="wishlist?id={$product->id}" class='addps' data-id='{$product->id}' data-key='wishlist' data-informer='1' data-result-text='<img src="design/{$settings->theme|escape}/images/str2.png" />'><img src="design/{$settings->theme|escape}/images/str.png" title="Добавить в избранное"/></a></span> {/if} {else} <span class='mylist_add'><a href="wishlist?remove={$product->id}">удалить</a></span> {/if} </li> </ul> <a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}"/></a> </div> {/if} <!-- Фото товара (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}{$currency->sign|escape}</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} <center>Нет в наличии</center> {/if} </li> <!-- Товар (The End)--> {if $smarty.foreach.fproducts.iteration%4 == 0} </div> {if $smarty.foreach.fproducts.iteration != $featured_products|@count} <div> {/if} {/if} {/foreach} </ul> </p></div> </div> {/if} <!-- Список товаров--> {get_discounted_products var=discounted_products} {if $discounted_products} <div class="coda-slider2" id="slider-id2"> <h1>Выгодная цена</h1> <div> <p> <!-- Список товаров--> <ul class="tiny_products"> {foreach name="fproducts" from=$discounted_products item=product} <!-- Товар--> <li class="product"> <!-- Название товара --> <h3><a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a></h3> <!-- Название товара (The End) --> <!-- Фото товара --> {if $product->image} <div class="image"> <ul class="wishlike"> <li> {if $compare->ids && in_array($product->id, $compare->ids)} <span class='mylist_add'><img src="design/{$settings->theme|escape}/images/compare2.png" /></span> {else} <span class='mylist_add'><a href="/compare?id={$product->id}" class='addps' data-id='{$product->id}' data-key='compare' data-informer='1' data-result-text='<img src="design/{$settings->theme|escape}/images/compare2.png" />'><img src="design/{$settings->theme|escape}/images/compare.png" title="Добавить в сравнение"/></a></span> {/if} </li> <li> {if $page->url !== 'wishlist'} {if $wishlist->ids && in_array($product->id, $wishlist->ids)} <span class='mylist_add'><img src="design/{$settings->theme|escape}/images/str2.png" /></span> {else} <span class='mylist_add'><a href="wishlist?id={$product->id}" class='addps' data-id='{$product->id}' data-key='wishlist' data-informer='1' data-result-text='<img src="design/{$settings->theme|escape}/images/str2.png" />'><img src="design/{$settings->theme|escape}/images/str.png" title="Добавить в избранное" /></a></span> {/if} {else} <span class='mylist_add'><a href="wishlist?remove={$product->id}">удалить</a></span> {/if} </li> </ul> <a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}"/></a> </div> {/if} <!-- Фото товара (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} {$currency->sign|escape}</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} <center>Нет в наличии</center> {/if} </li> <!-- Товар (The End)--> {if $smarty.foreach.fproducts.iteration%4 == 0} </div> {if $smarty.foreach.fproducts2.iteration != $discounted_products|@count} <div> {/if} {/if} {/foreach} </ul> </p></div> </div> {/if} </div> {$page->body} Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 все должно работать. напишите в личку доступы, я посмотрю, может проблема не в шаблоне Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 все должно работать. напишите в личку доступы, я посмотрю, может проблема не в шаблоне Все стандартное. Проблема получается из-за добавления в УРЛе "?currency_id=1" Quote Link to post Share on other sites
mishanya Posted November 4, 2015 Report Share Posted November 4, 2015 Все стандартное. Проблема получается из-за добавления в УРЛе "?currency_id=1" значит не стандартно. при изменении валюты айди валюты записывается в сессию и снова перенаправляется на страницу без параметра этой валюты. если у вас не перенаправляет назад на главную без ?currency_id=1 вып значит что-то не так Quote Link to post Share on other sites
n1c Posted November 4, 2015 Author Report Share Posted November 4, 2015 значит не стандартно. при изменении валюты айди валюты записывается в сессию и снова перенаправляется на страницу без параметра этой валюты. если у вас не перенаправляет назад на главную без ?currency_id=1 вып значит что-то не так Разобрался. Для тех кому нужно:в View.php примерно 78 строка у кого стоит:if(strpos($page_url, '?') > 0)меняем на:if(strpos($page_url, '?') !== false) 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.