0

I want to add "Back to Cart" Button at checkout page Near the "Next" button

docker.com/checkout/#shipping

Please help

1 Answer 1

0

To add a new button beside the "Next" button, override the below file in your theme/module.

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

Add your link to the actions-toolbar 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 translate="'Next'"></span>
        </button>
    </div>
    <div class="secondary">
        <a href="#" data-bind="attr: { href: getCartUrl() }" >Back to Cart</a>
    </div>
</div>

Create a mixin of shipping.js file and add a new function getCartUrl to return the cart page URL.

1
  • Hi i am new to magento, can you please share the shipping.js file Commented Jun 27 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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