0

I am using following API for Add product to cart.

http://{{magento2}}/rest/V1/carts/mine/items

But i want to add custom price to cart. Anyone have idea about that ?

$quote = $this->quoteRepository->getActive($cartItem['quote_id']);
$quoteItems = $quote->getItems();
$quoteItems[] = $cartItem;
$quote->setItems($quoteItems);
$this->quoteRepository->save($quote);
$quote->collectTotals();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.