I have Clickship plugin that shows live shipping rates from different couriers via their rest api and I have a flat rate shipping option which is added via woocommerce, my question is I want to hide the shipping options coming from Clickship depending on the users state or country and retain shipping option added from woocommerce (which is the flat rate).
function checkForInput($) {
var val = $('input#billing_city');
if (val === 'victoria') {
$('label[for="shipping_method_0_3400"]').css('display','none');
} else {
$('label[for="shipping_method_0_3400"]').css('display','block');
}
}
jQuery('input#billing_city').each(function() {
checkForInput(this);
});
jQuery('input#billing_city').on('change', function() {
checkForInput(this);
});
so what should happen is when user enters city equal to victoria it should remove that shipping option from Canpar Ground Shipping option from clickship, but i cant seem to get it working