Detecting when there are no shipping methods available
-
I want to allow users from other countries to browse my site, but not allow them to buy: if they try, there should be a message asking them to email us for a custom shipping quote.
I have configured two shipping zones: my country and every other one, and I have left the latter without any shipping methods. This way, if an user enters a foreign shipping address, there won’t be any shipping methods available.
Now I want to disable every payment gateway I have in that case. I know I can use the
woocommerce_available_payment_gateways
filter, but how do I detect the “no shipping methods” condition using code?Thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Detecting when there are no shipping methods available’ is closed to new replies.