·

configuration

Source Models in Magento 2 and their configuration path

Hi there! Got Magento 2 open in your IDE? Good! Take a look at the <section id="sales_email">-node in the etc/adminhtml/system.xml of the Sales module. Notice anything… weird? Look at all the source models responsible for rendering e-mail templates. They all use the same source model: Magento\Config\Model\Config\Source\Email\Template. This might look weird at first. After all: when read further ...

Adding System configuration in Magento 2

When developing a site with Magento 2, you might want to be able to add some custom settings to the system configuration. This can be settings that reflect on your template, or settings that apply to your module. In Magento 1, this could be easily done by creating a system.xml  file. Magento 2 has a similar read further ...

Set the order status for new orders in Magento

In Magento, for most payment methods, you can assign an order status to a new order. You can do this in the system configuration for the specific payment method. But in a lot of cases, the only order status you can select here, is ‘Pending’.   But what if you want to assign a different order read further ...

Change Magento configuration on the fly

Sometimes you have a situation where you need to change the configuration of Magento on the fly. Just for your single request, without saving it. This can be easily done with the Magento configuration Model: If you want to change a configuration value on the fly on store-level, you can do this as follows: read further ...

Dump your Magento configuration to a single XML file.

Sometimes you want to be able to look at the raw configuration of Magento during runtime. It would be nice to log this as a XML file. This little code snippet does just that: It dumps your current configuration to a single XML-file in your log-folder:  read further ...