This is the most simplest way of adding a product to the cart with a custom price. The price is not changing, what am I doing wrong? You may have restricted the product or all products from being able to add the product to cart with a custom price. Or you have set a salt…
Using the filter cocart_is_allowed_to_override_price, you can run through a loop of product ID’s to return the statement as true for them only and return false for every other product your not checking. This will allow you to only override the price of those products and no other.
With the new update cart callback system in place you can now update the quantity of items in the cart in bulk. Simply pass the item key and the quantity for each item you wish to change and the quantity of those items will update.
Code snippet is included.
What you see when you return the cart contents is how WooCommerce formats the data. However, via the REST API this particular key is not a requirement.
As the only feature in CoCart that does not use the REST API, some developers requested that they have the option to disable it.