WooCommerce – How to maintain the state of “Ship to a different address” Checkbox

On WooCommerce checkout page if you tick the “Ship to a different address” checkbox, then redirect to some other page maybe to add some more products to the cart, and then come back again to the checkout page, you would notice that “Ship to a different address” checkbox resets to its default state.

You can use the below code snippet to make WooCommerce remember the state of that checkbox.

PHP

Just add this code snippet to the functions.php of your child theme or use the Code snippet plugin.

Moreover, WordPress Hooks and Filters API is also something I can’t express enough gratitude for. You can do so many amazing things using actions while maintaining backward compatibility.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up Next:

WooCommerce - How to offer a free product with the purchase of certain products

WooCommerce - How to offer a free product with the purchase of certain products