Automattic\WooCommerce\StoreApi\Utilities
AgenticCheckoutUtils::clear_fulfillment_address
Clear fulfillment address from customer.
Method of the class: AgenticCheckoutUtils{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = AgenticCheckoutUtils::clear_fulfillment_address( $customer );
- $customer(WC_Customer) (required)
- Customer instance.
AgenticCheckoutUtils::clear_fulfillment_address() AgenticCheckoutUtils::clear fulfillment address code WC 10.4.3
public static function clear_fulfillment_address( $customer ) {
// Clear shipping address.
$customer->set_shipping_first_name( '' );
$customer->set_shipping_last_name( '' );
$customer->set_shipping_address_1( '' );
$customer->set_shipping_address_2( '' );
$customer->set_shipping_city( '' );
$customer->set_shipping_state( '' );
$customer->set_shipping_postcode( '' );
$customer->set_shipping_country( '' );
$customer->save();
}