Not all countries have zip codes. Which country?
Please post a link to your site.
Thread Starter
shyton
(@shyton)
https://affixzw.com/ ,I just want the option for someone to enter a zip code to be available ,,the payment gateway I was trying to use requires a zip code field
Thread Starter
shyton
(@shyton)
I’m trying to use 2Checkout as a payment gateway
I can’t get to the checkout page, I don’t want to sign up. So the WooCommerce checkout page does have a postcode field? but this is not passed to 2Checkout? 2Checkout isn’t supported here.
Hi @shyton,
What happens if you momentarily change the theme to Storefront, does the Zip Code field appear? Please make a backup before doing any changes.
Thread Starter
shyton
(@shyton)
Hi ,I tried to change my theme multiple times it was still the same
Thread Starter
shyton
(@shyton)
I selected another country then the zip code field appeared ,so how do I set it to be always visible even for countries that have no zip code?
You would need to use the filter: ‘woocommerce_get_country_locale’.
This is from class-wc-countries.php line 795 on. The filter will allow you to change whether or not the postcode field is required or hidden, on a per country basis.
But I don’t get why you would want a postcode field for a country that doesn’t have them. Would that not cause confusion to delivery services.
Thread Starter
shyton
(@shyton)
@lorro ,thank you ,it worked .I was trying to use a payment gateway that requires a postal code field because most payment gateway aren’t available in my country & I also won’t be making any deliveries because my site is craigslist ,it’s for advertising
Great! Glad to hear that lorro’s advice helped solve the issue.
I’ll mark this topic as solved for now. @shyton please feel free to open a new topic if you have any other questions.