0

How do I stop product options from displaying in the minicart?

enter image description here

0

I believe this can be done via JS and via HTML templates, this is the template method.

Copy the below file into your theme and remove the code shown.

File: vendor/magento/module-checkout/view/frontend/web/template/minicart/item/default.html:34

...

<!-- 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 ifnot: Array.isArray(option.value) -->
                    <span data-bind="html: option.value"></span>
                <!-- /ko -->
            </dd>
            <!-- /ko -->
        </dl>
    </div>
</div>
<!-- /ko -->

...

You will likely need to clear browser cache after you deploy, and possibly compile/deploy static assets depending on your workflow.

  • Can you please give me js path for get options array value? – Rohan Hapani Jan 22 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.