create Vendor/Module/view/frontend/web/template/checkout/sidebar.html
file & make copy paste html template from Magento_Checkout/view/frontend/web/template/sidebar.html
<div id="opc-sidebar"
data-bind="visible: canDisplaySidebarSummaryBlock(), afterRender:setModalElement, mageInit: {
'Magento_Ui/js/modal/modal':{
'type': 'custom',
'modalClass': 'opc-sidebar opc-summary-wrapper',
'wrapperClass': 'checkout-container',
'parentModalClass': '_has-modal-custom',
'responsive': true,
'responsiveClass': 'custom-slide',
'overlayClass': 'modal-custom-overlay',
'buttons': []
}}">
<!-- ko foreach: getRegion('summary') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<div class="opc-block-shipping-information">
<!-- ko foreach: getRegion('shipping-information') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
then. create Vendor/Module/view/frontend/web/js/view/checkout/sidebar-mixin.js
define([
'uiComponent',
'ko',
'jquery',
'Magento_Checkout/js/model/step-navigator',
], function (Component, ko, $, stepNavigator) {
'use strict';
var mixin = {
/**
* current step is #payment or not.
*
* @returns {Boolean}
*/
canDisplaySidebarSummaryBlock: function () {
if(stepNavigator.isProcessed('shipping')) {
// if stepNavigator is not #shipping . then display Order Summary & remove class of width 100%
$('.opc-summary-wrapper').css("display", "block");
$('#checkout .opc-wrapper').removeClass('w-100');
}else{
$('.opc-summary-wrapper').css("display", "none");
$('#checkout .opc-wrapper').addClass('w-100');
}
return stepNavigator.isProcessed('shipping');
}
}
return function (target) {
return target.extend(mixin);
};
});
then Vendor/Module/view/frontend/requirejs-config.js
var config = {
config: {
mixins: {
'Magento_Checkout/js/view/sidebar': {
'Microtech_Storepickup/js/view/checkout/sidebar-mixin': true
},
}
}
}
then create Vendor/Module/view/frontend/layout/checkout_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<!-- Order Summary -->
<item name="sidebar" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Microtech_Storepickup/checkout/sidebar</item>
<item name="componentDisabled" xsi:type="boolean">false</item>
</item>
<!-- <item name="children" xsi:type="array">
<item name="summary" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Microtech_Storepickup/checkout/summary</item>
</item>
</item>
</item> -->
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>