Question

I want to make it so that when any User buys a product, when checkout is clicked on then the first modal dialog box opens to either login or use a guest account to purchase the product.

Was it helpful?

Solution

Edit: Checkout the Code below or in the attached link Link: magento/magento2/blob/487f5f45/app/code/Magento/Checkout/view/frontend/web/js/sidebar.js#L52-L66

Code: events['click ' + this.options.button.checkout] = $.proxy(function () { var cart = customerData.get('cart'), customer = customerData.get('customer');

if (!customer().firstname && cart().isGuestCheckoutAllowed) {
    if (this.options.url.isRedirectRequired) {
        location.href = this.options.url.loginUrl;
    } else {
        authenticationPopup.showModal();
    }

    return false;
}
location.href = this.options.url.checkout;
}, this);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top