I have a module that takes a feed from another site and then imports the orders into magento. The problem is that despite the orders being created properly and appering in Magento they don't show up in the Products Ordered report.
The reason seems to be that this report looks at the sales_flat_quote_item table to produce its results but there is no entry for my sale items. They do however appear correctly in sales_flat _order_item.
Below is a shortened version of the code.
Any suggestions as to why im not getting an entry in flat_quote_item?
Why does the Magento model used by the Ordered Products report use the quote table and not the order table?
$quote = Mage::getModel('sales/quote')->setStoreId((string) $dataArray->StoreviewId);
if (is_object($product)) {
$product->setPrice(((string) $orderitem->Price) / $reverseRate);
$item = Mage::getModel('sales/quote_item');
$item->setQuote($quote)->setProduct($product);
$item->setData('qty', (string) $orderitem->Quantity);
$item->setCustomPrice((string) $orderitem->Price);
$item->setOriginalCustomPrice((string) $orderitem->Price);
$quote->addItem($item);
}
This code doesn't show any calls to $item->save
or $quote->save
, so it could be that you aren't saving the quote
object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With