How can I set certain products to be shippable to only certain countries in Woocommerce? For example, during checkout, if Country is not USA, I want to show the message “We cannot deliver to your country.” Answer This can be done mainly with a custom function hooked in woocommerce_package_rates filter hook. The code below, will allow you to disable shipping,
Tag: checkout
Time loop for WooCommerce checkout select option from date picker input field
Input field one – delivery date has a datepicker attached. This fills in the required date by client. This field determines the delivery time options that are populated in the select field next to it. However the options are based on some rules Time slots are 30 mins intervals from 11am to 4pm. If the date chosen = today, delivery
Set WooCommerce order status when order is created from processing to pending
When a woocommerce order is created the status of the order is “processing”. I need to change the default order-status to “pending”. How can I achieve this? Answer The default order status is set by the payment method or the payment gateway. You could try to use this custom hooked function, but it will not work (as this hook is
Show SKU on cart and checkout pages in Woocommerce 3
I would like to display SKU on cart (Under product column ) and checkout page. I searched SO, but all answers are for old versions of WooCommerce and non of them is for 3.x. How can I show SKU on cart and checkout pages in Woocommerce 3? Answer 2021 Update You can do it with a custom unction hooked in
Remove WooCommerce checkout fields values
I’m trying to apply autocomplete=”off” on my WooCommerce checkout fields but it just doesn’t work. Is there a way to do that for the checkout form? I checked the docs and there’s nothing available …
Pre-filing checkout post code with a custom value
I have been using this custom function below in the previous versions of WooCommerce in order to pre-fill the City and ZIP code fields: It has been working great until the new WC updates. The city still works, but the default ZIP code field doesn’t seem to work anymore. It doesn’t automatically pre-polulate the value. Anything changed? Is there any
WooCommerce: Set country by default in checkout page
I am using WooCommerce in my Wordpress web site. The customers billing and shipping details are populated by default on checkout page. I want that the country will not be set by default. Instead it …