• Resolved deanrozen

    (@deanrozen)


    Hi,
    By default, Woocommerce saves the billing and shipping address on the checkout page, for future orders.

    I am searching for a way to prevent Woocommerce from saving the values in the shipping address. So all the fields in the shipping address should be empty.

    I found some partial solution:

    add_filter('woocommerce_checkout_get_value','__return_empty_string',10);
    

    It only works for the first step, and the second step (shipping fields) stays with contents.

    Is there any option to hide also the second step?
    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author SilkyPress

    (@diana_burduja)

    You can remove a step with the following PHP snippet, which you could add to the child theme’s functions.php file:

    if ( ! function_exists( 'wmsc_delete_shipping_step' ) ) {
    	function wmsc_delete_shipping_step( $steps ) {
    	    unset( $steps['shipping'] );
    	    return $steps;
    	}
    }
    add_filter( 'wpmc_modify_steps', 'wmsc_delete_shipping_step' );

    Note that I didn’t check how the snippet works with the woocommerce_checkout_get_value filter or if the shipping address is empty. Also the validation when clicking the “Place Order” button might be influenced by the changes you’re trying out. The snippet will only remove the step, along with the checkout fields.

Viewing 1 replies (of 1 total)
  • The topic ‘stop save shipping fields for future orders’ is closed to new replies.