cancel
Showing results for 
Search instead for 
Did you mean: 

Show Estimate Shipping and Tax Box Default

Show Estimate Shipping and Tax Box Default

I'm trying to get the Estimate Shipping and Tax box to be expanded by default on the cart page so the customer doesn't have to click the down arrow to make it visible. I'm using Magento 2.3.1

 

I've seen a few threads on stackexchange about it but they all seem to be for previous versions and don't seem to work.

 

I've tried uploading a new version of Magento_Checkout\web\js\view\summary\cart-items.js with the following code in it:

/**
         * Returns bool value for items block state (expanded or not)
         *
         * @returns {*|Boolean}
         */
        isItemsBlockExpanded: function () {
            //return quote.isVirtual() || stepNavigator.isProcessed('shipping');
            return true;
        }

But this does nothing.

 

I'm also trying to change the text "Estimate Shipping And Tax" to "Available Delivery Options" but everything I try fails too.

I've tried editing the en_GB.csv file in my themes i18n folder and also overriding the template responsible for outputting that string.

 

Any ideas welcomed!

2 REPLIES 2
Highlighted

Re: Show Estimate Shipping and Tax Box Default


@inderjit_nanuwa wrote:

I'm trying to get the Estimate Shipping and Tax box to be expanded by default on the cart page so the customer doesn't have to click the down arrow to make it visible. I'm using Magento 2.3.1

 

I've seen a few threads on stackexchange about it but they all seem to be for previous versions and don't seem to work.

 

I've tried uploading a new version of Magento_Checkout\web\js\view\summary\cart-items.js with usps tracking the following code in it:

/**
         * Returns bool value for items block state (expanded or not)
         *
         * @returns {*|Boolean}
         */
        isItemsBlockExpanded: function () {
            //return quote.isVirtual() || stepNavigator.isProcessed('shipping');
            return true;
        }

But this does nothing.

 

I'm also trying to change the text "Estimate Shipping And Tax" to "Available Delivery Options" but everything I try fails too.

I've tried editing the en_GB.csv file in my themes i18n folder and also overriding the template responsible for outputting that string.

 

Any ideas welcomed!


Looking for the same answers. 


Thanks in advance.

Regards

Shane

Highlighted

Re: Show Estimate Shipping and Tax Box Default

Hi,

 

I found a solution working on magento 2.3.3

 

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

 

Original post with the solution: https://magento.stackexchange.com/questions/196172/cart-summary-expanded