【问题标题】:Magento Order creation sales_flat_quote_item not being madeMagento 订单创建 sales_flat_quote_item 未进行
【发布时间】:2012-07-18 10:15:31
【问题描述】:

我有一个模块,它从另一个站点获取提要,然后将订单导入 magento。问题是,尽管订单已正确创建并出现在 Magento 中,但它们并未显示在“已订购产品”报告中。

原因似乎是该报告查看 sales_flat_quote_item 表以生成结果,但我的销售项目没有条目。然而,它们确实正确地出现在 sales_flat _order_item 中。

以下是代码的简化版本。

关于为什么我没有在 flat_quote_item 中获得条目的任何建议?

为什么 Ordered Products 报告使用的 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);
            }

【问题讨论】:

    标签: php zend-framework magento


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      为什么 Ordered Products 报告使用的 Magento 模型使用的是报价表而不是订单表?

      因为您可能有一个未付款或被取消的订单,因此产品未交付。系统中仍有订单,只是没有执行。 我的猜测是,具体的报告应该只包含成功的订单、产品的发货地点或至少报价的发送地点。

      关于为什么我没有在 flat_quote_item 中获得条目的任何建议?

      您需要生成报价,这不会在保存订单时自动完成。

      请参阅以下论坛帖子以获取有关如何生成报价的提示:http://www.magentocommerce.com/boards/viewthread/28426/P30/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-08-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-05-21
        • 1970-01-01
        相关资源
        最近更新 更多