uthn Posted February 20, 2015 Share Posted February 20, 2015 Bonjour, J'ai un petit soucis avec une variable que j'ai ajouté au productcontroller.php et que j'affiche sans soucis sur ma fiche produit : 'product_supplier' => new Supplier((int)$this->product->id_supplier, $this->context->language->id), Dans la page produit (via le product.tpl) j'appelle ensuite mes deux variables, jusque là aucun soucis {$product->supplier_name|escape:'htmlall':'UTF-8'} {$product_supplier->description} Par contre, si j'essaye d'afficher la même chose dans le product-list.tpl ça ne passe pas, le controleur utilisé par le fichier est-il différent de celui du product.tpl ? merci d'avance, Link to comment Share on other sites More sharing options...
fred-vinapresta Posted February 20, 2015 Share Posted February 20, 2015 Bonjour, le controller de la product list est CategoryController Link to comment Share on other sites More sharing options...
uthn Posted February 20, 2015 Author Share Posted February 20, 2015 Merci pour la réponse Fred, par contre dans le categorycontroller ça ne passe pas non plus, si quelqu'un a une idée je suis preneur merci Link to comment Share on other sites More sharing options...
fred-vinapresta Posted February 21, 2015 Share Posted February 21, 2015 (edited) Bonjour, dans CategoryController.php, dans la function assignProductList, il faut changer: foreach ($this->cat_products as &$product) if ($product['id_product_attribute'] && isset($product['product_attribute_minimal_quantity'])) $product['minimal_quantity'] = $product['product_attribute_minimal_quantity']; par foreach ($this->cat_products as &$product) { if ($product['id_product_attribute'] && isset($product['product_attribute_minimal_quantity'])) $product['minimal_quantity'] = $product['product_attribute_minimal_quantity']; $product_supplier = new Supplier((int)$product['id_supplier'], $this->context->language->id); $product['supplier_name'] = $product_supplier->name; $product['supplier_description'] = $product_supplier->description; } ensuite vous pourrez retrouver les infos dans product-list par {$product.supplier_name}, {$product.supplier_description} ... Edited February 21, 2015 by fred-vinapresta (see edit history) 1 Link to comment Share on other sites More sharing options...
fred-vinapresta Posted February 21, 2015 Share Posted February 21, 2015 Sachant qu'il faudra faire les memes modifications dans la navigation à facette si vous l'utilisez, ou alors faire un module qui utilise le hook actionProductListOverride Link to comment Share on other sites More sharing options...
uthn Posted February 21, 2015 Author Share Posted February 21, 2015 Bonjour Fred, merci beaucoup ça marche parfaitement, j'ai du luter un peu avec le cache mais c'est bon. bonne fin de w-e 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