Jump to content

[Résolu] Modification de code dans product.tpl


Recommended Posts

Bonjour à tous,

Suite à la migration d'une version prestashop 1.6.0.11 à la version 1.6.1.20 j'ai un code que j'avais créé qui n'est plus valable dans mon fichier product.tpl

Ayant toujours utilisé la version 1.6.0.11 de prestashop, j'en appel à vous pour m'aider à solutionner le problème car actuellement j'ai une page presque blanche sur cette nouvelle version qui apparemment nécessite un codage différent.

Mon code permet de récupérer toutes les catégories dans lesquelles ma pièce se trouve. Voici donc mon code qui fonctionne sur ma version 1.6.0.11 de pretashop :

<section class="page-product-box">
     <h3 class="page-product-heading">{l s='More info'}</h3>
     {/if}
{if isset($product) && $product->description && $product->description|strstr:"href"}
                    <!-- full description -->
                    <div  class="rte">{$product->description}</div>
            {elseif $product->description}
            <div  class="rte">{$product->description}</div>
            <div>
            {if Product::getProductCategoriesModels(Tools::getValue('id_product')) !=null or Product::getProductCategoriesModelsAmazone(Tools::getValue('id_product')) != null}
                <p itemprop="name" style="color:#000000; font-weight:bold;">{$product->name|escape:'html':'UTF-8'} {l s='can be mounted on the following models:'}</p>
                <p style="font-weight:bold; font-size:1.2em; color:#d60000;">{l s='You can click on your model below to get all the spareparts for it.'}</p>
            {/if}
            <ul class="productcatsmodels">
                {if $product->id_manufacturer != 7}
                    {foreach from=Product::getProductCategoriesModels(Tools::getValue('id_product')) item=cat}
                    <li><a href="{$link->getCategoryLink({$cat.id_category})}" title="{$cat.name}">{$cat.name}</a></li>
                    {/foreach}
                        {elseif $product->id_manufacturer == 7}
                    {foreach from=Product::getProductCategoriesModelsAmazone(Tools::getValue('id_product')) item=cat}
                    <li><a href="{$link->getCategoryLink({$cat.id_category})}" title="{$cat.name}">{$cat.name}</a></li>
                    {/foreach}
                {/if}        
            </ul>
            </div>
            {else}
            <div>
            <h3 class="page-product-heading">{l s='More info'}</h3>
            {if Product::getProductCategoriesModels(Tools::getValue('id_product')) != null or Product::getProductCategoriesModelsAmazone(Tools::getValue('id_product')) != null}
            <p itemprop="name" style="color:#000000; font-weight:bold;">{$product->name|escape:'html':'UTF-8'} {l s='can be mounted on the following models:'}</p>
            <p style="font-weight:bold; font-size:1.2em; color:#d60000;">{l s='You can click on your model below to get all the spareparts for it.'}</p>
            {/if}
            <ul class="productcatsmodels">
                {if $product->id_manufacturer != 7}
                    {foreach from=Product::getProductCategoriesModels(Tools::getValue('id_product')) item=cat}
                    <li><a href="{$link->getCategoryLink({$cat.id_category})}" title="{$cat.name}">{$cat.name}</a></li>
                    {/foreach}
                        {elseif $product->id_manufacturer == 7}
                    {foreach from=Product::getProductCategoriesModelsAmazone(Tools::getValue('id_product')) item=cat}
                    <li><a href="{$link->getCategoryLink({$cat.id_category})}" title="{$cat.name}">{$cat.name}</a></li>
                    {/foreach}
                {/if}
            </ul>
            </div>
            </section>

 

Vous en remerciant par avance.

Julien

Edited by julianbaros (see edit history)
Link to comment
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
×
×
  • Create New...