1

I would like to add the product SKU above the product name in the minicart.

enter image description here

How can I add it? Do I need to create a copy of one of these files in my theme? app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html app/code/Magento/Checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml

1 Answer 1

4

I solved it by creating a copy of app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

in my theme at app/design/frontend/Holy/mytheme/Magento_Checkout/web/template/minicart/item/default.html

and updating the code to include:

<strong class="product-item-name"> <!-- ko if: product_has_url --> <a data-bind="attr: {href: product_sku}, text: product_sku"></a> <a data-bind="attr: {href: product_url}, text: product_name"></a> <!-- /ko --> <!-- ko ifnot: product_has_url --> <!-- ko text: product_name --><!-- /ko --> <!-- /ko --> </strong> 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.