Advertisement
Guest User

Untitled

a guest
Dec 17th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. $args = array(
  2.         'post_type' => array('product'),
  3.         'posts_per_page' => 15,
  4.         'orderby' => 'date',
  5.         'order' => 'DESC',
  6.         'meta_query' => array(
  7.             'relation' => 'OR',
  8.             array( // Simple products type
  9.                 'key'=> '_sale_price',
  10.                 'value' => 0,
  11.                 'compare' => '>',
  12.                 'type' => 'numeric'
  13.             ),
  14.             array( // Variable products type
  15.                 'key' => '_min_variation_sale_price',
  16.                 'value' => 0,
  17.                 'compare' => '>',
  18.                 'type' => 'numeric'
  19.             )
  20.         )
  21.       );
  22.       $sale = new WP_Query($args);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement