Pass data from phtml to javascript in Magento2

In this topic we describes different ways to pass data from phtml to javaScript in Magento 2 using Declarative Notation. Subscribe to Bethos for all the Magento2 problems and customizations. If you do not know about calling and initializing javascript, please refer Calling and initializing JavaScript in Magento2 blog to know about it. Types of … Read more

Include template into another template in Magento2

In this topic we describes the way to include template file into another template. Subscribe to Bethos for all the Magento2 problems and customizations. Using getTemplateFile method: If you need to include phtml template file into another phtml, Magento provides a inbuilt function called getTemplateFile. For example: Here is my first template app/code/Bnethos/Example/view/frontend/templates/mainTemplate.phtml

In … Read more