Looks like its missing the $ from the class selector in the jQuery.
if($(‘.payment_method_st_gateway’).is( ‘:checked’ )) {
and a closing brace to line 75
}
We gave up on this plugin after a while.
hope that helps.
Also use ‘ quotes not ‘ and ’
Yea I’m just not sure exactly where to place this condition with the validation like the ticket above, I see the plugin is retired from WooCommerce and just through a 3rd party now.
Thanks,
Andrew
You might need an onchange or onsubmit event to wrap around this, however have a look and see if there are any hooks or JS hooks regarding WooCommerce or the plugin has any specific.
https://docs.woocommerce.com/wc-apidocs/class-WC_Checkout.html
https://docs.woocommerce.com/document/composite-products/composite-products-js-api-reference/
Something like an php hook to send back to php and return a value to process the js from submitting the form or in the js itself might have a function.
I know Ninja Forms uses Backbone and Marionette listeners for the forms so you can interrupt processing there.
I remember having to hack the plugin itself because the JS added extra digits to the year. In assets/js/front-end/main.js (note you will need to re minify this.
You will find lines like this line 81 – 95
Here is my version that fixes the checkout error on the date
$(document).on('change, keyup', '#' + st_object.id + '-card-expiry', function () {
if ($(this).val().indexOf('/')) {
///var date_details = $(this).val().split(' / ');
var date_details = $(this).val().toString().split('/');
if(date_details.length > 1) {
/// 29.01.2019 - Fixed
$('#' + st_object.id + '-cc-month').val( date_details[0].trim() );
///$('#' + st_object.id + '-cc-year').val( "20" + date_details[1] );
$('#' + st_object.id + '-cc-year').val( date_details[1].trim() );
}
}
});
I fixed by adding if($(‘.payment_method_st_gateway’).is( ‘:checked’ )) {
}
wrapped around all the callback functions, this plugin does not play nicely with multiple payment methods, please fix in a future update!
Nice one!
I’m sure the developers will get to look at this post and find a fix in due course.
Thanks
Andi