Magento2 get cart and checkout link in block or phtml
Magento 2

Magento2 get cart and checkout link in block or phtml

Magento2 get cart and checkout link in block or phtml

In Magento2 get cart and checkout link in block or phtml then you need to call getUrl() method.It is every easy to get those url at Phtml or block class.

Also, there is no need to write layout xml code for getting cart and checkout page url at magento 2.

If want to get cart & checkout link at PHTML file then try below code:

Checkout Url

Cart Url

 

If you want to call at block class try with

Checkout link:

 

and Cart link:

I hope this will help lots.

More Import Blogs:

Magento2 get base url and media url and static url
How to get Magento 2 base URL?

One Comment

  • Namita Kapoor

    Hello Amit,

    I need help in regarding Payment module in Magneto2, I am trying some offline payment examples, but I am not able to see payment module in checkout page, I am not understanding what I am doing wrong, I am new to Magento and I am following the steps which is mentioned in examples like Cedcommerce, etc. But I am not able to see module in checkout page.

    I tried to install my module via composer also, I checked all the js files. I can see the backend part, I enabled my module in stores/configuration/advance/advance also but I am not able to see on frontend checkout page.

    Could you please help me in this regards?

    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *