[Solved] How can I reliably reset the Woocommerce user selected shipping method in the cart during testing? [closed]


Have a look at the WooCommerce Shipping Class. Specifically, the reset_shipping() method.

You can reset the chosen shipping method that has been stored to the session via:

<?php unset( WC()->session->chosen_shipping_methods ); ?>

EDIT: A non-programmatic way to do this is to head to the WP Admin Dashboard and navigate to: WooCommerce --> System Status --> Tools and click “Clear all sessions” under the “Customer Sessions” section.

As the message states, this will delete all session data from the database for all customers. This includes live carts and chosen shipping methods (which, as you can see from my programmatic answer above, are included in the WooCommerce session).

8

solved How can I reliably reset the Woocommerce user selected shipping method in the cart during testing? [closed]