Jump to content

Edit History

abdamu

abdamu

Hello, I have updated my prestashop from 1.5 to 1.7 and it had modifications made. It had a button to navigate back from one category or subcategory to another. But the code does not work for me now in version 1.7, and I wanted you to give me a hand to adapt it to work in that version. I attach the code that I had in "category.tpl"

Thanks in advance

<!-- Subcategories -->
                <div id="subcategories">
                    <h3>{l s='Subcategories'}</h3>
                        <script type="text/javascript" >
                            $(window).load(function() {
                                setHeight2('.grid_list_categories li');
                            });
                        </script>

                    <div class='divCentre'>
                        <ul class="grid_list_categories clearfix">
                            {if $category->id_parent!=2}
                                <li>
                                    <a href="{$link->getCategoryLink($category->id_parent)}" title="Ver Categor&iacute;a Superior" class="img">
                                        <img src="/img/imgSubCat/return.jpg" alt="return" />
                                    </a>
                                    <a href="{$link->getCategoryLink($category->id_parent)}" class="cat_name">Ver Categor&iacute;a Superior</a>
                                </li>
                            {/if}
                            {if isset($subcategories)}
                                {foreach from=$subcategories item=subcategory}
                                    <li>
                                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
                                            {if $subcategory.id_image}
                                                <img src="/img/imgSubCat/{$subcategory.link_rewrite|escape:'htmlall':'UTF-8'}.jpg" alt="{$subcategory.name|escape:'htmlall':'UTF-8'}" />
                                            {else}
                                                <img src="{$img_cat_dir}default-medium_default.jpg" alt=""   />
                                            {/if}
                                        </a>
                                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'|truncate:42:'...'}</a>
                                    
                                    </li>
                                {/foreach}
                            {/if}
                        </ul>
                    </div>
                    <br class="clear"/>
                </div>
        {/if}

imagen.png.7946003f5b881aec1a7ea200ae0bd8a5.png

abdamu

abdamu

Hello, I have updated my prestashop from 1.5 to 1.7 and it had modifications made. It had a button to navigate back from one category or subcategory to another. But the code does not work for me now in version 1.7, and I wanted you to give me a hand to adapt it to work in that version. I attach the code that I had in "category.tpl"

Thanks in advance

<!-- Subcategories -->
                <div id="subcategories">
                    <h3>{l s='Subcategories'}</h3>
                        <script type="text/javascript" >
                            $(window).load(function() {
                                setHeight2('.grid_list_categories li');
                            });
                        </script>

                    <div class='divCentre'>
                        <ul class="grid_list_categories clearfix">
                            {if $category->id_parent!=2}
                                <li>
                                    <a href="{$link->getCategoryLink($category->id_parent)}" title="Ver Categor&iacute;a Superior" class="img">
                                        <img src="/img/imgSubCat/return.jpg" alt="return" />
                                    </a>
                                    <a href="{$link->getCategoryLink($category->id_parent)}" class="cat_name">Ver Categor&iacute;a Superior</a>
                                </li>
                            {/if}
                            {if isset($subcategories)}
                                {foreach from=$subcategories item=subcategory}
                                    <li>
                                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
                                            {if $subcategory.id_image}
                                                <img src="/img/imgSubCat/{$subcategory.link_rewrite|escape:'htmlall':'UTF-8'}.jpg" alt="{$subcategory.name|escape:'htmlall':'UTF-8'}" />
                                            {else}
                                                <img src="{$img_cat_dir}default-medium_default.jpg" alt=""   />
                                            {/if}
                                        </a>
                                        <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'|truncate:42:'...'}</a>
                                    
                                    </li>
                                {/foreach}
                            {/if}
                        </ul>
                    </div>
                    <br class="clear"/>
                </div>
        {/if}

 

×
×
  • Create New...