Skip to content

Instantly share code, notes, and snippets.

@bhavik-kiri
Last active July 4, 2017 06:53
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/e72ac19c2d921e579f617fa294941ef7 to your computer and use it in GitHub Desktop.
Save bhavik-kiri/e72ac19c2d921e579f617fa294941ef7 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_' . get_current_blog_id(),
array( 'cart' => WC()->session->get( 'cart' ),
) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment