Magento 2.x – How to call any block function inside a phtml

If you are inside a phtml file, and you need to call an specific function inside another block. You can do the following:

  • The block method  that you want to call is the following:
  • This is what you should do, in your phtml:


Hope it helps.