• Resolved kunzi

    (@kunzi)


    I have used this code to get the most sold products:

    $top_selling_products = wc_get_products( array(
                    'limit' => '4',
                    'meta_key' => 'total_sales', 
                    'return'   => 'ids', 
                    'orderby'  => array( 'meta_value_num' => 'DESC', 'title' => 'ASC' ),
                ) );

    How can I limit products by price so that it would show only products that cost at least 30 dollars?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    I am not a developer, but I understand you would like to get the most sold products that where price is less than 30.

    You can get that information from the database using a query, and then you will get that info, see this article for more information.

    I hope this points you in the right direction.

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    I’m marking this as resolved since it’s been awhile since you responded. We’ll be here if/when you need us.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get most sold products with minimum price’ is closed to new replies.