Magento 2.3 add WYSIWYG Editor in phtml file

Magento 2.3 have some changes on WYSIWYG Editor So, First of all you have to create a text area field like below. Then add below script to load jQuery and WYSIWYG editor and then assign to textarea having id description. See result below : Hope it helps. If you have an any ideal about our … Continue reading “Magento 2.3 add WYSIWYG Editor in phtml file”

Magento 2 how to get a block template file phtml

You can simple get a block from template phtml file in Magento 2. There are two examples I will give you here. If you need to call a template block helloworld.phtml of Magebay_HelloWorld, please use the below code: If you need to call template block in CMS static Block or CMS Page in Magento 2, please use the below code: Hope … Continue reading “Magento 2 how to get a block template file phtml”

How to Get Base URL, Store URL and Current URL for Magento 2

Using Dependency Injection Here is the example code to get the store URLls in Magento 2 using dependency injection. In this, we might need to inject the object of \Magento\Store\Model\StoreManagerInterface class in the constructor of our module’s class. Using template file We also can use the functions in our view (.phtml) file as follows. Using Object Manager … Continue reading “How to Get Base URL, Store URL and Current URL for Magento 2”

Magento 2 add product to cart with custom price

Magento 2 add product to cart with custom price is very necessary for developer when building Magento extensions or doing projects in magento 2 because some time you want to custom price for separate Products . In order to add product to cart with custom price, You have to do 3 tasks : – Create … Continue reading “Magento 2 add product to cart with custom price”