Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Commision Junction Pixel Integration....

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-16-2008, 09:18 AM
  BunnyburyBaby's Avatar 
BunnyburyBaby BunnyburyBaby is offline
 

Advanced Member
  
Join Date: Nov 2007
Location: Los Angeles
Posts: 32
 

Default Commision Junction Pixel Integration....

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
Reply With Quote
  #2  
Old 06-16-2008, 09:47 AM
  BunnyburyBaby's Avatar 
BunnyburyBaby BunnyburyBaby is offline
 

Advanced Member
  
Join Date: Nov 2007
Location: Los Angeles
Posts: 32
 

Default Re: Commision Junction Pixel Integration....

I found my solution:

Instead of counter, I needed to name the foreach and add {$smarty.foreach.pr.iteration}. Worked great!

Code:
{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 name=pr}&ITEM{$smarty.foreach.pr.iteration}={$product.productcode}&AMT{$smarty.foreach.pr.iteration}={$product.price}&QTY{$smarty.foreach.pr.iteration}={$product.amount}{/foreach}&CURRENCY=USD&METHOD=IMG" height="1" width="20">{/foreach}

Thanks anyways folks!
__________________
X-Cart Version 4.1.8
Reply With Quote

The following user thanks BunnyburyBaby for this useful post:
Blazeland (07-21-2010)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:29 PM.

   

 
X-Cart forums © 2001-2020