Bonjour,
Je suis nouveau sur prestashop (Version1.6.1.11) j'essaye d'implémenter le pixel suivant sur la page de confirmation de commande:
<img src="https://tbs.tradedoubler.com/report?organization=2145034&event=385961&orderNumber={$id_order}&orderValue={$total_to_pay}¤cy=EUR" border="0" height="0" width="0"> que j'insère avec un module html.
Mais je n'arrive pas à afficher les variables smarty dans order-confirmation.tpl. Lorsque je teste dans un simple champ <p>{$id_order|print_r}</p> sur cette page, rien ne s'affiche.
$id_order semble pourtant assigné dans orderConfirmationController.php.
J'ai regardé les solutions pour un problème similaire d'un vieux thread mais rien ne marche.
Quelqu'un peut-il m'aider?
*orderConfirmationController.php :
public function initContent() { parent::initContent(); $this->context->smarty->assign(array( 'is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); if ($this->context->customer->is_guest) { $this->context->smarty->assign(array( 'id_order' => $this->id_order, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email )); /* If guest we clear the cookie for security reason */ $this->context->customer->mylogout(); } $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); }
*order-confirmation.tpl :
{capture name=path}{l s='Order confirmation'}{/capture} <h1 class="page-heading">{l s='Order confirmation'}</h1> <img src="https://foxistat.fr/liptracker.php?a=sell&ann=203&amount=[MONTANT_VENTE_HT]&c=[ID_COMMANDE]" width="1" height="1"/> {assign var='current_step' value='payment'} {include file="$tpl_dir./order-steps.tpl"} {include file="$tpl_dir./errors.tpl"} <p>{l s='.'}{$objOrder->id}</p> {$HOOK_ORDER_CONFIRMATION} {$HOOK_PAYMENT_RETURN} {if $is_guest} <p>{l s='Your order ID is:'} <span class="bold">{$id_order_formatted}</span> . {l s='Your order ID has been sent via email.'}</p> <p class="cart_navigation exclusive"> <a class="button-exclusive btn btn-default" href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order|urlencode}&email={$email|urlencode}")|escape:'html':'UTF-8'}" title="{l s='Follow my order'}"><i class="icon-chevron-left"></i>{l s='Follow my order'}</a> </p> {else} <p class="cart_navigation exclusive"> <a class="button-exclusive btn btn-default" href="{$link->getPageLink('history', true)|escape:'html':'UTF-8'}" title="{l s='Go to your order history page'}"><i class="icon-chevron-left"></i>{l s='View your order history'}</a> <button class="button btn btn-default standard-checkout button-medium"> <span> <a href="/fr"> {l s='Return to Home'} </a> </span> </button> </p> {/if}