Jump to content



Member Since 03 Mar 2011
Offline Last Active Jun 22 2015 10:59 AM

Topics I've Started

Adding Line Items Into Affiliate Tracking Code

03 March 2014 - 05:50 PM

I wish to implement an affiliate scheme with some tracking code in the order confirmation page that transmits the order information to a third party.

Using CS-Cart 2.2.4

I've found http://kb.cs-cart.co...g-code-addition and created the file order_confirmation.override.tpl in the correct place. Here is the content so far (with <script> tags removed):

irEvent.addItem("{$item.product}", "{$item.product_code}", "{$item.price}", {$item.amount});

The problem is that I need to add a new row to the script for each line item in the shopping cart (above, it's the line that begins 'irEvent.addItem')


irEvent.addItem("mp3player1", "sku-1234", "109.00", 1);
irEvent.addItem("mp3player2", "sku-1235", "545.00", 5);

I don't know the correct PHP for a loop to list a 'irEvent.addItem' line for each line item in the cart. Hoping that it's a simple bit of code I can just slot in.

Any help or advice would be gratefully received.