Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <config>
- <modules>
- <Custom_Module>
- <active>true</active>
- <codePool>local</codePool>
- </Custom_Module>
- </modules>
- </config>
- <config>
- <modules>
- <Custom_Module>
- <version>0.1.2</version>
- </Custom_Module>
- </modules>
- <events>
- <checkout_onepage_controller_success_action>
- <observers>
- <send_sms_after_placeorder>
- <class>smsgateway/observer</class>
- <method>sendPlaceOrderSms</method>
- </send_sms_after_placeorder>
- </observers>
- </checkout_onepage_controller_success_action>
- </events>
- </config>
- public function sendPlaceOrderSms(Varien_Event_Observer $observer)
- {
- $orderIds = $observer->getData('order_ids');
- foreach($orderIds as $_orderId)
- {
- $order = Mage::getModel('sales/order')->load($_orderId);
- $items = $order->getAllItems();
- $order_increment_id = $order->getIncrementId();
- $get_billing_mobile = $order->getBillingAddress()->getTelephone();
- foreach ($items as $cartItem)
- {
- if($cartItem->getData('product_type')== 'configurable'){
- $product_name = $cartItem->getName();
- }
- }
- }
- $URL = 'your api url';
- $USERNAME = 'api username';
- $PASSWORD = 'api password';
- $USERID = 'api userid';
- $PHONE = $get_billing_mobile;
- $message = "Your Order # $order_increment_id for $product_name.. has been successfully placed. It should be delivered within 3 to 5 days. Thank you for shopping at example.com";
- $TXT = urlencode ($message);
- $Q = "$URL?user=$USERNAME&pass=$PASSWORD&sender=$USERID&phone=$PHONE&text=$TXT&priority=ndnd&stype=normal";
- $res = implode ('', file ($Q));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement