logomichael sumner
Contact

Woocommerce Checkout – Remove Validations That Are Still Appearing

WooCommerce comes with the ability to remove certain checkout validations through the use of a filter: woocommerce_checkout_fields. However what you can find out is that the method of removing validations through filters does not seem to work.

Another approach would be to go through a troubleshooting process of locating what actions are run on the checkout page of WooCommerce. From there you may be able to find actions that are run either through plugins or themes. You can make use of the plugin Query monitor to troubleshoot the issue.

Plugins Can Cause the Validation Issues Too

Recently have uncovered that there is a case of a plugin which is affecting the checkout validation. It is prioritised after WooCommerce, meaning that the WooCommerce filter is rendered useless in solving the issue.

Instead what can be done is to look at the actions that seem to affect the checkout validation experience, and locate the certain theme or plugin from which it has come from and read it through the called function.

In this particular use case, the plugin made use of an action. Therefore the solution would be to remove that action, after making sure that removing this action will not affect any other part of the website besides the checkout screen.

https://media1.giphy.com/media/Ze9y05jE2uHEJvB3QT/giphy.mp4

Action Hook Names Are Only Reference Points

“It is the location of the action hook, which determines where it is from.”

Interesting to note that the plugin made use of woocommerce_ as the prefix to its action. In fact, the action name was very generic that it almost looked like a WooCommerce action woocommerce_checkout_process

Take note that just because an action is similar in namedoes not mean that it is related to its plugin from which the similar name is taken from. You can think of a name as a reference point and nothing more than that. At times such as troubleshooting or debugging an issue, reference points can be misunderstood.

Therefore it is best to focus on the process which is to uncover the cause of the action and not assume that the name of the action will determine where it has come from. Put in a much simpler sense, it is the location of the action which determines where it is from.