julianbaros Posted September 26, 2018 Share Posted September 26, 2018 (edited) 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 September 28, 2018 by julianbaros (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted September 26, 2018 Share Posted September 26, 2018 Et avez-vous la fonction getProductCategoriesModels() dans votre classe Product.php Il aurait fallu la mettre dans un override et ce serait passé en douceur^^ Link to comment Share on other sites More sharing options...
julianbaros Posted September 27, 2018 Author Share Posted September 27, 2018 Bonjour, Merci pour votre réponse. Est-ce que je peux encore le faire ? Ou c'est trop tard ? Et non la fonction getProductCategoriesModels() n'est pas dans mon fichier Product.php. Il faudrait donc que je fasse un override de ma classe getProductCategoriesModels ? Link to comment Share on other sites More sharing options...
Eolia Posted September 27, 2018 Share Posted September 27, 2018 Trop tard de quoi ? Non, vous pouvez toujours écrire du code. Et oui il faut faire un override pour ajouter cette fonction, l'enregistrer et ne pas oublier de supprimer le fichier /cache/class_index.php pour que l'override soit prise en compte. Link to comment Share on other sites More sharing options...
julianbaros Posted September 27, 2018 Author Share Posted September 27, 2018 Je ne parviens pas à retrouver ma fonction :'( Finalement ça va être plus compliqué que prévu ... Link to comment Share on other sites More sharing options...
Eolia Posted September 27, 2018 Share Posted September 27, 2018 elle est soit dans le Product.php d'origine soit dans une override ou au pire dans le productController.php Link to comment Share on other sites More sharing options...
julianbaros Posted September 27, 2018 Author Share Posted September 27, 2018 Ahhhhhhhhhhhhhhhhhh, oui c'était ça. Du coup je mets cette fonction dans un override et ça devrait fonctionner ? Link to comment Share on other sites More sharing options...
Eolia Posted September 27, 2018 Share Posted September 27, 2018 Je n'ai pas l'habitude de me répéter^^ Link to comment Share on other sites More sharing options...
julianbaros Posted September 28, 2018 Author Share Posted September 28, 2018 Bonjour, Le problème est enfin résolu :). Merci pour votre aide. Je passe le topic en résolu. Bonne journée et encore merci. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now