When placing an order with configurable product, Some products ordered twice. For example,
Configurable product sku is fst (full sleeve top)
And its associated product skus are fst_s,fst_m,fst_l (small,medium,large)
I have ordered fst_s with quantity 2 and fst_m with quantity 1 products. After placed an order, Order total amount being wrong. When i inspect an order details, I got following information
In admin, sales order view page, I have only 3 quantity.But, if i get order details via code, I got quantity 5.
Type: configurable
Item Name: Full Sleeve Top
Item Id: 3483
Item Sku: fst_s
Item Qty: 2.0000
Item Price: 20.0000
Type: simple
Item Name: Full Sleeve Top
Item Id: 3484
Item Sku: fst_s
Item Qty: 1.0000
Item Price: 20.0000
Type: configurable
Item Name: Full Sleeve Top
Item Id: 3483
Item Sku: fst_m
Item Qty: 1.0000
Item Price: 20.0000
Type: simple
Item Name: Full Sleeve Top
Item Id: 3485
Item Sku: fst_m
Item Qty: 1.0000
Item Price: 20.0000
Simple product added again with 1 quantity. I don't have an idea, why its happening like this. In admin area, Its showing fine Except order total ($100). In Order invoice, Its showing correct amount- $60(exclude repeated simple product amount). I have placed my code what i have checked below
$order = Mage::getModel('sales/order')->loadByIncrementId(100000003);
$orderItems = $order->getItemsCollection()
->addAttributeToSelect('*')
->load();
foreach($orderItems as $sItem) {
if($sItem->getPrice()==0){continue;}
echo "Type: ".$sItem->getProductType()."<br/>";
echo "Item Name: ".$sItem->getName()."<br/>";
echo "Item Id: ".$sItem->getProductId()."<br/>";
echo "Item Sku: ".$sItem->getSku()."<br/>";
echo "Item Qty: ".$sItem->getQtyOrdered()."<br/>";
echo "Item Price: ".$sItem->getPrice()."<br/>";
}
//print_r($order->getData());
Eagarly awaiting for your response!