1

I am using Magento 1.9.1

Here is my config.xml:

<config>
    <modules>
        <VivasIndustries_Smartparser>
            <version>0.1.0</version>
        </VivasIndustries_Smartparser>
    </modules>
    <global>
        <models>
            <smartparser>
                <class>VivasIndustries_Smartparser_Model</class>
            </smartparser>
        </models>
        <events>
        <sales_order_place_after>
            <observers>
                <vivasindustries_smartparser_model_observer>
                    <type>singleton</type>
                    <class>VivasIndustries_Smartparser_Model_Observer</class>
                    <method>clearcartitems</method>
                </vivasindustries_smartparser_model_observer>
            </observers>
        </sales_order_place_after>
        </events>       
        <helpers>
            <smartparser>
                <class>VivasIndustries_Smartparser_Helper</class>
            </smartparser>
        </helpers>
        <blocks>
             <smartparser>
                 <class>VivasIndustries_Smartparser_Block</class>
             </smartparser>                         
         </blocks>      
     </global>   
    <adminhtml>
        <acl>
            <resources>
                <all>
                    <title>Allow Everything</title>
                </all>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <vivasparser>
                                            <title>vivasparser - All</title>
                                        </vivasparser>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
          <layout>
            <updates>
              <smartparser>
                <file>smartparser.xml</file>
              </smartparser>
            </updates>
          </layout>
    </adminhtml>     
</config>

Here is my obsrerver:

<?php

class VivasIndustries_Smartparser__Model_Observer
{
   public function checkPound() {




    Mage::log("$NowTime has started autmated pound currency check rate of $PoundRate status check!", null, "PoundCurrency.log", true);  

    }

    public function clearcartitems($observer)
    {
        $data = $observer->getEvent()->getOrder();
        Mage::log("Order is placed",  null, "Order.log", true);
        Mage::log($data->debug(),  null, "Order.log", true);
    }   
}

However when i place an order there nothing happens. The log is not created. Where is my mistake and how can i fix it ?

2

Replace your class name

class VivasIndustries_Smartparser__Model_Observer

With

class VivasIndustries_Smartparser_Model_Observer
1

Your observer class name looks different than one in XML file, try to remove one not needed underscore. This is class name:

VivasIndustries_Smartparser__Model_Observer

And this is used in XML file:

VivasIndustries_Smartparser_Model_Observer

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.