question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single item placed in cart after successful order placement doesn't show Price

See original GitHub issue

Describe the bug I’m not able to reproduce this bug every time, but 4-5 times I have encounter this bug, when I’m adding single 'Configurableitem to cart, sometimes, inCart` Screen price is not shown, but as soon as I add second item in cart or remove the same product and re-add again, price does show up.

Expected behavior Price should be shown in Cart for items, and at bottom total price in Cart should also be shown

Current Behavior In CartListItem price is 0 Also at bottom where total price in Cart is shown, is not showing

Steps to Reproduce (Not 100% accurate)

  1. Use my store url and access token
  2. Try adding single item in Cart from list in HomeScreen
  3. Open Cart screen
  4. Try removing item from cart add different product in Cart from HomeScreen

Screenshots error

Smartphone (please complete the following information):

  • Magento Version: [2.1.0]
  • Device: [Android Emulator Nexus 5X]
  • OS: [PIE]
  • Version [28]

Additional context I will try to find a way to reproduce this app, if not close this issue if afterwards

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dimaportenkocommented, Oct 9, 2019

The fix was on the Magento side

// app/code/Custom/Rest/Plugin/Model/Quote/Item/RepositoryPlugin.php

<?php
/**
 * Created by PhpStorm.
 * User: Dmytro Portenko
 * Date: 10/16/18
 * Time: 10:36 PM
 */
namespace Custom\Rest\Plugin\Model\Quote\Item;
class RepositoryPlugin
{
    /**
     * Quote repository.
     *
     * @var \Magento\Quote\Api\CartRepositoryInterface
     */
    protected $quoteRepository;
    /**
     * @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
     */
    public function __construct(
        \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
    ) {
        $this->quoteRepository = $quoteRepository;
    }
    public function beforeSave(
        \Magento\Quote\Model\Quote\Item\Repository $subject,
        \Magento\Quote\Api\Data\CartItemInterface $cartItem
    )
    {
        $cartId = $cartItem->getQuoteId();
        $quote = $this->quoteRepository->getActive($cartId);
        $quote->getShippingAddress();
    }
}

// app/code/Custom/Rest/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Quote\Model\Quote\Item\Repository">
        <plugin sortOrder="1" name="customRestRepository" type="Custom\Rest\Plugin\Model\Quote\Item\RepositoryPlugin"/>
    </type>
</config>
1reaction
dimaportenkocommented, Oct 9, 2019

I found a similar issue from the project I worked on before, the reproducing steps were

  1. Complete an order
  2. Add one product to the cart.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sale Prices not carrying through to cart or checkout
Hello,. After the update it seems my sale prices display on the product catalog and single product page fine, but they do not...
Read more >
Shopping Cart Prices - Amazon Customer Service
Placing an item in your cart doesn't reserve the price shown at that time. The price of ... You're not charged until your...
Read more >
Adding an Item to a Shopping Cart: Provide Clear, Persistent ...
To confirm that an item has been added to cart, show a number badge and a confirmation popover or page, and change the...
Read more >
10 common problems with order picking...and how to solve them
Orders that are only half-picked are generally put back if the remaining items are not available, and fulfilment is postponed. Doing this leads...
Read more >
Managing Orders - WooCommerce
Order statuses let you know how far along the order is, starting with “Pending payment” and ending with “Completed.” The following order statuses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found