woocommerce_persistent_cart_enabled

woocommerce_persistent_cart_enabled

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.5.1

apply_filters('woocommerce_persistent_cart_enabled') is found 4 times:

  • /includes/class-wc-cart-session.php line 357
    	/**
    	 * Save the persistent cart when the cart is updated.
    	 */
    	public function persistent_cart_update() {
    		if ( get_current_user_id() && apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
    			update_user_meta(
    				get_current_user_id(),
    				'_woocommerce_persistent_cart_' . get_current_blog_id(),
    				array(
    					'cart' => $this->get_cart_for_session(),
    				)
    
  • /includes/class-wc-cart-session.php line 372
    	/**
    	 * Delete the persistent cart permanently.
    	 */
    	public function persistent_cart_destroy() {
    		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() );
    		}
    	}
    
    	/**
    	 * Set cart hash cookie and items in cart if not already set.
    
  • /includes/class-wc-cart-session.php line 419
    	 */
    	private function get_saved_cart() {
    		$saved_cart = array();
    
    		if ( apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
    			$saved_cart_meta = get_user_meta( get_current_user_id(), '_woocommerce_persistent_cart_' . get_current_blog_id(), true );
    
    			if ( isset( $saved_cart_meta['cart'] ) ) {
    				$saved_cart = array_filter( (array) $saved_cart_meta['cart'] );
    			}
    		}
    
  • /includes/wc-cart-functions.php line 50
     * @param WP_User $user       User data.
     * @deprecated 2.3
     */
    function wc_load_persistent_cart( $user_login, $user ) {
    	if ( ! $user || ! apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
    		return;
    	}
    
    	$saved_cart = get_user_meta( $user->ID, '_woocommerce_persistent_cart_' . get_current_blog_id(), true );
    
    	if ( ! $saved_cart ) {