1

I am using Magento 2.3.0 and I want the Cart Order Summary always expanded.

All solutions I have found wont work. Is there any workaround or has something changed in 2.3?

0

Try this work around:

First: Create a requirejs-config.js from path app/code/Marcel/Summary/view/frontend/requirejs-config.js

var config = {
     map: {
         '*': {
             "Magento_Checkout/template/summary/cart-items.html": "Marcel_Summary/template/summary/cart-items.html"
         }
     }
 };  

Second: Create your cart-items.html from this path app/code/Marcel/Summary/view/frontend/web/template/summary/cart-items.html

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': true}}">
    <div class="title" data-role="title">
        <strong role="heading">
            <translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()"/>
            <translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()"/>
            <span data-bind="text: getCartLineItemsCount()"></span>
            <translate args="'Item in Cart'" if="getCartLineItemsCount() === 1"/>
            <translate args="'Items in Cart'" if="getCartLineItemsCount() > 1"/>
        </strong>
    </div>
    <div class="content minicart-items" data-role="content" aria-hidden="false" style="display: block !important;">
        <div class="minicart-items-wrapper overflowed">
            <ol class="minicart-items">
                <each args="items()">
                    <li class="product-item">
                        <div class="product">
                            <each args="$parent.elems()" render=""/>
                        </div>
                    </li>
                </each>
            </ol>
        </div>
    </div>
    <div class="actions-toolbar" if="maxCartItemsToDisplay < getCartLineItemsCount()">
        <div class="secondary">
            <a class="action viewcart" data-bind="attr: {href: cartUrl}">
                <span data-bind="i18n: 'View and Edit Cart'"></span>
            </a>
        </div>
    </div>
</div>

After doing the above steps, make sure to run:

setup:upgrade
setup:static-content:deploy -f

Hope that helps!

  • It's not working. But I think, i have made a mistake. How does this path have to look like in config.js? "Magento_Checkout/template/summary/cart-items.html": "vendor_module/template/summary/cart-items.html", – Marcel Feb 26 at 10:13
  • you mean in requirejs-config.js? – fmsthird Feb 26 at 10:15
  • it should look like in my answer above – fmsthird Feb 26 at 10:17
  • and my answer works in my system – fmsthird Feb 26 at 10:19
  • only if you have followed all the instruction I posted in my answer – fmsthird Feb 26 at 10: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.