Serial Posted March 13, 2018 Share Posted March 13, 2018 Bonjour, J'ai ré-activer mon bloc meilleures ventes dans les modules car je souhaite les afficher. Cependant, j'ai l'erreur suivante sur la page d'accueil : Notice: Undefined index: id_supplier in C:\wamp\www\monPresta\tools\smarty\sysplugins\smarty_internal_templatebase.php(157) : eval()'d code on line 177 Une idée ? Link to comment Share on other sites More sharing options...
Eolia Posted March 13, 2018 Share Posted March 13, 2018 Oui Corrigez le tpl du module de votre thème en vérifiant que la clé "id_supplier" est définie avant de l'utiliser^^ Link to comment Share on other sites More sharing options...
Serial Posted March 13, 2018 Author Share Posted March 13, 2018 (edited) Le problème c'est que le tpl du module de mon thème n'utilise pas cette variable... <!-- MODULE Block best sellers --> <div id="best-sellers_block_right" class="block products_block"> <h4 class="title_block"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='View a top sellers products' mod='blockbestsellers'}">{l s='Top sellers' mod='blockbestsellers'}</a> </h4> <div class="block_content"> {if $best_sellers && $best_sellers|@count > 0} <ul class="block_content products-block"> {foreach from=$best_sellers item=product name=myLoop} <li class="clearfix"> <a href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}" class="products-block-image content_img clearfix"> <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html'}" alt="{$product.legend|escape:'html':'UTF-8'}" /> </a> <div class="product-content"> <h5> <a class="product-name" href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}"> {$product.name|strip_tags:'UTF-8'|escape:'html':'UTF-8'} </a> </h5> <p class="product-description">{$product.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</p> {if !$PS_CATALOG_MODE} <div class="price-box"> <span class="price">{convertPrice price=$product.price product=$product}</span> {hook h="displayProductPriceBlock" product=$product type="price"} </div> {/if} </div> </li> {/foreach} </ul> <div class="lnk"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='All best sellers' mod='blockbestsellers'}" class="btn btn-default button button-small"><span>{l s='All best sellers' mod='blockbestsellers'}<i class="icon-chevron-right right"></i></span></a> </div> {else} <p>{l s='No best sellers at this time' mod='blockbestsellers'}</p> {/if} </div> </div> <!-- /MODULE Block best sellers --> Edited March 13, 2018 by Serial (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted March 13, 2018 Share Posted March 13, 2018 Ok sauf que là c'et le tpl du bloc de droite ou gauche^^ Je pense que vous voulez parler du hook home et celui-ci reprend le product-list.tpl du thème normalement. Donc à voir dans ce tpl (ou dans celui d'un module qui ajouterai cette variable) Link to comment Share on other sites More sharing options...
Serial Posted March 13, 2018 Author Share Posted March 13, 2018 (edited) Vu que le problème se pose dans le module blockbestsellers, je suis allé dans themes/mon-theme/blockbestsellers/blockbestsellers.tpl. Ce n'est pas ca ? Edited March 13, 2018 by Serial (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted March 13, 2018 Share Posted March 13, 2018 Vous m'avez lu juste au dessus ? Allez donc faire un tour dans /modules/blockbestsellers/views/templates/hook/blockbestsellers-home.tpl et vous trouverez ceci: {if isset($best_sellers) && $best_sellers} {include file="$tpl_dir./product-list.tpl" products=$best_sellers class='blockbestsellers tab-pane' id='blockbestsellers'} {else} <ul id="blockbestsellers" class="blockbestsellers tab-pane"> <li class="alert alert-info">{l s='No best sellers at this time.' mod='blockbestsellers'}</li> </ul> {/if} Link to comment Share on other sites More sharing options...
Serial Posted March 13, 2018 Author Share Posted March 13, 2018 (edited) Ok j'ai compris. Du coup, comment définir cette variable qu'il ne trouve pas ? Edited March 13, 2018 by Serial (see edit history) Link to comment Share on other sites More sharing options...
Eolia Posted March 13, 2018 Share Posted March 13, 2018 {if isset($product.id_supplier)} le code {if} Je suppose que c'est $product, je n'ai pas votre code sous les yeux^^ Link to comment Share on other sites More sharing options...
Serial Posted March 13, 2018 Author Share Posted March 13, 2018 Top 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