Magento Error – Notice: Undefined index: 0 app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92

I got this error message when migrating my Magento files and database from one server to another. Notice: Undefined index: 0 in app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92 Solution: – Open PhpMyAdmin – Go to your database – Click SQL – Run the following SQL Query: SET FOREIGN_KEY_CHECKS=0; UPDATE `core_store` SET store_id = 0 WHERE code='admin'; UPDATE … Read more

W3C Validation: IFrame Error with XHTML 1.0 Strict Doctype

IFrames are not supported with XHTML 1.0 Strict Doctype. When you use IFrame and your doctype is XHTML 1.0 Strict, then you cannot pass the W3C Markup Validation test. You always get errors. The errors are like:- there is no attribute “src” there is no attribute “scrolling” there is no attribute “frameborder” there is no … Read more

PHP: Parse Unparse String Array

Here is a quick tip on parsing and unparsing string and array in PHP. You can parses the string into variables by using the parse_str PHP function. Using parse_str function void parse_str ( string $str [, array &$arr ] ) $str = The input string. $arr = If the second parameter arr is present, variables … Read more

Magento: There has been an error processing your request. Exception printing is disabled by default for security reasons

Problem: I am using Magento 1.4. Homepage loads fine. When I go to category (product listing) page, it works fine. But when I go to any product detail page, I get the following error:- There has been an error processing your request Exception printing is disabled by default for security reasons. I don’t get the … Read more

Magento: Rewrite/Override Block Controller Model Helper

This article will show how you can override/rewrite Magento Block, Controller, Model and Helper files. We will be dealing with the config XML files and the class files to override. We override Magento core classes to update/modify the core functionalities according to our need. We can directly makes changes in the core Magento classes but … Read more

Magento: Quick way to create order invoice programmatically

Here is a quick and easy way to create order invoice programmatically. Suppose, $_order contains your order. Here goes the code to create invoice:- if($_order->canInvoice()) { /** * Create invoice * The invoice will be in 'Pending' state */ $invoiceId = Mage::getModel('sales/order_invoice_api') ->create($_order->getIncrementId(), array()); $invoice = Mage::getModel('sales/order_invoice') ->loadByIncrementId($invoiceId); /** * Pay invoice * i.e. the … Read more

Magento: Downloadable products not displayed in Associated Products tab in Grouped Product

Scenario: – I created downloadable products. – Then I created a grouped product. – But, when I go to the ‘Associated Products’ tab in product add/edit page for Grouped product, I don’t see the downloadable products that I created before in the list. Cause/Solution: – Edit downloadable product – Go to Downloadable Information tab (the … Read more

Magento: Authorize.net not displayed in Payment Information section while Checkout

Scenario: I have enabled Authorize.net payment method but it is not displayed in Payment Information section while Checkout. Problem: In the class Mage_Paygate_Model_Authorizenet, you will find the following variable:- protected $_allowCurrencyCode = array('USD'); It means, the allowed currency for Authorize.net is only US Dollar (USD). You have to add the currency code to the above … Read more