How to get all products with discount with GraphQL or REST

Highlighted
New Member
1 0 0

Hi,

I'm trying to retrieve all shop products having a discount(I think that 'compare_at_price' should be bigger than 'price') using GraphQL or REST. How to do that?

 

Milen

0 Likes
Highlighted
Shopify Staff
Shopify Staff
925 122 130

Hey @mtonev 

 

I'm not sure there's a simple query for this. One approach would be to pull all the products and then compare them. Another approach would be to create an automatic collection with the condition "compare at price greater than 0", and then pull products in that collection (you'd also need to confirm compare_at was > price, but the collection should reduce the amount of work/calls).

0 Likes