Only clear persistent cart if persistent cart is enabled

This commit is contained in:
Mike Jolley 2019-03-22 11:44:27 +00:00
parent aecb0fd4fc
commit 59c51fbebe
1 changed files with 1 additions and 1 deletions

View File

@ -253,7 +253,7 @@ final class WC_Cart_Session {
* Delete the persistent cart permanently. * Delete the persistent cart permanently.
*/ */
public function persistent_cart_destroy() { public function persistent_cart_destroy() {
if ( get_current_user_id() ) { 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() ); delete_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id() );
} }
} }