How to show correct item count in Magento 2 Checkout Order summary?

By default, app/design/Magento/Checkout/view/frontend/web/template/summary/cart-items.html file is being used
Or vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html

To overload this file, create file cart-items.html in your theme folder. Make sure you place the file in Magento_Checkout/web/template/summary/

Edit the line

<span data-bind="text: getCartLineItemsCount()"></span>

And replace it with

<span data-bind="text: getItemsQty()"></span>

Reference Files:

vendor/magento/module-checkout/view/frontend/web/js/view/summary/cart-items.js

https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html

https://github.com/magento/magento2/blob/2.2/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *