在过去的两天里一直在敲我的头,但无法做到这一点。帮助!!
每当发送发货电子邮件时,我想触发一个代码,该代码将向客户发送短信,通知他/她他/她的订单已发货,并传达跟踪号。
代码将是这样的:
<?php
$url = "http://www.abcde.in/binapi/pushsms.php?usr=xyz&pwd=abc&sndr=MEGYTR&ph=8888829554&text=This is test. MegaYtr&rpt=1";
$result = file_get_contents($url);
?>
问题:1)我从哪里运行这段代码?
2) 我如何获取订单号、客户名称、总计和跟踪号等其他信息。当客户下订单时,我使用以下代码发送短信时做了类似的事情:
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$shipping_address_data = $order_details->getShippingAddress();
$first_name = $shipping_address_data['firstname'];
$telephone = $shipping_address_data['telephone'];
$amount_paid = $order_details->total_paid;
$message = 'Dear '.$first_name.' thank you for shopping at abc.com. Your order'.$this->getOrderId().' amounting to Rs.'.$amount_paid.'is being processed.';
echo '<b>'.$message.' Please check your email for further details.</b>';
我正在使用 Magento 社区 1.7.0.1。