I'm trying to create an if statement. I added the code in my function.php. Any idea how to fix it?
Hi guy. I'm trying to create an if statement. If the Pickup label set to yes. I want to hide the shipping address. If it is no then I want to keep it visible. I added the code in my function.php. Any idea how to fix it? Here's the link https://berggallery.com/checkout/
function (woocommerce_disable_shipment_option_if_pickup_is_true){
$pickup-options = array (
'Yes' => true,
'No' => false
)
if ( $pickup-options == 'Yes') ) {
add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false');
}
ifelese ($pickup-options == 'No' ) {
add_filter( 'woocommerce_cart_needs_shipping_address', '__return_true');
}
}
No any search results
You already invited:
1 Answers
allian
Upvotes from:
var drop_value = $('.dropdown').val();
if(drop_value === 'Yes')
{
$('.shipping').show();
}
else if(drop_value === 'No')
{
$('.shipping').hide();
}