0

i need to remove taxes for customers that set a VAT. I created a module

in app/etc/modules/Easylife_Meta.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Meta>
            <codePool>local</codePool>
            <active>true</active>
            <depends>
                <Mage_Catalog />
            </depends>
        </Easylife_Meta>
    </modules>
</config>

in app/code/local/Easylife/Meta/etc/config.xml - the configuration file

    <?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Meta>
            <version>0.0.1</version>
        </Easylife_Meta>
    </modules>
    <global>
        <models>
            <easylife_meta>
                <class>Easylife_Meta_Model</class>
            </easylife_meta>
        </models>
    </global>
        <events>
            <sales_quote_address_collect_totals_before>
                <observers>
                    <easylife_meta>
                        <type>model</type>
                        <class>Easylife_Meta_Model_Observer</class>
                        <method>autoMetaDescription</method>
                    </easylife_meta>
                </observers>
            </sales_quote_address_collect_totals_before>
        </events>
</config>

and in app/code/local/Easylife/Meta/Model/Observer.php - the observe class

<?php 
class Easylife_Meta_Model_Observer {
    public function autoMetaDescription($observer) {
        Mage::log('Hola',null,'logAprowebfile.log',true);
        /*$customer_id = Mage::getSingleton('customer/session')->getId();
        $customer = Mage::getModel("customer/customer")->load($customer_id);
        Mage::log($customer,null,'logAprowebfile.log',true);
        if($customer->getEmail() == 'my@mail.it')
        {
            Mage::log('entrato',null,'logAprowebfile.log',true);
            echo 'yes';
            $items = $observer->getEvent()->getQuote()->getAllVisibleItems();
            foreach($items as $item)
                $item->getProduct()->setTaxClassId(3);
        }*/
    } 
}

But the log doesn't appear to me. What can i do?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.