Javascript on checkout form load

Javascript on checkout form load

Postby info@.....com » Sun Jun 24, 2012 2:31 pm

Hi,
I need to add some javascript (for some analytics) on the loading of the checkout form. This is similar to the Tracking configuration but on the loading of the form, not on the pressing of the submit button. As far as I can tell there isn't a way of configuring this? Would you have any recommendations as to which file to add the javascript in so as to minimized potential issues when upgrading One Page Checkout?

Thanks in advance

Mike
info@.....com
 
Posts: 6
Joined: Sun Jun 24, 2012 2:27 pm

Re: Javascript on checkout form load

Postby admin » Wed Jun 27, 2012 6:16 pm

Hello Mike, there is now way to add it from the backend and you might want to do it this way:

For OPC1 each template does it's includes from include.php in /components/com_virtuemart/themes/default/templates/onepage/YOUR THEME/include.php (please have a look on three_column_templates which have the most includes of css or javascripts)

There is a guide how to add a custom after-page load script here:
http://docs.joomla.org/Adding_JavaScript_and_CSS_to_the_page

If you decide to use:
Code: Select all
window.addEvent("domready", function()   ...

your mootools cannot give any errors (pls check with ctrl + shift +j on FF or F12 on chrome). If you see any sort of errors, it is not sure if the javascript loads properly.

If you were ok with javascript AFTER the form validation AND button press, you can use the Tracking tab to add javascript.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 1.1.x

cron