| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Commision Junction Pixel Integration.... | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Hi folks,
I am trying to install a tracking pixel from CJ to track products and totals. Here is my code: In order_message.tpl: {foreach from=$orders item="order"} <img src="https://www.bunnyburybaby.com/u?CID=2412429&OID={$order.order.orderid}&TYPE=5000 {foreach from=$order.products item=product}&ITEM{counter start=1 name=item}={$product.productcode}&AMT{counter start=1 name=amt}={$product.price}&QTY{counter start=1 name=qty}={$product.amount}{/foreach}&CURRENCY=USD&METHOD=IMG" height="1" width="20">{/foreach} which outputs: <img src="https://www.bunnyburybaby.com/u?CID=2412429&OID=11561&TYPE=5000&ITEM1=CL-LC-GREEN&AMT1=39.95&QTY1=1&ITEM1=HS-INDIE&AMT1=35.27&QTY1=1&ITEM1=BO-601&AMT1=14.95&QTY1=1&ITEM1=GIFTWRAP&AMT1=7.50&QTY 1=1&CURRENCY=USD&METHOD=IMG" height="1" width="20"> The problem I have is with the counting of the item, qty and amt fields. I tried the {counter} command, but it didnt work. I would like them to start at 1 and go up with each product but my coding is not the best. I would like it to output like this example: <img src="https://www.bunnyburybaby.com/u?CID=2412429&OID=11561&TYPE=5000&ITEM1=CL-LC-GREEN&AMT1=39.95&QTY1=1&ITEM2=HS-INDIE&AMT2=35.27&QTY2=1&ITEM3=BO-601&AMT3=14.95&QTY3=1&ITEM4=GIFTWRAP&AMT4=7.50&QTY 4=1&CURRENCY=USD&METHOD=IMG" height="1" width="20"> Could you please help me with this. The counting is the only thing holding me up. Thanks a bunch guys! Bunnyburybaby
__________________
X-Cart Version 4.1.8 |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() I found my solution:
Instead of counter, I needed to name the foreach and add {$smarty.foreach.pr.iteration}. Worked great! Code:
Thanks anyways folks!
__________________
X-Cart Version 4.1.8 |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|