Hi nbruley,
It looks like this is jigoshop bug. It will be fixed in new release.
OK thank you. Can you please tell me which file can be adjusted to temporarily give the functionality I need until then?
In jigoshop/assets/js/countries.js replace line 39 with this code: $('option[value="'+selected+'"]', $state).attr('selected', 'selected');
That fixes the error. There is only one more problem that didn’t used to be a problem, with the following code:
$(‘div.payment_method_bank_transfer’).hide();
Does not hide that particular section on page load, but it does hide it after page load. Is there some coding going on that would affect this?
I have tried two different ways of coding it and it just doesn’t go away. The bank transfer information should only be shown if the user selects Mexico before getting to the confirm your order page. Otherwise it should not be visible. The rest of the Mexico payment type information is hidden properly, but I can’t get rid of the bank info.
I think it would be better to hide parent instead of hiding all childs.
Try this code:
jQuery(document).ready(function($){
function refreshGateways() {
switch($('#billing_country').val()){
case 'MX':
$('#payment_method_bank_transfer').prop('checked',true);
$('#payment_method_bank_transfer').parent().slideDown(500);
$('#payment_method_paypal').parent().slideDown(500);
$('#payment_method_cod').parent().slideUp(500);
break;
case 'US':
$('#payment_method_paypal').prop('checked',true);
$('#payment_method_bank_transfer').parent().slideUp(500);
$('#payment_method_paypal').parent().slideDown(500);
$('#payment_method_cod').parent().slideUp(500);
break;
default:
$('#payment_method_cod').prop('checked',true);
$('#payment_method_bank_transfer').parent().slideUp(500);
$('#payment_method_paypal').parent().slideUp(500);
$('#payment_method_cod').parent().slideDown(500);
break;
}
}
refreshGateways();
$('#billing_country').change(refreshGateways);
});
Thanks! That works well apart from the fact that for whatever reason when the page finishes loading, the selection of the payment method gets lost. I thought maybe it was the slide up/down but that wasn’t it either.
Maybe you have default gateway selected in jigoshop database.
I do not see a way to unselect a default gateway. Is there a way to disable that? Previously this worked, or at least in a previous Jigoshop version… I guess it’s not a big deal to make the customer select it though, but it would be nice to do it for them, especially if there is only one option.