开发者

Get row total price from a configurable product in Magento

开发者 https://www.devze.com 2023-02-19 04:44 出处:网络
I\'m writing a payment module, and after the checkout process I\'m doing the following to get the price for each product.

I'm writing a payment module, and after the checkout process I'm doing the following to get the price for each product.

foreach($order-&g开发者_JS百科t;getAllVisibleItems() as $item)
{
//...
$price = (float)$item->getData('row_total_incl_tax');
//...

Afaik it works with any kind of product except configurable ones. How can I retrieve the row total for a configurable product?


It seems Mage_Sales_Model_Order_Item has an isChildrenCalculated method. If true you can use getChildrenItemsto either list the simple products individually or loop through them and add up their row totals.

0

精彩评论

暂无评论...
验证码 换一张
取 消