@@ 563-591 (lines=29) @@ | ||
560 | * @since 1.9.0 |
|
561 | * @return array $product_query_args |
|
562 | */ |
|
563 | public static function get_paid_products_on_sale_query_args(){ |
|
564 | ||
565 | $args = array( |
|
566 | 'post_type' => 'product', |
|
567 | 'posts_per_page' => 1000, |
|
568 | 'orderby' => 'date', |
|
569 | 'order' => 'DESC', |
|
570 | 'suppress_filters' => 0 |
|
571 | ); |
|
572 | ||
573 | $args[ 'fields' ] = 'ids'; |
|
574 | ||
575 | $args[ 'meta_query' ] = array( |
|
576 | 'relation' => 'AND', |
|
577 | array( |
|
578 | 'key'=> '_regular_price', |
|
579 | 'compare' => '>', |
|
580 | 'value' => 0, |
|
581 | ), |
|
582 | array( |
|
583 | 'key'=> '_sale_price', |
|
584 | 'compare' => '>', |
|
585 | 'value' => 0, |
|
586 | ), |
|
587 | ); |
|
588 | ||
589 | return $args; |
|
590 | ||
591 | } // get_paid_products_on_sale_query_args |
|
592 | ||
593 | ||
594 | /** |
|
@@ 602-630 (lines=29) @@ | ||
599 | * |
|
600 | * @return array |
|
601 | */ |
|
602 | public static function get_paid_products_not_on_sale_query_args(){ |
|
603 | ||
604 | $args = array( |
|
605 | 'post_type' => 'product', |
|
606 | 'posts_per_page' => 1000, |
|
607 | 'orderby' => 'date', |
|
608 | 'order' => 'DESC', |
|
609 | 'suppress_filters' => 0 |
|
610 | ); |
|
611 | ||
612 | $args[ 'fields' ] = 'ids'; |
|
613 | $args[ 'meta_query' ] = array( |
|
614 | 'relation' => 'AND', |
|
615 | array( |
|
616 | 'key'=> '_regular_price', |
|
617 | 'compare' => '>', |
|
618 | 'value' => 0, |
|
619 | ), |
|
620 | array( |
|
621 | 'key'=> '_sale_price', |
|
622 | 'compare' => '=', |
|
623 | 'value' => '', |
|
624 | ), |
|
625 | ); |
|
626 | ||
627 | return $args; |
|
628 | ||
629 | ||
630 | } // get_paid_courses_meta_query |
|
631 | ||
632 | /** |
|
633 | * Get all WooCommerce non-free product id's |