1

How to change the text "You have no items in your shopping cart." in mini cart in Magento 2

art

1
  • i sure about this text is come from the content.html file Commented Jun 28, 2019 at 11:12

3 Answers 3

1

Please check with below path.

app/design/frontend/Magento/theme-name/Magento_Checkout/templates/cart/noItems.phtml
5
  • no text not changed Commented Jun 28, 2019 at 10:06
  • let me try from my side. Commented Jun 28, 2019 at 10:13
  • can you please check your theme module Magento_Checkout - have any content.html file. Commented Jun 28, 2019 at 10:14
  • 1
    this path - Magento_Checkout/web/template/minicart/content.html Commented Jun 28, 2019 at 10:19
  • i will try it sir Commented Jun 28, 2019 at 10:31
1

Create en_US.csv file in your module vendor/Module/i18n/en_US.csv
Add below text in en_US.csv file.

"You have no items in your shopping cart.","Add Your Changed Text Here."

Flush Your Magento cache php bin/magento c:f

4
  • text not changed Commented Jun 28, 2019 at 10:06
  • please clear your cache properly, it might be some cache issue. or you can redeploy the content also. Commented Jun 28, 2019 at 10:40
  • i clear it but it not happen Commented Jun 28, 2019 at 10:46
  • This does not work for me either (Other translations do). Tried with/without full stop & quotes. Even though I see in the DOM it is 'data-bind="i18n: 'You have no items in your shopping cart.'"'. Stupid Magento.
    – 00-BBB
    Commented Jan 7, 2021 at 12:04
0

Copy This File Into Your Theme :-

/vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html

See Line no. 78

 translate="'You have no items in your shopping cart.'"

You can change according to your requirements at above place.

Remove var folder from root and remove pub/static/frontend folder.

You must have run command php bin/magento setup:static-content:deploy

Clear your browser cache and check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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