Cart Summary expanded
To make cart summary opened initially on page load do the following :
Go to your core files and copy cart-items.html
vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html
Place cart-items.html
at below location in your custom theme, create folder if doesn't exist and copy only required files
app/design/frontend/vendor-name/theme-name/Magento_Checkout/web/template/summary/cart-items.html
In this you need to update this line of code at line no 7/8.
<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active'}}">
Here, you can pass the active option ('active': true)
to it. So the full line should be like so:
<div class="block items-in-cart" data-bind="mageInit: {'collapsible':{'openedState': 'active', 'active': true}}">
Now clear your cache
pub/static
var/view_preprocessed
Hopefully this should help you.
You can run following commands to remove your cache
rm -rf var/cache/*
rm -rf var/di/*
rm -rf var/generation/*
rm -rf var/page_cache/*
rm -rf var/view_preprocessed/*
I figured out the way to have the shipping block in the cart summary extended as well. It is an extension of Manoj's answer so all the credit still goes to him.
In order to change shipping.phtml needs to be updated.
Shipping.phtml can be found in
/vendor/magento/module-checkout/view/frontend/templates/cart
shipping.phtml needs to be modified on line 12
from:
<div id="block-shipping" class="block shipping" data-mage-init='{"collapsible":{"openedState": "active", "saveState": true}}'>
to:
<div id="block-shipping" class="block shipping" data-mage-init='{"collapsible":{"openedState": "active", "active": true}}'>
and then needs to be placed in:
app/design/frontend/vendor-name/theme-name//Magento_Checkout/templates/cart
then follow the same methods as Manoj to clear the cache.
I hope this can help someone in the future :)