我想在credit memo collection
order id
文件中php
magento 1.9.x
获取$collection = Mage::getResourceModel('sales/order_creditmemo_collection')
->addFieldToFilter('order_id', $order->getId());
foreach($collection as $item) {
echo $item->getId();
}
以下是我按订单ID获取贷项通知单的代码。
NULL
但它显示SO
我尝试了tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value error/logits/BatchNorm/moving_variance
[[Node: error/logits/BatchNorm/moving_variance/read = Identity[T=DT_FLOAT, _class=["loc:@error/logits/BatchNorm/moving_variance"], _device="/job:localhost/replica:0/task:0/cpu:0"](error/logits/BatchNorm/moving_variance)]]
上提供的各种示例,但他们没有帮助我。
非常感谢任何帮助。
答案 0 :(得分:2)
如果您获得Mage_Sales_Model_Order
类的对象,则可以使用getCreditmemosCollection()
函数获取贷项通知单集合
例如。 $order->getCreditmemosCollection()
它将返回为当前加载的订单创建的所有creditmemo ...
答案 1 :(得分:1)
试试这段代码。
<?php
$orderid = 6; //you order id
$creditMemos = Mage::getResourceModel('sales/order_creditmemo_collection');
$creditMemos->addFieldToFilter('order_id', $orderid);
$creditMemos->setOrder('created_at','DESC');
$creditMemos->load();
foreach ($creditMemos as $creditMemo) {
var_dump($creditMemo->getData());
}
?>
你可以删除这一行以获得完整的收藏。
$creditMemos->addFieldToFilter('order_id', $orderid);