Solved – Display Product Title With Special Characters in Magento 2 Mini Cart

Magento 2 mini cart displays the product title when the user adds the product to the cart. However, sometimes the product titles with special characters like ä show “& auml;” in the frontend.

For example, the product CSV file uploaded in the Magento 2 store has product names like Dress™. In the frontend mini cart, it displays as &Dress;

Solved - Display Product Title With Special Characters in Magento 2 Mini Cart 2

The expected result is to display the correct product title after converting the HTML equivalent to the characters. But the actual results differ.

To avoid that, follow the below solution to display product title with special characters in Magento 2 mini cart correctly:

Method to display product title with special characters in Magento 2 mini cart:

Find the below code in vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html file:

Replace the above code with the below code at app\design\frontend\[Theme]\[Name]\Magento_Checkout\web\template\minicart\item\default.html:

That’s it.

Now you can see how the product title is displayed correctly:

Solved - Display Product Title With Special Characters in Magento 2 Mini Cart 3

Use the Comments section below if you have any doubts about the implementation. I’d be there for you 😊

Do share the solution with fellow developers via social media.

Thank you.
Meetanshi Contacts

5
(based on 3 Reviews)
Solved – Display Product Title With Special Characters in Magento 2 Mini Cart

Sanjay Jethva

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply

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