Jump to content

Пустые подкатегории товаров


Recommended Posts

Привет всем.

Возникла небольшая сложность.

В интернет-магазине три уровня категорий: Главные категории=>Бренды=>Коллекции.
Когда пользователь находится на первых двух категориях, то перед ним предстает такая картина:

post-887157-0-89473600-1420513969_thumb.jpg

 

Тогда как нужно получить примерно такую картину

post-887157-0-79989900-1420514244_thumb.jpg

 

Как это реализуется?

Share this post


Link to post
Share on other sites

Решение нашел, вот оно:

 

В конфигураторе темы поставить: Показывать подкатегории на ДА. 

Если его нет, то в файле category.tpl найти: 

Код:
{if (isset($display_subcategories) && $display_subcategories eq 1) || !isset($display_subcategories) }

        <!-- Subcategories -->

        <div id="subcategories">

            <p class="subcategory-heading">{l s='Subcategories'}</p>

            <ul class="clearfix">

            {foreach from=$subcategories item=subcategory}

                <li>

                    <div class="subcategory-image">

                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">

                        {if $subcategory.id_image}

                            <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

                        {else}

                            <img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

                        {/if}

                    </a>

                       </div>

                    <h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5>

                    {if $subcategory.description}

                        <div class="cat_desc">{$subcategory.description}</div>

                    {/if}

                </li>

            {/foreach}

            </ul>

        </div>

        {/if}

 

примерно 74 строка и заменить на: 

 

Код:
<!-- Subcategories -->

        <div id="subcategories">

            <p class="subcategory-heading">{l s='Subcategories'}</p>

            <ul class="clearfix">

            {foreach from=$subcategories item=subcategory}

                <li>

                    <div class="subcategory-image">

                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img">

                        {if $subcategory.id_image}

                            <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

                        {else}

                            <img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />

                        {/if}

                    </a>

                       </div>

                    <h5><a class="subcategory-name" href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}">{$subcategory.name|truncate:25:'...'|escape:'html':'UTF-8'|truncate:350}</a></h5>

                    {if $subcategory.description}

                        <div class="cat_desc">{$subcategory.description}</div>

                    {/if}

                </li>

            {/foreach}

            </ul>

        </div>

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More