View Single Post
  #5  
Old 04-16-2015, 06:07 AM
  mcanitano's Avatar 
mcanitano mcanitano is offline
 

eXpert
  
Join Date: Feb 2006
Location: Melbourne, FL
Posts: 216
 

Default Re: Conversion Tracking

well for one, it looks like you have Smarty variables inside literal tags, that is why they aren't populating.

See

http://www.smarty.net/docsv2/en/language.function.literal

http://www.smarty.net/docsv2/en/language.function.ldelim.tpl

Basically when you use {literal} the smarty variables do not work. So you must {/literal}{$smarty.variable}{literal} each time

This is a quick google search on using smarty variables inside literal tags.

http://stackoverflow.com/questions/5001886/how-can-a-smarty-variable-be-made-working-under-literal-literal


As far as your foreach loop. I believe you need a second foreach loop for the products.


You should have one (like you do) for orders, and a separate for the products inside the orders to get variables like {$product.productid}

Try using
Code:
{foreach from=$order.products item="product"} // Push all products to refiral_cart_items array var refiral_cart_items = []; refiral_cart_items.push({ product_id: '{$product.productid}', // Product ID quantity: '{$product.amount}', // Quantity name: '{$product.product}', // Name of product }); refiral_cart_items.push({ product_id: '{$product.productid}', // Item Product ID quantity: '{$product.amount}', // Item Quantity name: '{$product.product}', // Name of product }); {/foreach}
__________________
Marcello Canitano
New Site: X-Cart v4.5.5 GOLD
X-Cart Mobile v1.4.3
X-Payments v1.0.6
CDSEO Pro v2
Total Server Solutions xCDN

www.silverhorseracing.com
Reply With Quote