Magento 2: Add a custom link in checkout
-
10-10-2020 - |
Solution
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:
OTHER TIPS
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>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange