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>

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.