Zen Cart Logo
Forums / General Questions / Can I add model numbers to affiliate tracking pixels?

Can I add model numbers to affiliate tracking pixels?

Views: 469

Results 1 to 3 of 3
11 Jun 2013, 9:51 PM
#1
laser_tek avatar

laser_tek

New Zenner

Join Date:
Aug 2010
Posts:
5
Plugin Contributions:
0

Can I add model numbers to affiliate tracking pixels?

I have setup our affiliate tracking pixel via http://www.zen-cart.com/showthread.php?112649-Where-to-put-my-Affiliate-Tracking-Code and everything is working properly. We are trying to obtain order id(which I have), order total(which I have) and we are needing what was purchased(which I don't have). We are mainly looking for the "products_model" for each item that was included with the order. I am curious if anyone would know how I could get the model numbers for all the products associated with the order. Any help would be greatly appreciated. Thanks

Josh
Laser Tek Services

11 Jun 2013, 10:03 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Can I add model numbers to affiliate tracking pixels?

You'll need to write a database query to pull all that information (products_model from orders_products table where orders_id is your current order number), and then output that information to your tracking pixel code.
You can do all that in the same PHP file where you put your pixel code now.

You could simplify some of the coding by writing an observer class to intercept the NOTIFY_CHECKOUT_PROCESS_HANDLE_AFFILIATES notifier point, and global the $order object and then loop through the $order->products array extracting the ['model'] element from each array entry; then add the list of model numbers to the $_SESSION['order_summary'] array as $_SESSION['order_summary']['models']. Then your tracking pixel code could loop through the $_SESSION['order_summary']['models'] array to output all its extraneous data for each.

12 Jun 2013, 8:11 PM
#3
laser_tek avatar

laser_tek

New Zenner

Join Date:
Aug 2010
Posts:
5
Plugin Contributions:
0

Re: Can I add model numbers to affiliate tracking pixels?

Thank you very much DrByte for getting back to me. I have a little bit of programming experiencing but I am mainly known for being able to copy/paste code where it is needed. Would you be able to provide me an example as to what I am supposed to add as it sounds like I am needing to do multiple things. As I mentioned it sounds like this custom code is going to be out of my scope so if anyone can give me a hand I would really appreciate it. Thanks

Josh
Laser Tek Services