Magento 2 enables your component to add commands to the default CLI Magento has one command-line interface that performs both installation and configuration tasks: /bin/magento. I am explaining here a way to add custom commands for your module. 1) Create a Command class, I have created a custom class at app/code/DW/Interface/Console/OrderCron.php. 2) Declare your Command […]
Tag: XML
Everything Related to XML
Custom Log File in Magento 2
Magento provides multiple types of logs by default (info, notice, warning, critical etc) Recently I had to use custom log files for a custom module that I implemented. I will try to explain here the multiple approaches to do that, a) Set a custom file in your module’s di.xml file In the di.xml file of […]
cURL request in Magento
cURL request in Magento Most of the time there is a need to call 3rd party APIs from Magento. We use cURL functions for the same, now here is an interesting part, Magento has wrapper functions for the same in its own library. This make it easy for calling the 3rd party API url’s. Code […]
Disable ‘Billing Agreements’ and ‘Recurring Profiles’ in Magento
Hello All , From the new functionalities introduced from Magento 1.4.1.0 , two are ‘Billing Agreements’ and ‘Recurring Profiles’ Sad thing is that this cannot be disabled from admin completly. For hiding the links from the navigation in ‘My Account’ section of Customer, you can copy billing_agreement.xml and recurring_profile.xml from /app/design/frontend/base/default/layout/sales/ to /app/design/frontend/default/yourtheme/layout/sales/. After copying […]
Custom Footer Links Magento
Hello All, When we install Magento, we can see that we have two rows in footer links (theme – default). We can edit the links in the top row from CMS block with title ‘Footer Links’. The links in the second row cannot be edited directly, they come from the XML files. I am writing […]
Reading XML
I am listing here method for reading XML file or XML string with the help of PHP. The output on executing above code will be: I am listing here another example: The output on executing above code will be: For further reference click here
Generate XML
XML files are used for various functionalities. We can develop XML files by using PHP. If you have to develop very small project, you can use XML files for saving data instead of MySQL or any other databse with PHP, which will be easy for maintaining and response time will be reduced. I am listing […]