Continued Magento 1 Support ⋅ 7-Day Money-back guarantee ⋅ Implemented by a Magento Certified Developer


How to disable the Gift Message Extension in Magento 1?

I'm available for Magento, PHP, Shopware or ReactJS projects.

While tweaking your Magento 1 online shop for performance you might have come into try to remove the default Mage_GiftMessage extension.
Unfortunately like many other default modules this module cannot be removed so easily because of some errorneous, hidden dependencies in other modules.
So let’s have a look what needs to be done in order to remove the default Magento gift message extension.

As I said the Mage_GiftMessage module has some hidden dependencies in the core modules. “Hidden” because dependencies should be clearly stated in the module XML file and it should in theory be possible to disable the module without any interferences in other modules.

So first of all let’s disable the gift message module:

<Mage_GiftMessage>
    <active>false</active>
</Mage_GiftMessage>

Changes in Magento Frontend Theme

Next we have to remove some dependencies, first one is in order email template in app/design/frontend/base/default/template/email/sales/order/items.phtml.
Of course you should overwrite this file within your own Magento theme. Let’s remove everything within these lines:

<?php if ($this->helper('giftmessage/message')->isMessagesAvailable('order', $_order, $_order->getStore()) && $_order->getGiftMessageId()): ?>
...
<?php endif; ?>

Changes in Magento Admin Theme

After that we have to go into adminhtml theme file app/design/adminhtml/default/default/layout/sales.xml and remove this part (you ideally again create your own admin theme for that):

<block type="adminhtml/template" name="gift_options" template="sales/order/giftoptions.phtml">
    <block type="adminhtml/sales_order_view_giftmessage" name="order_giftmessage" template="sales/order/view/giftmessage.phtml"></block>
</block>

Finally go to template file app/design/adminhtml/default/default/template/downloadable/sales/order/view/items/renderer/downloadable.phtml and remove this part:

<?php if ($this->canDisplayGiftmessage()): ?> class="border"<?php endif; ?>

That’s it, now the Magento gift message extension is completely disabled!