Installation And Upgrade Scripts in Magento

March 31, 2017 Iyngaran Iyathurai 0

A Magento install and upgrade script is a part of module development. In this article, we will find out how to install and upgrade sql script for module in Magento 2. When you install or upgrade a module, you may need to change the database structure or add some new data for current table. To do this, Magento 2 provide you some classes which you can do all of them. For example, here – app/code/Magento/Catalog/Setup/ […]

Creating & Running Cron in Magento 2 Custom Module

March 8, 2017 Iyngaran Iyathurai 2

This article shows how to create and run cronjob in a custom module in Magento 2. Here, we will focus on creating / setting up / running cron for a custom Magento 2 module. Let us suppose, we are developing a custom module named Iyngaran_DemoModule (app/code/Iyngaran/DemoModule). To define the cron settings for your custom module, you need to write the following code in app/code/Iyngaran/DemoModule/etc/crontab.xml. app/code/Iyngaran/DemoModule/etc/crontab.xml

As you can see from above code, we have […]

Create static blocks programmatically in Magento2

March 2, 2017 Iyngaran Iyathurai 0

Creating a static blocks in Magento is simple as navigate to Admin Panel -> CMS -> Static Blocks. But while you developing your extension you might need to create a Magento static blocks programmatically. Here is the way how you can achieve it:

  That’s it!. Clear cache and upgrade magento.

 

Create CMS pages programmatically in Magento2

March 2, 2017 Iyngaran Iyathurai 0

Creating a CMS pages in Magento is simple as navigate to Admin Panel -> CMS -> Pages. But while you developing your extension you might need to create a Magento CMS Page programmatically. Here is the way how you can achieve it:  

That’s it!. Clear cache and upgrade magento.

   

Magento 2.x. Update/add cms static block programmatically.

March 2, 2017 Iyngaran Iyathurai 0

To update cms static block for particular store programmatically you can use following code.

 

Magento 2: Add a CMS Static Block via XML Updates in you homepage

March 2, 2017 Iyngaran Iyathurai 0

These are the steps to add a CMS Static block to your homepage using XML Updates in XML files. Go to the Admin Panel > Content > Blocks Click on “Add new Block” Create your custom block, make sure that the option “Enabled” is checked and save it. In the project code, go to app/design/frontend/[VendorName]/[themeName]/ and add the following file app/design/frontend/[VendorName]/[themeName]/Magento_Cms/layout/cms_index_index.xml

 NOTE: You can use “before” or “after” to place the block as you […]