Skip to content
Fabian Blechschmidt edited this page Mar 22, 2018 · 2 revisions

Disable Tax Display on Category Pages

Create your own module with the following event observer config:

            <magesetup_after_product_price>
                <observers>
                    <kitchenking>
                        <class>custom/observer</class>
                        <method>removeMageSetupPriceHint</method>
                    </kitchenking>
                </observers>
            </magesetup_after_product_price>

And this content for the corresponding Observer.php

    /**
     * @mageEvent magesetup_after_product_price
     * 
     * @param type $event
     */
    public function removeMageSetupPriceHint($event)
    {
        if(in_array('catalog_category_view', Mage::app()->getLayout()->getUpdate()->getHandles()) || in_array('catalogsearch_result_index', Mage::app()->getLayout()->getUpdate()->getHandles()))
        {
            $obj = $event->getHtmlObj();
            $obj->setPrefix('');
            $obj->setHtml('');
            $obj->setSuffix('');
        }
    }

Disable for related, upseller, etc on product page

Unfortunately we don't know the context, the price is used. Therefore it is hard to distinguish between the price of the current product and all of the price of the different lists, like related, upseller, etc.

The following hack helped me:

public function magesetupAfterProductPrice(Varien_Event_Observer $observer)
{
    /**
     * Wir kennen den Kontext von dem Preis leider nicht. Auf der Produktseite kommt zuerst der normale Preis
     * und anschließend der related Block. Zählen ist unzuverlässig, also prüfen wir ob der Preis vom aktuell
     * angezeigten Produkt ist, wenn das nicht der Fall ist, entfernen wir Steuer und Versandkosteninfos
     */
    if (!Mage::registry('current_product')) {
        return;
    }
    if (Mage::registry('current_product')->getId() === $observer->getBlock()->getProduct()->getId()) {
        return;
    }
    $obj = $observer->getHtmlObj();
    $obj->setPrefix('');
    $obj->setHtml('');
    $obj->setSuffix('');
}