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

Associated Simple Product Price in Cart: Magento Extension [FREE]

Associated Product Price in Cart is a FREE Magento extension that uses the associated simple product’s price in shopping cart instead of the configurable product’s price. This module is compatible with Magento version 1.5 and later (Magento 1.5, 1.6, 1.7, 1.8, 1.9). Sometime, you have a scenario when a configurable product and its associated simple … Read more

Magento 2: Get Attribute Id, Name, Value from Attribute Code

This article shows how you can get attribute name or label, id, entity_type, etc. by attribute code in Magento 2. If you would like get attribute name and value in Magento 1 then you may refer to this article: Magento: How to get attribute name and value? I will be showing both Dependency Injection (DI) … Read more