Home » Archive

Articles Archive for August 2016

Magento, Magento 2 »

[29 Aug 2016 | 7 Comments]

This article shows how to write/run/execute custom SQL queries in Magento 2. We need to instantiate class Magento\Framework\App\ResourceConnection for this. You have to inject this resource class in your module’s Block/Model/Controller class constructor. After that, you can use that object to run custom sql queries.
In this example, I will simply be using object manager to instantiate the resource class.

PHP »

[22 Aug 2016 | Comments Off on MailChimp API v3.0 – Manage Subscriber using PHP & CURL]

This article shows how you can use MailChimp API v3.0 with PHP and CURL to manage MailChimp subscribers. This includes adding subscribers to a list, editing/updating subscribers in a list, adding subscribers to a category/group of a list, fetching and displaying list & list id and groups and groups id as well.
Getting your list ID

Magento, Magento 2 »

[15 Aug 2016 | 2 Comments]

This article shows how to run Magento 2 code in an external file/script. The external file can be inside the Magento root folder or outside of it.
This example considers that the file is present in the Magento 2 root folder. Let us name the file as abc.php. So, we want to execute some code when we open http://example.com/abc.php.

Magento, Magento 2 »

[8 Aug 2016 | 3 Comments]

This article shows how you can override / rewrite Block, Controller, Model, and Helper in Magento 2.
This can be done by two ways:
1) using Preference
2) using Plugin

Magento, Magento 2 »

[2 Aug 2016 | 4 Comments]

Magento 2 provides a new feature called Plugin or Interceptor that is used to run some code before/after/around any function call of any public class. Hence, with the help of Plugins, we can change the behavior of class method without making any changes in the code of the class itself. This also avoids conflicts with other modules.
Let’s suppose your module is named YourCompany_YourModule.