WC_Cart_Session::persistent_cart_destroypublicWC 1.0

Delete the persistent cart permanently.

Method of the class: WC_Cart_Session{}

Hooks from the method

Returns

null. Nothing (null).

Usage

$WC_Cart_Session = new WC_Cart_Session();
$WC_Cart_Session->persistent_cart_destroy();

WC_Cart_Session::persistent_cart_destroy() code WC 10.5.0

public function persistent_cart_destroy() {
	/**
	 * Filters whether the persistent cart is enabled.
	 *
	 * @since 3.4.0
	 * @param bool $enabled Whether the persistent cart is enabled. Default true.
	 */
	if ( get_current_user_id() && apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
		delete_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id() );
	}
}