Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving and Ordering a mixture of normal priced and sale priced products #855

Open
FourthElementLtd opened this issue May 14, 2024 · 0 comments

Comments

@FourthElementLtd
Copy link

Hi team,

Here's a simple query

query MyQuery2 {
products(where: {categoryId: 854, orderby: {field: PRICE, order: ASC}}) {
nodes {
name
sku
}
}
}

So this will pull out the first ten products in the category based on the price ascending, all good so far.

However, some of the products in that category are on sale, so if I render this query on the front end, it will obviously ignore the Sale price and render the products in the order of their original RRP/MSRP.

How can I extend this query to include the Sale Price so the Sale Price becomes part of the ordering, but retain the ability to pass the endCursor to manage pagniation for when it comes to our larger categories where we'll have upwards of 100 products in them?

Appreciate any help and advice! Thank you

Darren.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant