Magento – Magento 2: How to add edit cart option on order summary on checkout page

checkoutmagento2

I want to add custom link in order summary on checkout page in magento. I have tried several options but doesn't work.

Is there any solution for this.

Like the following image:
enter image description here

Best Answer

Question is too old but i am providing solution here so if someone have encountered this issue / requirement.

To add Edit link on cart summary block, you have to make changes in web/template/summary/cart-items.html file of Magento_Checkout :

Copy module-checkout/view/frontend/web/template/summary/cart-items.html and paste this in your Theme's Magento_Ccheckout/view/frontend/web/template/summary/cart-items.html.

And add below code block :

<div class="edit-summary">
    <span class="cart-summary-edit-link">
        <a class="action viewcart" data-bind="attr: {href: cartUrl}">
            <span data-bind="i18n: 'Edit Cart'"></span>
        </a>
    </span>
</div>

Where you want to add Cart summary link.

After making changes delete your var/view_processed/pub and pub/static/frontend folders and deploy static-content again.

NOTE : if you add this block within data-role=title div it will add the link but will not work as click event will not work on URL , because click event is being used for cart summary accordion ( open close ). solution is tested with Magento 2.2.2.

Related Topic