Post by katalin » Fri Nov 26, 2010 12:27 am

Could anyone tell me what are the variables for order id, total amount and product names?
I want to insert a tracking pixel script in the confirmation(success) page and I need those variables. Where do you recommend I insert the script, confirmation or success page?

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by katalin » Fri Nov 26, 2010 1:51 am

I found the vars for order id and total, now I need product names, I will need them like: prod1, prod2, prod3, etc...Hope you guys can help me.
PS: I will use this var in templates... success.

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by cartpro » Fri Nov 26, 2010 2:54 am

I think you need to do it in the checkout/success page. If you do it in the confirmation page, the may go up to the confirm page but didn't click on the confirm button. In that case, you will count it a new order even though the user didn't place the order.

However, in the controller of the Success page, it clears all the details from the session including cart contents.

So my guess it that you should add the code in checkout/success.php as the first line in Index() function. Store the required fields in $this->data array so you can use it in the template.

Extensions: Multi-vendor extension
Shipping Modules: SuperShip Pro

Multi-Vendor Marketplace:Opencartmarketplace.com
IceCat to Opencart: Import millions of IceCat products to Opencart


New member

Posts

Joined
Fri Oct 29, 2010 1:50 am

Post by katalin » Fri Nov 26, 2010 10:52 pm

In templates->success what variable can I use to display order content(product names)?

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by Xsecrets » Fri Nov 26, 2010 11:26 pm

unfortunately you can't. All order data is purged before you can use it in the success page. It would be nice if the data was exposed at that point because lots of tracking type scripts need it there.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Sat Nov 27, 2010 12:12 am

Xsecrets wrote:unfortunately you can't. All order data is purged before you can use it in the success page. It would be nice if the data was exposed at that point because lots of tracking type scripts need it there.
The success controller clears all the session data, but you can certainly set that to a variable before the unset.
For products you'd have to use the order_id and do a lookup on the success page by the order id, similar to how the confirm() function does it in catalog/model/checkout/order.php

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by katalin » Sat Nov 27, 2010 6:23 am

I didn't understand a thing, so... is there a way to display order products in success.tpl?

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by Xsecrets » Sat Nov 27, 2010 8:32 am

Qphoria wrote:
Xsecrets wrote:unfortunately you can't. All order data is purged before you can use it in the success page. It would be nice if the data was exposed at that point because lots of tracking type scripts need it there.
The success controller clears all the session data, but you can certainly set that to a variable before the unset.
For products you'd have to use the order_id and do a lookup on the success page by the order id, similar to how the confirm() function does it in catalog/model/checkout/order.php
yes I understand how it all works I've actually done it before, but it would be very nice if the variables were added to the default install. They are needed for many different things like analytics ecommerce integration clicktraks and dozens more.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by katalin » Tue Nov 30, 2010 9:38 pm

Guys, open your own thread, don't ruin mine. If anyone can help me please read my posts and try to help. Thanks!

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by Qphoria » Tue Nov 30, 2010 10:32 pm

Xsecrets wrote:
Qphoria wrote:
Xsecrets wrote:unfortunately you can't. All order data is purged before you can use it in the success page. It would be nice if the data was exposed at that point because lots of tracking type scripts need it there.
The success controller clears all the session data, but you can certainly set that to a variable before the unset.
For products you'd have to use the order_id and do a lookup on the success page by the order id, similar to how the confirm() function does it in catalog/model/checkout/order.php
yes I understand how it all works I've actually done it before, but it would be very nice if the variables were added to the default install. They are needed for many different things like analytics ecommerce integration clicktraks and dozens more.
Which variables would you like then? I see no feature request for this
katalin wrote:Guys, open your own thread, don't ruin mine. If anyone can help me please read my posts and try to help. Thanks!
Please explain what exactly you want to see on the success page? You want to see a full receipt page with products, order id, and totals? You've only hinted you want to find certain data but not explaining how you want them as that would depend on how they are shown.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Wed Dec 01, 2010 12:19 am

I don't think anyone wants them to be shown (well I imagine someone would) the important thing is to have them available as variables so you can put in a tracking javascript pretty much any sales tracking script is going to need at the very least the orderid, and total, and most accept list of products price name etc too. I'm actually rather surprised that this hasn't already been included and analytics ecommerce tracking added. I have added it to my site, and it is very useful.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by essexboyracer » Sat Dec 04, 2010 11:24 pm

I can understand this as well, I have a client that would like to track orders etc in Google Analytics. The following page explains the method:

http://code.google.com/apis/analytics/d ... merce.html

Sorry to hijack this thread, but I was also looking to do a complete xml, order, items, qty, price, stock etc etc to go off to a fulfillemt house, rather than do this on the success.php page, I think I can do it on model/checkout/order, where the order emails are generated? What do you think?

EDIT:

http://forum.opencart.com/viewtopic.php ... ss#p113938

Tring Web Design


New member

Posts

Joined
Thu Jun 03, 2010 2:20 pm

Post by katalin » Wed Dec 08, 2010 1:23 am

Qphoria wrote: Which variables would you like then? I see no feature request for this
In templates/success.tpl I will need the var for all the products that were in the cart.

Active Member

Posts

Joined
Wed May 05, 2010 2:28 am

Post by jcolson1027 » Tue Oct 08, 2013 6:23 am

katalin wrote:I found the vars for order id and total, now I need product names, I will need them like: prod1, prod2, prod3, etc...Hope you guys can help me.
PS: I will use this var in templates... success.
I don't mean to steal the thread, but can I ask where you find the variables?

Newbie

Posts

Joined
Thu Jul 25, 2013 9:36 am

Post by edikmanis » Wed Oct 02, 2019 8:33 pm

Hello There, I am searching for the variables as well. I need to complete the following code:
Any help appreciated!
Thank you in advance

Attachments

LW.jpg

LW.jpg (108.96 KiB) Viewed 10860 times


Newbie

Posts

Joined
Wed Oct 02, 2019 8:19 pm
Who is online

Users browsing this forum: No registered users and 71 guests