Skip to content

Instantly share code, notes, and snippets.

@bhavik-kiri
Last active July 4, 2017 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhavik-kiri/5461a0af8d2a6ba7c7d19d742691d774 to your computer and use it in GitHub Desktop.
Save bhavik-kiri/5461a0af8d2a6ba7c7d19d742691d774 to your computer and use it in GitHub Desktop.
/**
* Save the persistent cart when the cart is updated.
*/
public function persistent_cart_update() {
update_user_meta( get_current_user_id(), '_woocommerce_persistent_cart',
array( 'cart' => WC()->session->get( 'cart' ),
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment