You may have face this problem where sometimes you failed to show special character(s) in mini-cart in product name. But what shall one do when he/she has to show special characters like single quote, double quote in product title in minicart.
Well, all you need to do is to copy default.html file from the vendor directory and place it with the relevant path in the theme.
app/design/frontend/Magento/theme/Magento_Checkout/web/template/minicart/item/default.html
Below is the whole code you need to replace in the above file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
<!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <li class="item product product-item" data-role="product-item"> <div class="product"> <!-- ko if: product_has_url --> <a data-bind="attr: {href: product_url, title: product_name}" tabindex="-1" class="product-item-photo"> <!-- ko foreach: $parent.getRegion('itemImage') --> <!-- ko template: {name: getTemplate(), data: item.product_image} --><!-- /ko --> <!-- /ko --> </a> <!-- /ko --> <!-- ko ifnot: product_has_url --> <span class="product-item-photo"> <!-- ko foreach: $parent.getRegion('itemImage') --> <!-- ko template: {name: getTemplate(), data: item.product_image} --><!-- /ko --> <!-- /ko --> </span> <!-- /ko --> <div class="product-item-details"> <strong class="product-item-name"> <!-- ko if: product_has_url --> <a data-bind="attr: {href: product_url}, html: product_name"></a> <!-- /ko --> <!-- ko ifnot: product_has_url --> <!-- ko html: product_name --><!-- /ko --> <!-- /ko --> </strong> <!-- ko if: options.length --> <div class="product options" data-mage-init='{"collapsible":{"openedState": "active", "saveState": false}}'> <span data-role="title" class="toggle"><!-- ko i18n: 'See Details' --><!-- /ko --></span> <div data-role="content" class="content"> <strong class="subtitle"><!-- ko i18n: 'Options Details' --><!-- /ko --></strong> <dl class="product options list"> <!-- ko foreach: { data: options, as: 'option' } --> <dt class="label"><!-- ko text: option.label --><!-- /ko --></dt> <dd class="values"> <!-- ko if: Array.isArray(option.value) --> <span data-bind="html: option.value.join('<br>')"></span> <!-- /ko --> <!-- ko if: (!Array.isArray(option.value) && option.option_type == 'file') --> <span data-bind="html: option.value"></span> <!-- /ko --> <!-- ko if: (!Array.isArray(option.value) && option.option_type != 'file') --> <span data-bind="text: option.value"></span> <!-- /ko --> </dd> <!-- /ko --> </dl> </div> </div> <!-- /ko --> <div class="product-item-pricing"> <!-- ko if: canApplyMsrp --> <div class="details-map"> <span class="label" data-bind="i18n: 'Price'"></span> <span class="value" data-bind="i18n: 'See price before order confirmation.'"></span> </div> <!-- /ko --> <!-- ko ifnot: canApplyMsrp --> <!-- ko foreach: $parent.getRegion('priceSidebar') --> <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko --> <!-- /ko --> <!-- /ko --> <div class="details-qty qty"> <label class="label" data-bind="i18n: 'Qty', attr: { for: 'cart-item-'+item_id+'-qty'}"></label> <input data-bind="attr: { id: 'cart-item-'+item_id+'-qty', 'data-cart-item': item_id, 'data-item-qty': qty, 'data-cart-item-id': product_sku }, value: qty" type="number" size="4" class="item-qty cart-item-qty"> <button data-bind="attr: { id: 'update-cart-item-'+item_id, 'data-cart-item': item_id, title: $t('Update') }" class="update-cart-item" style="display: none"> <span data-bind="i18n: 'Update'"></span> </button> </div> </div> <div class="product actions"> <!-- ko if: is_visible_in_site_visibility --> <div class="primary"> <a data-bind="attr: {href: configure_url, title: $t('Edit item')}" class="action edit"> <span data-bind="i18n: 'Edit'"></span> </a> </div> <!-- /ko --> <div class="secondary"> <a href="#" data-bind="attr: {'data-cart-item': item_id, title: $t('Remove item')}" class="action delete"> <span data-bind="i18n: 'Remove'"></span> </a> </div> </div> </div> </div> </li> |
That’s it. Hope this article helped you to solve your programmatical problem.
[crayon-63d695998730a800958577/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.