在订单成功页面获取相应的产品信息
2011-12-20 23:58
246 查看
在订单成功页面,也即感谢页面,获取产品的SKU,价格等信息,以加强客户的印象,同时还用于其他的用途,话不多说,且看代码如下:
<?php $_customerId = Mage::getSingleton('customer/session')->getCustomerId(); $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); $order = Mage::getSingleton('sales/order'); $order->load($lastOrderId); $_totalData =$order->getData(); $_sub = $_totalData['subtotal'];//USD ==> global_currency_code,base_currency_code order_currency_code // Incase if it is simple do this ==> https://www.emjcd.com/u?AMOUNT= $_sub; //print_r($order); print_r($_totalData); $_order = $this->getOrder(); $allitems = $order->getAllItems(); $index = 1; $cjData = "";//Needed format ==> &ITEM1=3214sku&AMT1=13.49&QTY1=1&ITEM2=6577sku&AMT2=7.99&QTY2=2& foreach($allitems as $item) { $cjData.="&ITEM".$index."=".$item->getSku()."&AMT".$index."=".$item->getPrice()."&QTY".$index."=".$item->getQtyToShip(); $index++; } ?> <div style="display:none;"> <img src="https://www.emjcd.com/u?CID=id&OID=<?php echo $this->getOrderId(); ?>&TYPE=type<?php echo $cjData; ?>&CURRENCY=USD&METHOD=IMG" height="1" width="20"> </div>
相关文章推荐
- 权限判断——用户登录成功是才能查看相应的信息,登录失败不能查看并且返回登录页面
- 信息获取需求及相应产品
- 分页查询产品信息案例;第一步:创建产品页面,向服务器发送请求(获取所有产品信息)
- mysql+jsp,在jsp页面连接了数据库,已成功获取数据库字段,请问如何取到当前用户对应的信息
- Android Studio 中实现高德定位并获取相应信息
- python---get请求https的页面,并获取html返回的内容信息
- 解决iis7.5服务器上.net 获取不到https页面的信息
- 在jsp页面中获取JavaBean的属性信息
- struts2中怎么获取session,jsp页面参数信息的值
- POST信息模拟登录获取页面内容
- 在父页面中获取iframe子页面元素进行相应操作
- Grails在xx.gsp页面获取配置文件信息
- jquery中使用ajax获取远程页面信息
- vp_页面信息所有获取
- 信息时代不被淘汰,获取成功需有的十种能力
- 如何用js得到当前页面的url信息方法(JS获取当前网址信息)
- asp.net获取客户端请求页面信息
- js获取当前页面的url网址信息
- 如何用js得到当前页面的url信息方法(JS获取当前网址信息)
- 如何用js得到当前页面的url信息方法(JS获取当前网址信息)