1

After clear(removing all products) shopping cart shows nothing, but still show count of products value on minicart.

Shopping cart still show number

tried to create sections.xml and flush cart after click 'distribution/cart/clear' route:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="distribution/cart/clear">
        <section name="cart"/>
        <section name="checkout-data"/>
    </action>
</config>

but have fail.

here is link to flush cart on cart-info.phtml:

<li class="shopping-choise-item"><a id="clear-cart"  href="<?php echo $block->getClearCartUrl() ?>"><?= 'Empty cart' ?></a></li>
0

I've faced same issue on 2.2.6. The issue is fixed by upgrading the Magento version to the latest version 2.2.9.

You can upgrade your Magento version by run below commands from your terminal.

php bin/magento maintenance:enable
composer require magento/product-community-edition 2.2.9 --no-update
composer update
rm -rf var/ generated/
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento maintenance:disable

After upgrade, check your Magento version with the following command:

php bin/magento --version

Hope it helps!!!

  • do we have an issue on github? – Denissio Inkognito Sep 4 at 8:15
  • I didn't check this, but the Magento upgrade have solved my problem. – Sumit Sep 4 at 8:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.