2

I want to add a link (Continue Shopping) that takes me to the homepage, on the checkout step myshop.com/checkout refer to image attached.

enter image description here

  • Let me know if you have any issue. – Prince Patel Jul 15 '17 at 7:29
  • I will let you know once i tested it. Thanks alot for your prompt response – Abdul Moiz Jul 15 '17 at 22:06
  • i tried exactly what you told but its not working for me. I have also cleaned the cache and checked it, but its still not working, even i tried to add custom link in the core module in, vendor/magento/module-checkout/view/frontend/web/template/shipping.html – Abdul Moiz Jul 17 '17 at 14:10
3

Override /vendor/magento/module-checkout/view/frontend/web/template/shipping.html in your custom theme

app/design/frontend/Test/test/Magento_Checkout/web/template/shipping.html

OR If you have custom module Override shipping.html at

app/code/Vendor/Module/view/frontend/web/template/shipping.html

Now add custom link before <div class="actions-toolbar"> like this

<div class="custom-link">
    <a href="your-link">Continue Shopping</a>
</div>
<div class="actions-toolbar" id="shipping-method-buttons-container">
    <div class="primary">
        <button data-role="opc-continue" type="submit" class="button action continue primary">
            <span><!-- ko i18n: 'Next'--><!-- /ko --></span>
        </button>
    </div>
</div>

Now deploy static files by php bin/magento setup:static-content:deploy and flush cache

OUTPUT:

enter image description here

  • I overridden this, vendor/magento/module-checkout/view/frontend/web/template/shipping.html with this, app/design/frontend/sps/design/Magento_Checkout/web/template/shipping.html but link is still not showing up? – Abdul Moiz Jul 17 '17 at 13:58
  • You need to deploy static file by php bin/magento setup:static-content:deploy to see changes. – Prince Patel Jul 17 '17 at 14:50
  • Overriding using a plugin isn't gonna work unless you add a requirejs-config.js-file to /Vendor/Module/view/frontend containing the following: var config = { map: { '*': { 'Magento_Checkout/template/shipping': 'Vendor_Module/template/shipping' } } }; – Daan van den Bergh Jun 18 '18 at 12:42
  • @DaanvandenBergh Yes, If you override html file with custom module then you must need requirejs-config to override html files – Prince Patel Jun 18 '18 at 17:58
  • @PrincePatel, I need to form custom url dynamically, i mean some php javascript variable value need to append. How that can be done? – jafar pinjar Mar 29 at 9:33
3

Override /vendor/magento/module-checkout/view/frontend/web/template/shipping.html and add a link before the button.

    <div class="actions-toolbar" id="shipping-method-buttons-container">

      <!-- add link here -->

      <div class="primary">
        <button data-role="opc-continue" type="submit" class="button action continue primary">
            <span><!-- ko i18n: 'Next'--><!-- /ko --></span>
        </button>
      </div>
   </div>
  • I have overridden the file you mentioned in mytheme, and i have also tried adding anchor tag in the core file you mentioned. But in both cases my checkout page stucks and keeps on loading. There might be something we are missing. – Abdul Moiz Jul 13 '17 at 20:34
  • It should work. Just make sure you have overridden properly – Mike Jul 14 '17 at 3:19
  • Same goes here as my earlier comment. This isn't gonna work unless you add a requirejs-config.js-file to /Vendor/Module/view/frontend containing the following: var config = { map: { '*': { 'Magento_Checkout/template/shipping': 'Vendor_Module/template/shipping' } } }; – Daan van den Bergh Jun 18 '18 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.