小编Meh*_*ran的帖子

如何在woocommerce中按日期获取用户订单?

我正在寻找一种标准方式来获取用户在日期范围或当月的总订单数.

在探索了woocommerce源代码之后,我得到的是,woo正在使用这样的东西

            $order_item_amounts = $this->get_order_report_data( array(
            'data' => array(
                '_line_total' => array(
                    'type'            => 'order_item_meta',
                    'order_item_type' => 'line_item',
                    'function' => 'SUM',
                    'name'     => 'order_item_amount'
                ),
                'post_date' => array(
                    'type'     => 'post_data',
                    'function' => '',
                    'name'     => 'post_date'
                ),
                '_product_id' => array(
                    'type'            => 'order_item_meta',
                    'order_item_type' => 'line_item',
                    'function'        => '',
                    'name'            => 'product_id'
                ),
            ),
            'where_meta' => array(
                'relation' => 'OR',
                array(
                    'type'       => 'order_item_meta',
                    'meta_key'   => array( '_product_id', '_variation_id' ),
                    'meta_value' => $this->product_ids,
                    'operator'   => 'IN'
                ),
            ),
            'group_by' …
Run Code Online (Sandbox Code Playgroud)

php wordpress plugins woocommerce

4
推荐指数
1
解决办法
9761
查看次数

标签 统计

php ×1

plugins ×1

woocommerce ×1

wordpress ×1