How to disable the Gift Message Extension in Magento 1?

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 extensions, this module cannot be removed so easily because of some errorneous, hidden dependencies in other modules.

Chris / / zuletzt aktualisiert am

So let’s have a look what needs to be done in order to remove the default Magento Gift Message Extension.

Disable 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:


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>

The next problem is the product attribute gift_message_available. This system attribute uses the frontend input renderer class giftmessage/adminhtml_product_helper_form_config which can no longer be autoloaded because the "giftmessage" block resolution does not work any more after disabling the Gift Message Extension. The attribute cannot be removed via the backend because it is a system attribute. I also prefer to keep it there just in case we will later re-enable the Gift Message functionality for some reason.

So to simply fix this and be able to show the product admin page, we re-add the Gift Message block definition in a new Extension like this:


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 we have removed all hidden dependencies and the Magento Gift Message Extension is finally completely disabled!

Reaktionen auf "How to disable the Gift Message Extension in Magento 1?"

Kommentar erstellen

Mit der Nutzung dieses Formulars erklärst Du Dich mit der Speicherung und Verarbeitung Deiner Daten durch diese Website einverstanden. Informationen zur Verarbeitung Deiner Daten findest Du in der Datenschutzerklärung.
Ihre Daten werden sicher per SSL übertragen.

Meine Magento Extension Bestseller