Page 1 of 1

get order id, total, customer id on success confirmation

Posted: Fri Nov 27, 2015 1:06 am
by mteverest
Hi,

I'm trying to integrate affiliate tracking which needs to be placed on success.tpl but variables are already cleared before success page is displayed so that tracking code not getting values for the variable.

It needs value for following variable for affiliate tracking.

CRID=<?php echo $orderDetails['customer_id']; ?>
ORDERID=<?php echo $orderDetails['order_id']; ?>
ORDERAMNT=<?php echo $orderDetails['total']; ?>
CUR=<?php echo $orderDetails['currency']; ?>

I'll really appreciate if i get some hints how to get values for variable in success.tpl.

Thanks.

Re: get order id, total, customer id on success confirmation

Posted: Fri Nov 27, 2015 1:18 am
by ocmta
In catalog/controller/checkout/success.php , right below this line:

Code: Select all

if (isset($this->session->data['order_id'])) {
add this:

Code: Select all

$this->load->model('checkout/order');
$data['orderDetails] = $this->model_checkout_order->getOrder($this->session->data['order_id']);

Re: get order id, total, customer id on success confirmation

Posted: Fri Nov 27, 2015 10:02 am
by mteverest
Thank you so much 'ocmta'. It worked perfectly.
Thanks a lot for your help.

Re: get order id, total, customer id on success confirmation

Posted: Mon Oct 10, 2016 6:08 pm
by taran_117
Hi

Its not working for ver 2.3. Any help for the same version?

Re: get order id, total, customer id on success confirmation

Posted: Mon Oct 10, 2016 7:02 pm
by ocmta
taran_117 wrote:Its not working for ver 2.3.
It should work fine in 2.3 as well without any changes.

Re: get order id, total, customer id on success confirmation

Posted: Wed Apr 12, 2017 7:33 pm
by joss
taran_117 wrote:
Mon Oct 10, 2016 6:08 pm
Hi
Its not working for ver 2.3. Any help for the same version?
It's working fine.. It's just missing a ' in

Code: Select all

$data['orderDetails]
Thanks ocmta!