add cart for role customer not showing in cart
-
Customer basic auth has done in postman(with customer userId and password)
1.add cart via https://localhost/wp/wp-json/cocart/v1/add-item post request
successful
{
“key”: “37693cfc748049e45d87b8c7d8b9aacd”,
“product_id”: 23,
“variation_id”: 0,
“variation”: [],
“quantity”: 1,
“data”: {},
“data_hash”: “b5c1d5ca8bae6d4896cf1807cdf763f0”,
“line_tax_data”: {
“subtotal”: [],
“total”: []
},
“line_subtotal”: 1000,
“line_subtotal_tax”: 0,
“line_total”: 1000,
“line_tax”: 0
}2.get https://localhost/wp/wp-json/cocart/v1/get-cart returns
{
“37693cfc748049e45d87b8c7d8b9aacd”: {
“key”: “37693cfc748049e45d87b8c7d8b9aacd”,
“product_id”: 23,
“variation_id”: 0,
“variation”: [],
“quantity”: 1,
“data_hash”: “b5c1d5ca8bae6d4896cf1807cdf763f0”,
“line_tax_data”: {
“subtotal”: [],
“total”: []
},
“line_subtotal”: 1000,
“line_subtotal_tax”: 0,
“line_total”: 1000,
“line_tax”: 0,
“data”: {},
“product_name”: “A3 Premium Quality”,
“product_title”: “A3 Premium Quality”,
“product_price”: “$1,000.00”
}
}`
3. login with customer https://127.0.0.1/wp/cart/
-not showing cart.4. login with admin – cart can be seen.
I tried with creating another user role customer but the cart is showing only in admin login, not for any customer login.
I would like to use this endpoint in the react-native app. In-app with woocommerce rest API successfully created orders on the website.
Please help me to resolve this.
Thanks
RupamNote: Just I tried in postman with no auth for getting cart (shows cart item) and add cart(successful add).so by default its retrieving or adding a cart for the admin user. So I think, Please let me know how to do authentication for the user.
- The topic ‘add cart for role customer not showing in cart’ is closed to new replies.