Order products by number of completed sales

I would like to order products in the WP_Query by the number of completed sales.

Something similar to that is the total_sales meta_key, but the count increments if the sale is not completed and does’t decrement if the order is deleted.

I would be grateful if someone could help me.

Read more here:: Order products by number of completed sales

Leave a Reply

Your email address will not be published. Required fields are marked *