Timeline for Magento 2 - Programatically adding product to cart adds item with price of zero
Current License: CC BY-SA 4.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 6 at 8:24 | answer | added | MrPaulsky | timeline score: 0 | |
Nov 24, 2020 at 19:20 | answer | added | Evgeni Obukhovsky | timeline score: 2 | |
Jun 23, 2020 at 17:28 | comment | added | purna gattu |
Hi , I am also facing same issue, while adding products to quote from REST API. Loading quote using \Magento\Quote\Api\CartRepositoryInterface . After adding successfully to cart, the last product showing zero totals. Thanks in Advance
|
|
May 8, 2020 at 23:02 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Dec 28, 2019 at 6:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Aug 24, 2019 at 12:00 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 31, 2018 at 14:04 | comment | added | user10170135 |
@RohanHapani - You are correct, however I've noticed that the price comes out as zero when doing $this->response->setRedirect($this->getUrl('checkout'))->send(); after (which refreshes the page). If I manually refresh the page after it loads, the price appears. Is there a better way instead of setRedirect which will ensure the totals are updated upon refresh?
|
|
Oct 30, 2018 at 9:47 | answer | added | Kushal Dani | timeline score: 1 | |
Oct 30, 2018 at 9:31 | comment | added | Rohan Hapani | But, that code is working properly. I tested in latest version 2.2.6 also. | |
Oct 30, 2018 at 9:29 | comment | added | user10170135 |
@RohanHapani, thanks for the suggestion. Yes - however, \Magento\Checkout\Model\Cart is deprecated, says to use \Magento\Quote\Model\Quote instead, but doesn't appear to add the price to the item correctly.
|
|
Oct 30, 2018 at 9:22 | comment | added | Rohan Hapani | Did you try this answer : magento.stackexchange.com/a/243628/51810 | |
Oct 30, 2018 at 9:20 | review | First posts | |||
Oct 30, 2018 at 9:21 | |||||
Oct 30, 2018 at 9:18 | history | asked | user10170135 | CC BY-SA 4.0 |