| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
XCart removing code from script. How to get code on page? | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
![]() Here's the code I get on the confirmation page.
<script type="text/javascript"> _springMetq.push(["setdata", {revenue: ""}]); _springMetq.push(["setdata", { "orderId": "" }]); _springMetq.push(["setdata", { "email": "" }]); _springMetq.push(["setdata", { "promoCode": "" }]); _springMetq.push(["convert", "sale" ]); </script>
__________________
JK X-Cart version 4.7 We have about lots of add-on modules. |
|||||||
#12
|
|||||||||
|
|||||||||
![]() Have you used webmaster mode to ensure that the smarty variables you are using are available and correct for whatever page this is on?
You can also use ldelim if you find it easier: http://www.smarty.net/docsv2/en/language.function.ldelim.tpl --- ---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
#13
|
|||||||
|
|||||||
![]() Quote:
I'm not sure what this means - as far as testing it. I've just now seen Webmaster Mode for the first time, so will check that shortly. This is on /customer/main/order_message.tpl because it's tracking the conversion of the sale. Is there somewhere else I would put it to make it work better? How would I know what the correct smarty variables would be? Thanks for your help!
__________________
JK X-Cart version 4.7 We have about lots of add-on modules. |
|||||||
#14
|
|||||||||
|
|||||||||
![]() Webmaster mode tells you all the smarty variables available on whichever page you need the code to be. You can look at the X-Cart documentation for Webmastermode, or you might find the tutorials that Totaltec has created useful. Just search for him on the the forum and follow the links in his signature.
---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold (CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module) |
|||||||||
|
#15
|
|||||||
|
|||||||
![]() Webmaster Mode doesn't give me a list of variables.
It just gives me a list of templates referenced for the page I'm on. ![]() ![]() ![]() ![]() ![]() ![]() ![]() etc. (X-cart.com doesn't let me post the full list, but it's just a list of templates.)
__________________
JK X-Cart version 4.7 We have about lots of add-on modules. |
|||||||
#16
|
|||||||
|
|||||||
![]() Quote:
Click on "Show Variables" in the debug console.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#17
|
|||||||
|
|||||||
![]() Ah -- you are in version 4.1.x, yes? There's a slightly different way to do it.
See this thread: http://forum.x-cart.com/viewtopic.php?t=17601
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
|
#18
|
|||||||
|
|||||||
![]() Here's the code that seems to work to do everthing correctly, except put the variables in.
Here's what's in order_message.tpl: <!-- SpringMetrics Conversion Code for mattressinsider --> <script type="text/javascript"> _springMetq.push(["setdata", {literal}{revenue: "{/literal}{$order.order.subtotal}{literal}"}]); _springMetq.push(["setdata", { "orderId": "{/literal}{$order.orderid}{literal}" }]); _springMetq.push(["setdata", { "email": "{/literal}{$order.email}{literal}" }]); _springMetq.push(["setdata", { "promoCode": "{/literal}{$order.coupon}{literal}" }{/literal}]); _springMetq.push(["convert", "sale" ]); </script> <!-- SpringMetrics Conversion Code for mattressinsider --> Here's what's output on https://www.mattressinsider.com/cart.php?mode=order_message&orderids=12816&keep_ht tps=yes <!-- SpringMetrics Conversion Code for mattressinsider --> <script type="text/javascript"> _springMetq.push(["setdata", {revenue: ""}]); _springMetq.push(["setdata", { "orderId": "" }]); _springMetq.push(["setdata", { "email": "" }]); _springMetq.push(["setdata", { "promoCode": "" }]); _springMetq.push(["convert", "sale" ]); </script> <!-- SpringMetrics Conversion Code for mattressinsider --> Except it's spaced properly when I view the code: <!-- SpringMetrics Conversion Code for mattressinsider --> <script type="text/javascript"> _springMetq.push(["setdata", {revenue: ""}]); _springMetq.push(["setdata", { "orderId": "" }]); _springMetq.push(["setdata", { "email": "" }]); _springMetq.push(["setdata", { "promoCode": "" }]); _springMetq.push(["convert", "sale" ]); </script> <!-- SpringMetrics Conversion Code for mattressinsider --> Here are the variables I have tried in revenue: {$order.total} {$order.order.subtotal} What other variables might work there to put in the revenue? Is there a guide or list of variables somewhere? Thank-you so much for helping with this.
__________________
JK X-Cart version 4.7 We have about lots of add-on modules. |
|||||||
#19
|
|||||||
|
|||||||
![]() Based on this post:
http://forum.x-cart.com/showthread.php?t=62458 I also just tried: {foreach from=$orders item=order} ... {$order.total} ... {/foreach} Which output this: <!-- SpringMetrics Conversion Code for mattressinsider --> <script type="text/javascript"> _springMetq.push(["setdata", {revenue: "... ... "}]); _springMetq.push(["setdata", { "orderId": "" }]); _springMetq.push(["setdata", { "email": "" }]); _springMetq.push(["setdata", { "promoCode": "" }]); _springMetq.push(["convert", "sale" ]); </script> <!-- SpringMetrics Conversion Code for mattressinsider --> I also just tried it without the ..., which output this: <!-- SpringMetrics Conversion Code for mattressinsider --> <script type="text/javascript"> _springMetq.push(["setdata", {revenue: "... ... "}]); _springMetq.push(["setdata", { "orderId": "" }]); _springMetq.push(["setdata", { "email": "" }]); _springMetq.push(["setdata", { "promoCode": "" }]); _springMetq.push(["convert", "sale" ]); </script> <!-- SpringMetrics Conversion Code for mattressinsider -->
__________________
JK X-Cart version 4.7 We have about lots of add-on modules. |
|||||||
#20
|
|||||||
|
|||||||
![]() Don't "try" - go get the actual variable. I gave you the link.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
|
|
|||
X-Cart forums © 2001-2020
|