| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Passing multiple cart items to Javascript code? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I have some Javascript code I need to install on my order success page for conversion tracking, and am not sure how to modify to code to account for multiple items. The code needs a separate line for every item in the order. How do I tell Smarty to do this? See example of the code below.
Code:
|
|||||||
#2
|
|||||||||
|
|||||||||
![]() This usually goes inside the foreach loop in customer/main/order_message.tpl. You'll have to create a new loop for $order.products like:
PHP Code:
|
|||||||||
|
#3
|
|||||||
|
|||||||
![]() I appreciate the response, but I may have misled you. I am a complete novice when it comes to editing Smarty. Could you elaborate more on what you mean?
|
|||||||
#4
|
|||||||||
|
|||||||||
![]() {$op.productcode} is the Smarty variable in this foreach loop to use in place of your sku-item-X. You would want to look inside the $order.products array to see what other variables to use for your quantity-item-X and per-item-cost-item-X, such as $op.amount and $op.display_price, respectively.
|
|||||||||
#5
|
|||||||
|
|||||||
![]() I am trying to incorporate Commission Junction tracking pixels in /common_files/customer/main/order_message.tpl and here is the pixel:
<img src=“https://www.emjcd.com/u?CID=xxxxxxx&OID={$order.order.orderid}&TYPE=5634 &ITEM1=3 214sku&AMT1=13.49&QTY1=1&ITEM2=6577sku&AMT2=7.99&Q TY2=2&CURRENCY=USD& METHOD=IMG“ height=”1” width=“20”> I need to pass multiple ITEM1, ITEM2, ITEM3, ITEM4 and AMT1, AMT2, AMT3, AMT4, QTY1, QTY2, QTY3 QTY4 etc. If someone could post the exact code I would greatly appreciate it, thanks! We have a similar pixel on this page (Part of it below) that works properly but I could not figure out how to incorporate the multiple items in the string above: mpuid={$order.order.orderid}{foreach from=$order.products item="product"}:{$product.productcode|wm_remove|es cape:javascript}:{$product.amount}{/foreach}" Thanks!!
__________________
Mike |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|