0

I have custom additional options in quote and want to hide few options in the mini cart.

How to skip a specific index in Knockout js array from the following code

 <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>
1
  • Bro if you are using theme then you can directly copy it with same path in theme and if you want it to override in module them i think need to use mixin for it
    – Aman Alam
    Sep 1 at 7:23
0

Please follow the below steps to override this HTML file in the custom module:

  1. First Create a Custom module. You can follow this link to create a module: https://devdocs.magento.com/videos/fundamentals/create-a-new-module/

  2. Now create requirejs-config.js file inside "Vendor/Module/view/frontend".

  3. Add below content inside Vendor/Module/view/frontend/requirejs-config.js:

    var config = {
    map: {
        '*': {
            'Magento_Checkout/template/minicart/item/default.html':
                'Vendor_Module/template/minicart/item/default.html'
        }
    } };
    
  4. Now override file at this path Vendor/Module/view/frontend/web/template/minicart/item/default.html

2
  • Thanks it worked Sep 1 at 9:15
  • Glad to hear. Feel free to accept and upvote the answer if it's useful for you.
    – Amit Saini
    Sep 1 at 9:23

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.