Rest API to store products in cart based on the user id in woocommerce
问题 Only related reference for the same I found with accepted by few people is the below mentioned code but there is no session stored in options table with the following key '_wc_session_'.$user_id function add_products_programmatically($user_id) { // Get the current session data and saved cart $wc_session_data = get_option('_wc_session_'.$user_id); // Get the persistent cart $full_user_meta = get_user_meta($user_id,'_woocommerce_persistent_cart', true); // Create a new WC_Cart instance and add