{"id":645,"date":"2019-10-22T07:01:43","date_gmt":"2019-10-22T07:01:43","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/10\/22\/solved-display-product-title-with-special-characters-in-magento-2-mini-cart\/"},"modified":"2025-07-23T12:54:02","modified_gmt":"2025-07-23T07:24:02","slug":"solved-display-product-title-with-special-characters-in-magento-2-mini-cart","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solved-display-product-title-with-special-characters-in-magento-2-mini-cart\/","title":{"rendered":"Solved &#8211; Display Product Title With Special Characters in Magento 2 Mini Cart"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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 \u00e4 show \u201c&amp; auml;\u201d in the frontend.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, the product CSV file uploaded in the Magento 2 store has product names like Dress\u2122. In the frontend mini cart, it displays as &amp;Dress;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/10\/Before-Solved-Display-Product-Title-With-Special-Characters-in-Magento-2-Mini-Cart-Meetanshi-1024x439.png\" alt=\"Before-Solved-Display-Product-Title-With-Special-Characters-in-Magento-2-Mini-Cart-Meetanshi.png\" class=\"wp-image-6700\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The expected result is to display the correct product title after converting the HTML equivalent to the characters. But the actual results differ.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To avoid that, follow the below solution to <em><strong>display product title with special characters in Magento 2 mini cart<\/strong><\/em> correctly:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to display product title with special characters in Magento 2 mini cart:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Find the below code in <em><strong><em><strong><em><strong>vendor\\magento\\module-checkout\\view\\frontend\\web\\template\\minicart\\item\\default.html<\/strong><\/em><\/strong><\/em><\/strong><\/em> file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">  &lt;strong class=\"product-item-name\">\n    &lt;!-- ko if: product_has_url -->\n    &lt;a data-bind=\"attr: {href: product_url}, text: product_name\">&lt;\/a>\n    &lt;!-- \/ko -->\n    &lt;!-- ko ifnot: product_has_url -->\n    &lt;!-- ko text: product_name -->&lt;!-- \/ko -->\n    &lt;!-- \/ko -->\n &lt;\/strong><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the above code with the below code at&nbsp;<em><strong>app\\design\\frontend\\[Theme]\\[Name]\\Magento_Checkout\\web\\template\\minicart\\item\\default.html<\/strong><\/em>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> &lt;strong class=\"product-item-name\">\n    &lt;!-- ko if: product_has_url -->\n    &lt;a data-bind=\"attr: {href: product_url}, html: product_name\">&lt;\/a>\n    &lt;!-- \/ko -->\n    &lt;!-- ko ifnot: product_has_url -->\n    &lt;!-- ko html: product_name -->&lt;!-- \/ko -->\n    &lt;!-- \/ko -->\n &lt;\/strong><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can see how the product title is displayed correctly:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2019\/10\/After-Solved-Display-Product-Title-With-Special-Characters-in-Magento-2-Mini-Cart-Meetanshi-1024x441.png\" alt=\"Display Product Title With Special Characters in Magento 2 Mini Cart\" class=\"wp-image-6701\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Note, You can also <a href=\"https:\/\/meetanshi.com\/blog\/show-additional-data-in-magento-2-mini-cart\/\">show additional data in Magento 2 mini cart<\/a> to show shipping charge, discount or tax information etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the solution with fellow developers via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-645","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=645"}],"version-history":[{"count":5,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/645\/revisions"}],"predecessor-version":[{"id":19187,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/645\/revisions\/19187"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}