Warning: This function has been deprecated.
wc_load_persistent_cart( string $user_login, WP_User $user )
Load the persistent cart.
Description Description
Parameters Parameters
- $user_login
-
(Required) User login.
- $user
-
(Required) User data.
Source Source
File: includes/wc-cart-functions.php
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 ) { return; } $cart = WC()->session->cart; if ( empty( $cart ) || ! is_array( $cart ) || 0 === count( $cart ) ) { WC()->session->cart = $saved_cart['cart']; } }
Changelog Changelog
Version | Description |
---|---|
2.3 | Introduced. |