从order中得到 Customer 和 Product Info
来源:互联网 发布:linux 创建线程 编辑:程序博客网 时间:2024/05/02 13:13
当有一个订单order,我们想在中间处理一下,得到customer和product的信息,或者做点别的事情,需要懂之间的关系,下面是一段参考代码,从order中得到 Customer 和 Product Info,大致怎么使用magento的items
1
$orderid
=
"1000000054"
;
2
$orderid
=
round
(
substr
(
$orderid
, 1));
3
$order
= Mage::getModel(
'sales/order'
)->load(
$orderid
);
1
<pre>
$orderid
=
"1000000054"
;
2
$order
= Mage::getModel(
'sales/order'
)->loadByIncrementId(
$orderid
);</pre>
1
$giftMessage
= Mage::getModel(
"giftmessage/message"
)->load(
$order
->getGiftMessageId());
2
// then use echo $giftMessage->getMessage();
3
$address
= trim(
$order
->getShippingAddress()->getFormated(true));
4
// then just echo $address (will give you it formatted with \n separating lines)
5
$items
=
$order
->getAllItems();
6
$total
=0;
7
$products
=
array
();
8
foreach
(
$items
as
$item
) {
9
$products
[
"prod"
][] =
$item
->getProductId();
10
$products
[
"qty"
][] =
$item
->getQtyOrdered();
11
$total
+=
$item
->getQtyOrdered();
12
}
13
$total
=
round
(
$total
);
14
// then you have an array of products with id's and corresponding qty's
15
// also echo out the total number of qty's in your order
- 从order中得到 Customer 和 Product Info
- oracle ebs Customer Info
- magento 设置order start id 和 customer start id
- IBM: Customer Order Analysis and Tracking System:从遗留结构到随需应变
- Copy Customer-Material Info Record Data
- 通过得到客户端IP,和从数据库中得到IP位数
- Find Error--Print Customer Order Invoices
- Siebel Customer Order Management 7.8 Overview 1
- Siebel Customer Order Management 7.8 Overview 2
- 从SOCKADDR 中得到IP
- 从view中得到bitmap
- Product Cost by Sales Order
- Product Cost by Sales Order
- oracle 转义符(escape)和order by (从实践中学习Oracle SQL-第二章)
- Reading "Case Study of Customer Input For a Successful Product"
- Flume: Gathering customer product search clicks data using Apache Flume
- Customer
- 从网页源文件中得到链接
- 关于An association from the table refers to an unmapped class
- 异常处理 java.lang.OutOfMemoryError: PermGen space
- 增强magento缓存机制-------magento提速方法
- extern的使用之变量与函数
- phpexcel 读取含多个sheet的excel,将从数据库中检索出的数据分别写入该excel不同的sheet中 并导出该excel
- 从order中得到 Customer 和 Product Info
- 两则寓言打醒自己
- magento不同的用户显示不同的分类和产品
- Ogre笔记十一:基础教程七—CEGUI和OgreII
- 如何去掉多网店的URL中___store 和___from_store
- 计算一个目录下所有文件的大小
- 求个网页QQ聊天连接代码?
- FAQ_12_陌生的VERSION.SDK_INT
- magento URL静态化,固定化,url经常变动的问题的解决