Skip to content

Module_Checkout: minicart.phtml knockout enhancement for summary_count label ( item or items ) #32450

Open
@ZIPITRO

Description

@ZIPITRO

Description

Adding one item to your cart gives you 1 items in cart
Adding more items in your cart it gives 2 items in cart

Issue 29920(closed) didn't fix the label.

By enhancing the KO* code in minicart.phtml you can have 1 item or 2 items

Expected behavior

By enhancing the KO* a bit you will have this result

  • When adding one item to your cart gives you 1 item in cart
  • When adding more items in your cart it gives 2 items in cart

Benefits

This will improve the look and feel of your mini-cart by showing it in a more correct way.

Additional information

Please consider replacing the current KO* code with:

<!-- ko if: getCartParam('summary_count') == 1 --> <!-- ko text: getCartParam('summary_count') --><!-- /ko --> <!-- ko i18n: 'item' --><!-- /ko --> <!-- /ko --> <!-- ko if: getCartParam('summary_count') > 1 --> <!-- ko text: getCartParam("summary_count") --><!-- /ko --> <!-- ko i18n: "items" --><!-- /ko --> <!-- /ko -->

** KO = knockout.js**
File : vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml
Magento Version 2.4.2(CE)

#29920(closed)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Ready for Grooming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions