Hello Mike, if you need to send any sort of data to the ajax generated html code of the shippin methods you can do so within ajaxhelper.php file. The OPC1 includes several triggeres.
If you are looking for a triggerer "after shipping method selected" please have a look onto extension in /components/com_onepage/ext/paymentpershipping
to trigger a javascript function, just add this code anywhere within body tags (within the theme files for example):
- Code: Select all
<script type="text/javascript">
if ((typeof callAfterShippingSelect != 'undefined') && (callAfterShippingSelect != null))
callAfterShippingSelect.push("yourFunction()");
</script>
(you can add cdata tags as well)
within yourFunction(), you can use:
- Code: Select all
selectedshipping = getVShippingRate();
which will return VM1 format of the shipping method's data.
or getInputIDShippingRate() which will return an ID -> but be carefull as some methods can share the same id for more then one method (ups...)
you can then make tests with
- Code: Select all
if (selectedshipping.indexOf('what_i_am_looking_for')>=0)
{
// create an element with <div id="delivery_date_here"> </div>
document.getElementById('delivery_date_here').innerHTML = 'anything you want to show to the customer';
}
Within OPC1 i decided not to use mootools or jquery due to the compatiblity with all of the j1.5 themes.
To include external javascript file, please check include.php within your theme in
/components/com_virtuemart/themes/default/templates/onepage/YOUR SELECTED THEME/include.php
You also may want to check the delivery date extensions for OPC1 at the extension tab -> usr_act and others.
Best Regards,
Stan