INTJP Posted February 18, 2023 Share Posted February 18, 2023 Bonjour, J'essaie d'afficher plusieurs informations sur la page "historique de vos commandes" en front office. 1. Le nom de la marque : {$product.manufacturer_name} Mais cette variable ne semble rien renvoyer. J'ai également essayé les suivantes sans succès : {Manufacturer::getNameById($product.id_manufacturer|escape:'html':'UTF-8')} {$product_manufacturer->name} 2. Le nom du client (celui associé à l’adresse de livraison) J’arrive effectivement à ajouter le nom du client avec la variable {$customer.lastname} mais je souhaite afficher celui associé à l’adresse de livraison. Quelqu'un pour m'aider s'il vous plait ? Merci 😊 Link to comment Share on other sites More sharing options...
INTJP Posted February 18, 2023 Author Share Posted February 18, 2023 5 hours ago, INTJP said: Bonjour, J'essaie d'afficher plusieurs informations sur la page "historique de vos commandes" en front office. 1. Le nom de la marque : {$product.manufacturer_name} Mais cette variable ne semble rien renvoyer. J'ai également essayé les suivantes sans succès : {Manufacturer::getNameById($product.id_manufacturer|escape:'html':'UTF-8')} {$product_manufacturer->name} 2. Le nom du client (celui associé à l’adresse de livraison) J’arrive effectivement à ajouter le nom du client avec la variable {$customer.lastname} mais je souhaite afficher celui associé à l’adresse de livraison. Quelqu'un pour m'aider s'il vous plait ? Merci 😊 I've tried this override : <?php class HistoryController extends HistoryControllerCore { public function initContent() { parent::initContent(); $product = new Product($product_id, false, $this->context->language->id, $this->context->shop->id); $manufacturer_name = Manufacturer::getNameById($product->id_manufacturer); $this->context->smarty->assign('manufacturer_name', $manufacturer_name); } } and call the variable with {$manufacturer_name} But nothing shows. Anyone ? Link to comment Share on other sites More sharing options...
ventura Posted February 19, 2023 Share Posted February 19, 2023 themes/classic/your_theme/customer/_partials/order-detail-no-return.tpl {if $product.id_manufacturer} {Manufacturer::getNameById($product.id_manufacturer|intval)} {/if} 1 Link to comment Share on other sites More sharing options...
INTJP Posted February 19, 2023 Author Share Posted February 19, 2023 (edited) 1 hour ago, ventura said: themes/classic/your_theme/customer/_partials/order-detail-no-return.tpl {if $product.id_manufacturer} {Manufacturer::getNameById($product.id_manufacturer|intval)} {/if} Merci pour votre intervention. Est-ce que je dois conserver l’override de historycontroller.php ? C’est sur le fichier history.tpl que je souhaite afficher le nom du fabricant. merci d’avance pour votre retour. —- thanks for getting back to me. do I still need to use the override HistoryController.php file ? if I understand correctly, I insert the variable as you say and call it in history.tpl using {$manufacturer_name} ? i am not a developer, sorry if this is numb question. thanks Edited February 19, 2023 by INTJP (see edit history) Link to comment Share on other sites More sharing options...
INTJP Posted February 20, 2023 Author Share Posted February 20, 2023 On 2/19/2023 at 11:48 AM, ventura said: themes/classic/your_theme/customer/_partials/order-detail-no-return.tpl {if $product.id_manufacturer} {Manufacturer::getNameById($product.id_manufacturer|intval)} {/if} Thank you but this does not seem to work. Any idea why ? Anyone ? Thanks 🙏 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