Products are not getting removed from my cart when I use the delete call on the CoCart API. Here are my steps.
Here is the cart hash and key from when I get /wp-json/cocart/v2/cart. (I do have products in my cart for reference that do show up in the get request)
And here is the response I get when I delete a product
So i do have products in my cart, but the response when I try to delete it says i don’t. But the other functions like update line item do work. What is going on here?
]]>Hi, I’m developing headless website and i need to validate cart items changing qty (changing the quantity in cart). So i need to add property stock status and stock quantity to returned cart item. I found this filter in documentation on github “cocart_cart_contents”, using which I’m supposed to do this. But nothing changes. Can you help me and say what i have to do?
“https://github.com/co-cart/cocart-api-reference-docs/blob/master/source/includes/cocart-v2/_filters.md” – this is the link where i looked for filters
Hi! I read a lot about your plugin, but I’m still not sure whether is a way to convert a cart to an actual order. Should I make a woocommerce rest api request with full details to create an order, and cart is just for pre-calculation, and don’t have connection to an order?
]]>Hi Team i am trying to update item quantity for guest users . but i am not able to update . can you please help me out.
api end point: https://agivant.wpenginepowered.com/wp-json/cocart/v2/cart/item/
body :
{
“quantity”: “12”,
“item_key”: “182be0c5cdcd5072bb1864cdee4d3d6e”,
“cart_key”: “ff904c79fec60d7461ea0f03ab0b49”,
“return_cart”: true
}
Response
{
“code”: “cocart_item_not_in_cart”,
“message”: “Item specified does not exist in cart.”,
“data”: {
“status”: 404
}
}
]]>Hi, Yesterday I updated the cocart plugin to the latest version (from version 3.12.0).
After updating the plugin any request to modify a cart gets a “cors no ‘access-control-allow-origin’ header is present” error. I can still get the cart with no problem, but I just can’t modify.
After rolling back to V3 it works as expected. I was wondering if there way a change I needed to make on my side to get V4 to work correctly or if this was a bug.
Thanks
]]>I have added item in the cart and it had returned both the cart_hash and cart_key
But when i get the cart with cart_key, there are no items in the cart but it shows the customer information
Need urgent help in this matter
My cocart cart isn’t clearing when I order. Here are my steps.
And then when I go back to the front end after ordering, the cart is still full, even though it was populated by cocart. What did I do wrong?
]]>I am using the CoCart REST API V2 for my e-commerce site and have encountered an issue. My site requires the ability to filter products by brand name (e.g., ?brand=Lafarge
), but the current API does not provide a parameter for this.
Could you advise on what I can do to address this issue?
Thank you for your assistance.
Best regards,
]]>List all products end point has stopped working after upgrading to new version
We are using this end point to fetch products by category and has stopped working
Example
CURLOPT_URL => “https://example.com/wp-json/cocart/v1/products?category=category-slug”
I have also tried passing the category ID but does not work
however if I don’t put the category then it does list out all the products.
Thanks in advance
]]>I’m building my headless woocommerce site with CoCart. The only snag is that I need to use woocommerce’s checkout. I can’t build my own on the headless side of my site. So I need to redirect from my custom front end to the woocommerce checkout. The issue here is that the cart is authenticated so I would need to be logged into the wordpress account (I’m using the wordpress api so it’s the same login) in order for the cart to show up in the checkout. Currently it says I have no items in my checkout because the user isn’t logged into the wordpress site. At the very least is there some way to load the cart items into the guest checkout?
]]>Hi Team,
I am trying to add a product with variation to Cart using the below but get a 404 error.
curl --location 'https://store.stokkur.is/wp-json/cocart/v2/cart/add-item' \
--header 'Content-Type: application/json' \
--data '{
"id" : "836",
"quantity" : "1",
"variation": {
"attribute_upph?e": "kr 5.000"
}
}'
Response:
{
"code": "cocart_no_variation_found",
"message": "No matching variation found.",
"data": {
"status": 404
}
}
Below is the Product response from Cocart API. As per the response below the name of the attribute is “attribute_upph?e“. I am using the same the name in Add item to cart request. But I get a 404 error. Can you please take a look?
curl --location 'https://store.stokkur.is/wp-json/cocart/v1/products/836'
{
"id": 836,
"name": "Gjafabréf",
"slug": "gjafabref",
"permalink": "https://store.stokkur.is/product/gjafabref/",
"date_created": "2024-03-12T14:00:58",
"date_created_gmt": "2024-03-12T14:00:58",
"date_modified": "2024-03-12T14:04:31",
"date_modified_gmt": "2024-03-12T14:04:31",
"type": "variable",
"featured": false,
"catalog_visibility": "visible",
"description": "",
"short_description": "",
"sku": "",
"price": "5,000.00kr.",
"regular_price": "0.00kr.",
"sale_price": "",
"date_on_sale_from": null,
"date_on_sale_from_gmt": null,
"date_on_sale_to": null,
"date_on_sale_to_gmt": null,
"on_sale": false,
"purchasable": true,
"total_sales": 0,
"virtual": false,
"downloadable": false,
"external_url": "",
"button_text": "",
"manage_stock": false,
"stock_quantity": null,
"has_options": true,
"in_stock": true,
"stock_status": "instock",
"backorders": "no",
"backorders_allowed": false,
"backordered": false,
"low_stock_amount": "",
"sold_individually": false,
"weight": {
"value": "",
"unit": "kg"
},
"dimensions": {
"length": "",
"width": "",
"height": "",
"unit": "cm"
},
"shipping_required": true,
"reviews_allowed": true,
"average_rating": "0",
"rating_count": 0,
"review_count": 0,
"rating_html": "",
"reviews": [],
"related_ids": [],
"upsell_ids": [],
"cross_sell_ids": [],
"parent_id": 0,
"categories": [
{
"id": 2433,
"name": "Uncategorised",
"slug": "uncategorised"
}
],
"tags": [],
"images": [
{
"id": 841,
"date_created": "2024-03-12T14:02:00",
"date_created_gmt": "2024-03-12T14:02:00",
"date_modified": "2024-03-12T14:02:00",
"date_modified_gmt": "2024-03-12T14:02:00",
"src": {
"thumbnail": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=150%2C150&ssl=1",
"medium": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=300%2C200&ssl=1",
"medium_large": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"large": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"1536x1536": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"2048x2048": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"trp-custom-language-flag": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=18%2C12&ssl=1",
"newspack-article-block-landscape-large": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=612%2C408&ssl=1",
"newspack-article-block-portrait-large": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=612%2C408&ssl=1",
"newspack-article-block-square-large": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=612%2C408&ssl=1",
"newspack-article-block-landscape-medium": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=612%2C408&ssl=1",
"newspack-article-block-portrait-medium": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=600%2C408&ssl=1",
"newspack-article-block-square-medium": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=612%2C408&ssl=1",
"newspack-article-block-landscape-intermediate": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=600%2C408&ssl=1",
"newspack-article-block-portrait-intermediate": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=450%2C408&ssl=1",
"newspack-article-block-square-intermediate": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=600%2C408&ssl=1",
"newspack-article-block-landscape-small": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=400%2C300&ssl=1",
"newspack-article-block-portrait-small": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=300%2C400&ssl=1",
"newspack-article-block-square-small": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=400%2C400&ssl=1",
"newspack-article-block-landscape-tiny": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=200%2C150&ssl=1",
"newspack-article-block-portrait-tiny": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=150%2C200&ssl=1",
"newspack-article-block-square-tiny": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=200%2C200&ssl=1",
"newspack-article-block-uncropped": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"post-thumbnail": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"woocommerce_thumbnail": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=350%2C350&ssl=1",
"woocommerce_single": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"woocommerce_gallery_thumbnail": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=100%2C100&ssl=1",
"variation_swatches_image_size": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=50%2C50&ssl=1",
"variation_swatches_tooltip_size": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?resize=100%2C100&ssl=1",
"full": "https://i0.wp.com/store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg?fit=612%2C408&ssl=1",
"custom": "https://store.stokkur.is/wp-content/uploads/2024/03/istockphoto-1361203739-612x612-1.jpg"
},
"name": "istockphoto-1361203739-612×612",
"alt": "",
"position": 0
}
],
"attributes": {
"attribute_upph?e": {
"id": 0,
"name": "Upph?e",
"position": 0,
"is_attribute_visible": true,
"used_for_variation": true,
"options": [
"kr 5.000",
"kr 10.000",
"kr 15.000",
"kr 20.000"
]
}
},
"default_attributes": [],
"variations": {
"837": {
"id": 837
},
"838": {
"id": 838
},
"839": {
"id": 839
},
"840": {
"id": 840
}
},
"grouped_products": [],
"menu_order": 0,
"meta_data": [
{
"id": 16930,
"key": "_created_via",
"value": "post-new"
},
{
"id": 16931,
"key": "_last_editor_used_jetpack",
"value": "classic-editor"
},
{
"id": 16951,
"key": "hsTariffNumber",
"value": ""
},
{
"id": 16952,
"key": "descriptionOfContents",
"value": ""
},
{
"id": 16953,
"key": "_mstore_video_url",
"value": ""
},
{
"id": 16954,
"key": "_mstore_video_title",
"value": ""
},
{
"id": 16955,
"key": "_mstore_video_description",
"value": ""
},
{
"id": 16956,
"key": "_wpas_done_all",
"value": "1"
}
],
"add_to_cart": {
"text": "Select options",
"description": "Select options for “Gjafabréf”"
},
"jetpack_publicize_connections": [],
"jetpack_likes_enabled": true,
"jetpack_sharing_enabled": true,
"jetpack-related-posts": [],
"_links": {
"self": [
{
"permalink": "https://store.stokkur.is/product/gjafabref/",
"href": "https://store.stokkur.is/wp-json/cocart/v1/products/836"
}
],
"collection": [
{
"permalink": "https://store.stokkur.is",
"href": "https://store.stokkur.is/wp-json/cocart/v1/products"
}
],
"variations": [
{
"permalink": "https://store.stokkur.is/product/gjafabref/?attribute_upphaed=kr+5.000",
"href": "https://store.stokkur.is/wp-json/cocart/v1/products/836/variations/837"
},
{
"permalink": "https://store.stokkur.is/product/gjafabref/?attribute_upphaed=kr+10.000",
"href": "https://store.stokkur.is/wp-json/cocart/v1/products/836/variations/838"
},
{
"permalink": "https://store.stokkur.is/product/gjafabref/?attribute_upphaed=kr+15.000",
"href": "https://store.stokkur.is/wp-json/cocart/v1/products/836/variations/839"
},
{
"permalink": "https://store.stokkur.is/product/gjafabref/?attribute_upphaed=kr+20.000",
"href": "https://store.stokkur.is/wp-json/cocart/v1/products/836/variations/840"
}
]
}
}
]]>
Hello, I have installed this plugin last week and since then facing a peculiar issue. When we add products to the cart, after about 4 products, if I am adding a 5th product, the 4 products are lost from the cart.
If I deactivate this plugin, the issue is no longer observed.
Can you help with this please?
]]>Hi there,
We are having issues when the following happens.
1) a guest does not log in but adds items to the cart.
2) Guest closes the webpage
3) Guest comes back, cart identifies guest via guest cookie and cart fills up with old items that were left in the cart with the previous session.
This is where the issue arises. When trying to clear cart/add to cart we get a Blocked CORS error.
Access to XMLHttpRequest at ‘https://api.fairviewmarketplace.co.za/wp-json/cocart/v2/cart/clear?cart_key=1’ from origin ‘https://fairviewmarketplace.co.za’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Would it be possible to clear all guest cookies (sessions) as soon as they close the website. (no persistent cart) Only logged in users should have carts saved.
We also experience no errors when the guest logs in.
Please assist!
Hi Team,
There is a mismatch in the attribute field name for the below APIs :
GET https://stokkur.wpcomstaging.com/wp-json/cocart/v1/products/406/variations
Response Snippet:
"attributes": {
"attribute_malad": {
"id": 0,
"name": "Malae?",
"option": "Veldu m?guleika"
}
},
GET https://stokkur.wpcomstaging.com/wp-json/cocart/v1/products/406
Response Snippet:
"attributes": {
"attribute_malae?": {
"id": 0,
"name": "Malae?",
"position": 0,
"is_attribute_visible": true,
"used_for_variation": true,
"options": [
"Nei - Baunir",
"Já - Filter",
"Já - Mokkakanna",
"Já - Pressukanna",
"Já - Aeropress",
"Já - Espresso"
]
}
}
As you can see in the above snippets, “attribute_malad” and “attribute_malae?” are different. Can you please check why there is a mismatch?
]]>This API is not working, my server is PHP version 8.1
curl –location –request DELETE ‘https://distrobo.com/wp-json/cocart/v2/cart/item/b3e3e393c77e35a4a3f3cbd1e429b5dc’ \
–header ‘Content-Type: application/json’ \
–header ‘Authorization: Basic eHc3eG5hRVQ6Y0tVYVNBZU9lQnR2Q1ZJNHopUUttSlJy’
I am building an App for Guest customers to purchase products.
By default, when I am creating and adding items to a Cart (co-cart), a default Country and State (or province) is determined (I am not sure how it is determined).
Is there a way for me to update the Shipping and Billing address of the Cart for a Guest customer (so no login or authentication), so that shipping fees and taxes get updated?
I’ve tried to use different endpoints /session, /cart/update, etc. but I didn’t found any relevant documentation.
Thanks!
]]>i have the CoCart – CORS Support plugin installed and activated on my wordpress but am still i having cors error
when i make a request to the cocart api i noticed that my Access-Control-Allow-Origin return no value
Hi, I am encountering a potential conflict between Cocart and WC Social Login. I post here because the issue seems to be related to Cocart_Session_handler’s behaviour.
The social login feature requires retrieving data in $session["config"]["config"]
to function. However, when Cocart is enabled the value is always not set and, because of that, the front end always show a “Provider Authentication Error”.
I tried logging the output when at the position where the error is thrown.
When Cocart is enabled:
https://drive.google.com/file/d/18wmMCOiyKQ1miaKdtuJm9_nTknxv4CEd/view?usp=sharing
When Cocart is disabled:
https://drive.google.com/file/d/1Qksbq_A8nLPUbOy0J8v7WwtbMAwZP-ZL/view?usp=sharing
Other than $session["config"]
is not set when Cocart is enabled, I noticed the _customer_id
in the session handler also refresh every time I run the same social auth url, but it stay the same when Cocart is disabled.
I’ve tried adding cart items using Postman and even though Postman returns successfully, when I inspect the front end of the staging site and endpoints, I am not seeing the data I added via Postman.
My endpoint for viewing the cart data: ‘https://staging.example.example.co.uk/wp-json/cocart/v2/cart/items/’ is returning only the cart item I added manually via the front end.
My endpoint for adding to cart: https://staging.example.example.co.uk/wp-json/cocart/v2/cart/add-item/
JSON Data being sent:
{ "id": "10494", // Product ID for the "large" variation "quantity": "1", "item_data": { "pa_name_here": "amesviapostman", "pa_number_print": "10" }, "variation": { "attribute_pa_size": "large", // Customize this based on your product's attributes "attribute_pa_add-name-and-number": "yes-add-3-99", // Customize this based on your product's attributes "attribute_pa_arm-patches-to-be-added": "no-thank-you" // Customize this based on your product's attributes } }
Question
Do you know why the data I sent using Postman is not being added to the cart endpoint or front end? I can only assume it’s something to so with session cookies, but I don’t know why or how to remedy this.
My ultimate goal is to send cart data from one site to another. I realise batch sending isn’t possible right now, so I am going to use a workaround to send one at a time until it is possible.
Hello,
A Cocart Pro user here.
I’m trying to clear the cart after a successful order, I’m calling this endpoint: /wp-json/cocart/v2/cart/clear
in the response it shows an empty cart, but when I fire a get request for with the same user I got the same cart as before. What could be the issue here?
thanks!
]]>Hi, I am using Cocart V1, when i login in my wordpress application with a user, cart works fine. But when i login again with different user/users some other cart data is getting show. automatically cokkiees started to show. Some new items automatically added in the cart, when trying to delete from UI, some new items are getting added same time. Database started automatic entries in cart table. . please help.
]]>Hi, we have a Woocommerce website that is integrated with CoCart lite plugin.
Things were working fine until yesterday. But suddenly, the Add to Cart functionality was broken.
The following end point is giving us 404 No Route was found error.
https://www.lehmann-sa.com/wp-json/cocart/v1/add-item
Here is the error message to be precise:
{"code":"rest_no_route","message":"No route was found matching the URL and request method.","data":{"status":404}}
The other end points are working fine.
For example, this end point is working as expected:
https://www.lehmann-sa.com/wp-json/cocart/v1/get-cart
All the plugins are up to date including CoCart and Woocommerce. We tried reverting back to an older version of CoCart, but no luck.
Here is the Javascript Code that used to work till yesterday:
function rest_api_cart() {
jQuery(document).off(
"click",
".product:not(.product-type-external) .single_add_to_cart_button:not(.add-to-cart-button-reject)"
);
jQuery(document).on(
"click",
".product:not(.product-type-external) .single_add_to_cart_button:not(.add-to-cart-button-reject)",
function (e) {
e.preventDefault();
var _this = jQuery(this);
var _product_id = _this.val();
var _form = _this.closest("form");
var _form_data = _form.serialize();
if (_product_id != "") {
var _data = "add-to-cart=" + _product_id + "&" + _form_data;
} else {
var _data = _form_data;
}
if (
_this.is(".disabled") ||
_this.is(".wc-variation-selection-needed")
) {
return false;
}
_data = "return_cart=false&" + _data;
jQuery("body,html").toggleClass("minicart-canvas-open");
jQuery(".nexio-minicart").addClass("is-adding-to-cart");
var atcUrl = "https://www.lehmann-sa.com/wp-json/cocart/v1/add-item";
jQuery.ajax({
type: "POST",
url: atcUrl,
data: _data,
dataType: "html",
cache: false,
headers: { "cache-control": "no-cache" },
success: function () {
jQuery(document.body).trigger("wc_fragment_refresh");
jQuery(document).on("added_to_cart", function () {
jQuery(".nexio-minicart").removeClass(
"is-adding-to-cart"
);
});
jQuery(".single_add_to_cart_button-clone")
.removeClass("loading")
.addClass("added");
},
});
}
);
}
Please let us know what you think. Any direction to fixing this problem would be helpful.
]]>Hi, I am having a problem searching for products using the cocart api.
<my-site>/wp-json/cocart/v2/products?search=test
This request returns all my products not filtered by the search term.
All the other available query parameters I have tried seem to be working correctly. Just the search is not.
Thanks.
]]>Hello.
I’ve been going in circles with this issue.
we are building a ecommerce site using Nuxt, WordPress, woocommerce and cocart. Everything thing works fine when a guest adds items to a cart. Everything works when when I add an item to the cart as a registered user (authenticate with email and password). The issues start when registered customers try to checkout. If that user logouts out and in again they lost all the sessions and cookies.
How do I login customers from the nuxt side and how do I pass this session to WordPress, and woocommerce to get the user cart. If the user logs in on the checkout page everything works as intended, but we want the user to login from Nuxt.
Would appreciate any feedback.
kind regards
Darren
]]>Hello,
I’m using the following coCart API to apply a coupon “A15”
POST {{API_URL}}/cocart/v1/coupon?cart_key=<cart_key>
“A15” is configured to provide a 15% discount and have a limit of 3 items. When the coupon is applied to a cart that contains a single product “P1” with quantity 5, the discount got applied to 3 items and the other 2 items are charged full price. Following is a sample request & response of GET cart API after coupon is applied
GET {{API_URL}}/cocart/v2/cart?lang=en&cart_key=<cart_key>
{
"cart_hash": "b4ccd078bb23c75da43f8f0753347277",
"cart_key": "fe090bb24ef98f119d6538ca391e9261",
"items": [
{
"item_key": "4c2342c6b1ba65d084131c87e8b18c5d",
"id": 217,
"name": "P1",
"title": "P1",
"price": "25913333",
"quantity": {
"value": 5,
"min_purchase": 1,
"max_purchase": -1
},
"totals": {
"subtotal": "129566667",
"subtotal_tax": 64.783333333333,
"total": 1295.666666666667,
"tax": 64.783333333333
},
"slug": "p1",
"meta": {
"product_type": "simple",
"sku": "",
"dimensions": {
"length": "",
"width": "",
"height": "",
"unit": "cm"
},
"weight": 0,
"variation": []
},
"backorders": "",
"cart_item_data": {
"date": "2021-01-03",
"uuid": "0d18e064-01f7-465a-9cd5-30f291e48d94",
"nyp": 299
}
}
],
"item_count": 5,
"items_weight": 0,
"coupons": [
{
"coupon": "A15",
"label": "Coupon: A15",
"saving": "-0",
"saving_html": "-USD0.00000"
}
],
"needs_payment": true,
"needs_shipping": false,
"shipping": [],
"fees": [],
"taxes": {
"label": "VAT",
"total": "6478333"
},
"totals": {
"subtotal": "129566667",
"subtotal_tax": "6478333",
"fee_total": "0",
"fee_tax": "0",
"discount_total": "0",
"discount_tax": "0",
"shipping_total": "0",
"shipping_tax": "0",
"total": "136045000",
"total_tax": "6478333"
},
"removed_items": [],
"cross_sells": [],
"notices": {
"success": [
"Coupon code applied successfully."
]
}
}
The original price of “P1” is 299. After applying the coupon to the cart of 5 items, the above response returned a total of “1360.45”. If you do the math you’ll understand that the discount was applied to 3 items & 2 items got charged full price.
Is there any way to have the GET cart response indicate that the discount got applied to 3 items and 2 items charged full price?
]]>Are there any plans to add a “Multiple products at once” feature? Maybe in PRO version?
]]>I am facing issues with cocart when i install the yoast seo plugin it cocart is stopped working i dont know what to do please check it.
]]>I’m not able to add to cart via CoCart api through Gravity nested form webhook. In logged in user I’m getting success response from api when webhook trigger but cart was empty every time.
Please check screenshot : https://uploadnow.io/files/QBdyDVB
Getting woocommerce error log from cocart
2023-04-11T05:34:31+00:00 DEBUG
====CoCart Lite Version: 3.8.1====
====Start Log April 11, 2023 @ 1:34 am====
cocart_return_empty_cart is deprecated since version 3.0.0! Use cocart_empty_cart instead. But only if you are using API v2.
====End Log====
2023-04-11T05:34:31+00:00 DEBUG
====CoCart Lite Version: 3.8.1====
====Start Log April 11, 2023 @ 1:34 am====
cocart_ok_to_add_response is deprecated since version 3.0.0 with no alternative available. This filter is no longer used in the API.
====End Log====
2023-04-11T05:34:31+00:00 DEBUG
====CoCart Lite Version: 3.8.1====
====Start Log April 11, 2023 @ 1:34 am====
cocart_ok_to_add is deprecated since version 3.0.0 with no alternative available. This filter is no longer used in the API.
====End Log====
Let me know what is the issue.
]]>Hello,
I am trying to use this plugin to manage cart items via API.
I cannot seem to add products to a cart. It keeps returning an error:
data: {
????code: ‘rest_missing_callback_param’,
????message: ‘Missing parameters: id’,
????data: { status: 400, params: [Array] }
??}
Id is passed with the request.
Any ideas?
Best regards, Alen
Currently, co-cart adds the product to the cart via iPhone but when I go back to the website and check the cart page it removes the products from the cart so can you please check it out and resolve the problem for me?
]]>