【问题标题】:Magento total orders quantityMagento 总订单数量
【发布时间】:2013-10-20 10:36:30
【问题描述】:

在我的结帐页面 (Magento 1.7.0.2) 上,我想显示我们已经向客户发送了多少包裹。

有人知道如何打印所有订单的数量(所有时间)

我希望有人能用一行代码解决这个问题。 :)

感谢您的建议!

【问题讨论】:

  • 您想显示所有订购商品的数量吗?还是订单总数??

标签: php magento orders


【解决方案1】:

您可以使用以下 SQL 查询获取所有订购数量:

$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql="SELECT sum(total_qty_ordered) total_ordered_quantity FROM `sales_flat_order` where state!='canceled'";
$data = $read->fetchRow($sql);
echo round($data['total_ordered_quantity'],0);

希望对你有帮助!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-25
    • 1970-01-01
    • 1970-01-01
    • 2019-02-12
    • 1970-01-01
    • 2019-08-24
    相关资源
    最近更新 更多