Skip to main content

Magento2 Checkout: remove sidebar ONLY in step 1

Add the following line to your CSS file:

.opc-summary-wrapper{

    display:none;

}

Goto following directory

vendor/magento/module-checkout/view/frontend/web/js/model

And open the file step-navigator.js

Copy this file to your working theme directory.

Edit the function getActiveItemIndex in step-navigator.js You will get 0,1 etc when console.log(activeIndex);

You will get 1 on Payment method step. You can put one condition there for display block by the following code:

if (activeIndex == 1) {
  $('.opc-summary-wrapper').show();
} else {
  $('.opc-summary-wrapper').hide();
}