Magento 2: Reindex via Command Line

This article shows how you can reindex Magento 2 index types using the command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to reindex Magento 2 index types. Get Index Types Info First of all, let’s … Read more

Magento 2: Enable/Disable/Clear Cache (Clean/Flush) via Command Line

This article shows how you can clear Magento 2 cache using command line. In my previous article, I have listed out all the command line tools that can be used in Magento 2. This article specifically shows about commands to clear Magento 2 cache. Check Cache Status First of all, let’s see what is the … Read more

Magento Error: Item (Mage_Core_Model_Store) with the same id “0” already exist

Problem: I transferred my Magento site files from one computer to another (it can be from local computer to online or from development site to production site). I imported the database. Now, when I try to browse the new location’s site, I get the following error: There has been an error processing your request Item … Read more

Magento: Add new column to Product Grid in Admin

This article shows how you can add new columns to product grid (Catalog -> Manage Products) in Magento 1.x admin. For this, you need to rewrite/override the Adminhtml’s catalog_product_grid block class. Here is the block override code to be written in your module’s config.xml file: YourCompany/YourModule/etc/config.xml <global> <blocks> <yourmodule> <class>YourCompany_YourModule_Block</class> </yourmodule> <adminhtml> <rewrite> <catalog_product_grid>YourCompany_YourModule_Block_Adminhtml_Catalog_Product_Grid</catalog_product_grid> </rewrite> … Read more

Magento: Add new column to Customer Grid in Admin

This article shows how you can add new column to customer grid in Magento 1.x admin. In this example, we will be adding a fetching the fax field value from customer’s billing address and showing in the customer grid in Magento admin. For this, you need to rewrite/override the Adminhtml’s customer_grid block class. Here is … Read more

Magento: Add New Column to Sales Order Grid in Admin

This article shows how you can add new columns to sales order grid in Magento 1.x admin. For this, you need to rewrite/override the Adminhtml’s sales_order_gird block class. Here is the block override code to be written in your module’s config.xml file: YourCompany/YourModule/etc/config.xml <global> <blocks> <yourmodule> <class>YourCompany_YourModule_Block</class> </yourmodule> <adminhtml> <rewrite> <sales_order_grid>YourCompany_YourModule_Block_Adminhtml_Sales_Order_Grid</sales_order_grid> </rewrite> </adminhtml> </blocks> </global> … Read more

Magento: Create Order Programmatically

This article show how you can create sales order programmatically through code in Magento 1.x. This code example also includes creating new customer if the customer email is not already registered. It also shows how you can save customer address to the newly created customer. This code has been tested for simple products. Here are … Read more

Google Tag Manager: Magento 2 Extension [FREE]

Google Tag Manager is a FREE Magento 2 Extension that allows you to integrate Google Tag Manager to your site. This extension also provides ecommerce transaction tracking feature. You just need to enter your Tag Manager container id in the extension’s configuration settings. This module is compatible with Magento version 2.0 and later. The Magento … Read more

Magento: Create Customer Programmatically

This article shows how you can programmatically (through code) create customers in Magento 1.x. In this example code, you can find saving customer general information along with saving customer’s billing address and shipping address. Here are the steps followed in the code below: – The code first loads the customer by email. – If the … Read more