简体   繁体   English

未完成Magento订单创建sales_flat_quote_item

[英]Magento Order creation sales_flat_quote_item not being made

I have a module that takes a feed from another site and then imports the orders into magento. 我有一个模块,该模块从另一个站点获取提要,然后将订单导入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. 问题在于,尽管正确创建了订单并在Magento中执行了订单,但这些订单仍未显示在“已订购的产品”报告中。

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. 原因似乎是此报告查看sales_flat_quote_item表以产生其结果,但是我的销售商品没有条目。 They do however appear correctly in sales_flat _order_item. 但是,它们确实正确显示在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? 关于为何我无法在flat_quote_item中获得条目的任何建议?

Why does the Magento model used by the Ordered Products report use the quote table and not the order table? 为什么“订购产品”报告使用的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);
            }

此代码未显示对$item->save$quote->save任何调用,因此可能是您没有保存quote对象。

Why does the Magento model used by the Ordered Products report use the quote table and not the order table? 为什么“订购产品”报告使用的Magento模型使用报价表而不使用订单表?

Because you could have an order, which wasn't paid or was canceled and thus the product wasn't delivered. 因为您可能有未付款或已取消的订单,因此未交付产品。 You still have an order in the system, it just wasn't executed. 您在系统中仍然有一个订单,只是没有执行。 My guess is, that the specific report should only contain successful order, where the products were shipped or at least the quote was sent. 我的猜测是,特定的报告应仅包含成功订购的订单,产品已发货或至少已发送报价的地方。

Any suggestions as to why im not getting an entry in flat_quote_item? 关于为何我无法在flat_quote_item中获得条目的任何建议?

You need to generate the quote, which isn't done automatically on saving an order. 您需要生成报价,但在保存订单时不会自动完成报价。

See the following forums thread to get hints on how to generate the quote: http://www.magentocommerce.com/boards/viewthread/28426/P30/ 请参阅以下论坛主题以获取有关如何生成报价的提示: http : //www.magentocommerce.com/boards/viewthread/28426/P30/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Magento - 向sales_flat_quote_item和sales_flat_order_item添加新列 - Magento - Adding a new column to sales_flat_quote_item and sales_flat_order_item 为什么core_write在Magento CE 1.9.1中的sales_flat_quote_item上不起作用 - Why core_write is not working on sales_flat_quote_item in Magento CE 1.9.1 Magento V1.9 在事件观察器中的 sales_flat_quote_item 更新后超时运行 - Magento V1.9 is running in timeout after sales_flat_quote_item update in event observer **更新**如何在表sales_flat_quote_item中创建新列并使用$ cart-> addProduct添加数据 - **update** How i can create new column in table sales_flat_quote_item and add data with $cart->addProduct 在sales_flat_quote和sales_flat_order_item表中添加额外信息 - Adding extra information in sales_flat_quote and sales_flat_order_item tables Magento-更新sales_flat_order_item表中发票的数量 - Magento - update the qty invoiced in sales_flat_order_item table Magento-客户地址中的自定义属性,在结帐时未复制到sales_flat_order_address和sales_flat_quote_address - Magento - Custom attribute in customer address, not copied to sales_flat_order_address and sales_flat_quote_address on checkout 从magento中的自定义模块在sales_flat_order_item表中添加新字段 - Adding new field in sales_flat_order_item table from custom module in magento 如何在magento中插入sales_flat_order_grid - How to insert into sales_flat_order_grid in magento 如何以编程方式将magento销售规则应用于报价项目 - How to programmatically apply a magento sales rule to an quote item
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM