cancel
Showing results for 
Search instead for 
Did you mean: 

Variabili OrderID e Subtotale in success.phtml

Variabili OrderID e Subtotale in success.phtml

ciao a tutti

ho una difficoltà.

dovrei inserire un pixel tracking all'interno del file "success.phtml".

Il codice è il seguente, ma non riesco a richiamare le variabili di order_id e subtotale.

 

<iframe src="https://tbs.tradedoubler.com/report?organization=0000000&event=000000&ordernumber={{var order_increment_id}}&orderValue={{var order_subtotal_incl_tax}}&currency=EUR&tduid=TDUID&type=iframe" width="1" height="1" frameborder="0" /iframe>

sapreste aiutarmi con il codice? sicuramente sbaglio a richiamare le variabili.

 

grazie mille per l'aiuto.

2 REPLIES 2

Re: Variabili OrderID e Subtotale in success.phtml

Hello @iGniTioN3D 

 

please check below code

 

<?php
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$orderData = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($block->getOrderId());
?>
<iframe src="https://tbs.tradedoubler.com/report?organization=0000000&event=000000&ordernumber=<?php echo $block->getOrderId();?>&orderValue=<?php echo $orderData->getGrandTotal();?>&currency=EUR&tduid=TDUID&type=iframe" width="1" height="1" frameborder="0" /iframe>

using object manager not a good idea, for quick answer i did it

you can follow below url

https://magento.stackexchange.com/questions/116914/magento-2-get-order-total-on-success-page

 

 

Hope it will help you, if help you then mark as a solution.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Variabili OrderID e Subtotale in success.phtml

@Sunil Patel  many thanks.

 

I don't know if it works on magento 1.9.3.
I try and tell you.

thank you very much for helping.