Monthly Archives: May 2014

Magento Conflicts

Magento have one of the biggest problem is cache and Extension Conflicts when more than one extension used the same
core File conflicts occurs and Developer had to struggle to find out the issues to fix it

Now if you see “<rewrite>” in it’s config.xml file in any of the extension it means Conflicts will occur.

But there are Extension which doesn’t conflict problems as by means of some standard Extensions are made
so that it should not conflict the other s module and the core functionality

May be there is chance that some time Theme also get in Magento Community level as Developer
I have occur so many problem…

So now question comes how we can Resolve this Conflicts?

You have 3 Scenario for resolving conflicts:

Scenario 1
Merge the code from one conflicting file into another and
switch off the rewrite config.xml in one
Switch off the rewrite in one config.xml and then make the conflicting extension PHP file extend the other extension
Use the <depends> capability to make one extension depend on another. They will then rewrite in that order

Scenario 2
So we have example

class A_Extension_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
Now change it to:

class A_Extension_Model_Type_Onepage extends B_Extension_Model_Type_Onepage

Once you have done this you need to change extension B config.xml file

commenting out the conflicting “<rewrite>” blocks that are now inheriting from A.

Scenario 3
Let’s say you have 2 extensions Bla_A and Bla_B. In the module for file Bla_B (under app/etc/modules)
you would add the following:

<depends Foo_A />
Now Magento will load the extensions in this order. So in effect the Bla_B class will be loaded first,
then Bla_A, then base Magento

For Me scenario 2 Works perfect in order to avoid Conflict..Try it out ..hope this will help you

Magento Add new Column under sales item order

Recently I faced issues how to  add column to some table before it gets save in here is the steps which will help to add the new column under sales_flat_order_item, sales_flat_invoice_item and sales_flat_shipment_item

so my field name is “vendor_name” in each of 3 tables and update the information without firing any query!
Step 1)
Create the installer script which will add the column in all 3 tables

$installer = $this;


ALTER TABLE sales_flat_order_item ADD COLUMN vendor_name varchar(255) NULL;
ALTER TABLE sales_flat_invoice_item ADD COLUMN vendor_name varchar(255) NULL;
ALTER TABLE sales_flat_shipment_item ADD COLUMN vendor_name varchar(255) NULL;



So once you run the script column will get added in your tables


so now we need to go for the event which will fire before order is placed, before invoice is created and before shipment is saved.add the events in config.xml




Step 3)

Now we need to create the observer.php

public function saveVendorNameInOrder(Varien_Event_Observer $observer) {
$order = $observer->getEvent()->getOrder();
/* add your bussiness Logic here */
return $this;

public function saveVendorNameInInvoice(Varien_Event_Observer $observer) {
$invoice = $observer->getEvent()->getInvoice();
/* add your bussiness Logic here */
return $this;

public function saveVendorNameInShipment(Varien_Event_Observer $observer)
$shipment = $observer->getEvent()->getShipment();
/* add your bussiness Logic here */
return $this;


so once all done Clear the cache and the code will work as per need..hope this will help you