|

Getting Order Id # On Order Landing Page?
Posted 05 May 2014 - 08:17 PM #21
EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.
Posted 06 May 2014 - 12:47 AM #22
shouldn't use an 'override' for any of the order_confirmation hooks. You should never use an override hook unless you absolutely need to replace the existing content and are willing to throw away an other addon pre or post templates.
Hi Tbirnseth,
This is how I started using the override file for the Google Analytics Code.
It works great for the tracking with Google on the order confirmation...but this should have been done differently since it will interfere with trying to use this file 'order_confirmation.post.tpl' in the same directory?

-Tim
Posted 06 May 2014 - 05:00 AM #23
EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.
Posted 07 May 2014 - 01:42 AM #24
Creating the post file: skins/[SKIN_NAME]/customer/addons/my_changes/hooks/checkout/order_confirmation.post.tpl
And placing both javascripts into the single post file?
<!-- Shopper Approved Successful Order Code --> {if $order_info} <script type="text/javascript"> var sa_values = {$ldelim} 'site': '{$config.http_host}', 'orderid': {$order_info.order_id}, 'name': '{$order_info.firstname} {$order_info.lastname}', 'email': '{$order_info.email}' {$rdelim}; function saLoadScript(src) {$ldelim} var js = window.document.createElement('script'); js.src = src; js.type = 'text/javascript'; document.getElementsByTagName("head")[0].appendChild(js); {$rdelim} var d = new Date(); if (d.getTime() - 172800000 > 1398344779000) saLoadScript('//www.shopperapproved.com/thankyou/rate/xxxx.js'); else saLoadScript('//direct.shopperapproved.com/thankyou/rate/xxxx.js?d=' + d.getTime()); </script> {/if} <!-- Google Code for Sales Conversion Page --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 123456789; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "HOHFCKboxQQQxMSL_gM"; var google_conversion_value = 0; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/123456789/?value=0&label=HOHFCKboxQQQxMSL_gM&guid=ON&script=0"/> </div> </noscript>
Thanks!
Posted 07 May 2014 - 07:11 AM #25
Would it be possible to safely combine the Google Tracking with the Shopper Approved code in the same post file? Then once that post file exists then just remove the original override file.
Creating the post file: skins/[SKIN_NAME]/customer/addons/my_changes/hooks/checkout/order_confirmation.post.tpl
And placing both javascripts into the single post file?<!-- Shopper Approved Successful Order Code --> {if $order_info} <script type="text/javascript"> var sa_values = {$ldelim} 'site': '{$config.http_host}', 'orderid': {$order_info.order_id}, 'name': '{$order_info.firstname} {$order_info.lastname}', 'email': '{$order_info.email}' {$rdelim}; function saLoadScript(src) {$ldelim} var js = window.document.createElement('script'); js.src = src; js.type = 'text/javascript'; document.getElementsByTagName("head")[0].appendChild(js); {$rdelim} var d = new Date(); if (d.getTime() - 172800000 > 1398344779000) saLoadScript('//www.shopperapproved.com/thankyou/rate/xxxx.js'); else saLoadScript('//direct.shopperapproved.com/thankyou/rate/xxxx.js?d=' + d.getTime()); </script> {/if} <!-- Google Code for Sales Conversion Page --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 123456789; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "HOHFCKboxQQQxMSL_gM"; var google_conversion_value = 0; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/123456789/?value=0&label=HOHFCKboxQQQxMSL_gM&guid=ON&script=0"/> </div> </noscript>
Thanks!
You can add unlimited amout of scripts to the .post tpl file. The override is not necessary in this case.
CS-Cart USD 345 Multi-Vendor USD 1250 Multi-Vendor PLUS USD 3100 (2775)
CS-Cart Ultimate USD 775 CS-Cart + YOUPI USD 545 Multi-Vendor Ultimate USD 7500 (6000)
Posted 07 May 2014 - 08:02 PM #26
1. Use the 'async' attribute to the script tag like:
<script async>2. Put all scripts within a single
<script async> $.document.ready(function () {$ldelim} your JS scripts here {$rdelim}); </script>
This should ensure that the scripts do NOT execute until after the page fully loads and that they will complete even if the user quickly leaves the page. You can probably get by without the async but it won't hurt anything.
EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.