Magento 2 – Add Continue Shopping Button in Checkout Page

checkouthtmlmagento2

We are trying to add "Continue Shopping" button after "Next" button in checkout page Magento 2.
We found that below file is the .html rendering the content.

\vendor\magento\module-checkout\view\frontend\web\template\shipping.html

Can any one help me on how to add "Continue Shopping" after next button.

Best Answer

Finally i have done this by overriding files into my theme as i added below , hope this helps for someone.

app\design\frontend[Vendor][theme]\Magento_Checkout\web\template\shipping.html

      <div class="primary">
          <button data-role="opc-continue" type="submit" class="button action continue primary">
              <span><!-- ko i18n: 'Next'--><!-- /ko --></span>
           </button>
           </br>
           <a class="continue_shopping_url" data-bind = "attr: { href: continueShoppingUrl}">Continue Shopping</a>
      </div>

app\design\frontend[Vendor][theme]\Magento_Checkout\web\js\view\shipping.js

    initialize: function () {
    // inside this initialize function i called my bindings. 
    this.continueShoppingUrl = ko.observable(window.location.origin);
Related Topic