我有一个模块,从另一个网站获取订阅源,然后将订单导入到magento。问题是,尽管订单在Magento中正确创建,并且没有显示在“产品已订购”报告中。Magento订单创建sales_flat_quote_item没有生成
原因似乎是,此报告查看sales_flat_quote_item表以生成其结果,但没有我的销售物品的条目。但是,它们在sales_flat _order_item中正确显示。
下面是代码的缩写版本。
任何建议,为什么我没有得到在flat_quote_item条目?
为什么订购产品报告使用的Magento模型使用报价表而不是订单表?
$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);
}