I need to update the customers data from magento to ERP.
whenever customer going to check out the order,it ask for Guest or Register and checkout. when we select the Register and check out option,it ask for billing information.after filling these details it ask for shipping details,for instance if we select billing address as shipping address,then ask for shipping method(for instance we select free shipping),then ask for payment method(for instance,if we select cash on deliver),after that order review.
how can i send these customer information and order details to our ERP,using event Observer? (iam new to magento,if anyone have idea pls share here).
these files i created,Is there any mistakes these files,please correct here?
Observer.php[app/code/local/Wli/SalesOrderafter/Model]
<?php
class Wli_SalesOrderafter_Model_Observer {
public function SalesOrderafter(Varien_Event_Observer $observer) {
$event = $observer->getEvent();
$order = $order->getBillingAddress()->getEmail();
echo "email:$order";
exit();
}
}
config.xml [app/code/local/Wli/SalesOrderafter/etc]
<config>
<modules>
<Wli_SalesOrderafter>
<version>0.1.0</version>
</Wli_SalesOrderafter>
</modules>
<global>
<events>
<sales_order_place_after>
<observers>
<Wli_SalesOrderafter_sales_order_place_after>
<type>singleton</type>
<class>Wli_SalesOrderafter_Model_Observer</class>
<method>SalesOrderafter</method>
</Wli_SalesOrderafter_sales_order_place_after>
</observers>
</sales_order_place_after>
</events>
</global>
</config>
Wli_SalesOrderafter.xml[app/etc/modules]
<?xml version="1.0"?>
<config>
<modules>
<Wli_SalesOrderafter>
<active>true</active>
<codePool>local</codePool>
</Wli_SalesOrderafter>
</modules>
</config>