[英]How to Add Custom Attribute on product Grid in magento 1.9.2 community edition
[英]How to get subtotal from order items collection in magento 1.9.2 community edition
這是我的代碼
$orderData = Mage::getSingleton('sales/order')->loadByIncrementId($incrementId);
$itemCollection = $orderData->getItemsCollection();
foreach($itemsCollection as $_items) {
echo $_items->getName();
echo $_items->getStatus();
echo $_items->getOriginalPrice();
echo $_items->getPrice();
echo $_items->getQtyOrdered();
echo $_items->getSubTotal();
echo $_items->getTaxAmount();
echo $_items->getPercent();
echo $_items->getDiscountAmount();
echo $_items->getRowTotal();
}
除了小計,我也嘗試了所有方法:
echo $_items->getBaseSubtotal();
但是我仍然得到空值。 任何幫助將是可觀的
base_subtotal是“訂單”表的字段。
它不是銷售訂單項目表的字段。.所以您沒有從$ _items-> getBaseSubtotal()獲取數據
為了獲得一個銷售項目的基礎總數,請嘗試以下代碼:
$items->getBaseRowTotal();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.