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

price range should not include disabled product variant #1482

Open
simpian opened this issue Mar 22, 2022 · 6 comments
Open

price range should not include disabled product variant #1482

simpian opened this issue Mar 22, 2022 · 6 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@simpian
Copy link
Contributor

simpian commented Mar 22, 2022

Describe the bug
A clear and concise description of what the bug is.

When there are multiple product variant, different variant price, e.g.

color white - 10.99
color red - 14.99

price range is min: 10.99, max: 14.99

if color white is disabled, min should no longer be 10.99, should be 14.99 - 14.99

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • @vendure/core version: 1.5.0
  • Nodejs version
  • Database (mysql/postgres etc):

Additional context
Add any other context about the problem here.

@simpian simpian added the type: bug 🐛 Something isn't working label Mar 22, 2022
@michaelbromley
Copy link
Member

Hi, thanks for the report!
Can you be a bit more explicit with the reproduction? On first glance I am assuming that this is related to the search query? If you could include an example query which produces the bad result that would be helpful. It makes it easier for me to switch into the context of this issue when I come to deal with it 👍

@simpian
Copy link
Contributor Author

simpian commented Mar 22, 2022

image

Hope this helps

operationName: "SearchProducts"
query: "query SearchProducts($input: SearchInput!) {\n  search(input: $input) {\n    items {\n      productId\n      productName\n      productVariantId\n      productVariantName\n      collectionIds\n      inStock\n      productAsset {\n        preview\n        __typename\n      }\n      price {\n        ... on PriceRange {\n          min\n          max\n          __typename\n        }\n        __typename\n      }\n      priceWithTax {\n        ... on PriceRange {\n          min\n          max\n          __typename\n        }\n        __typename\n      }\n      customMappings {\n        ... on CustomProductVariantMappings {\n          limitPerOrder\n          __typename\n        }\n        ... on CustomProductMappings {\n          ranking\n          originalPrice\n          limitPerOrder\n          hasMultiVariant\n          createdAt\n          __typename\n        }\n        __typename\n      }\n      __typename\n    }\n    totalItems\n    __typename\n  }\n}\n"
variables: {input: {groupByProduct: true, term: "", collectionId: "", take: 8, skip: 0,…}}
input: {groupByProduct: true, term: "", collectionId: "", take: 8, skip: 0,…}
collectionId: ""
groupByProduct: true
skip: 0
sort: {inStock: "DESC", createdAt: "DESC", ranking: "DESC"}
createdAt: "DESC"
inStock: "DESC"
ranking: "DESC"
take: 8
term: ""

@michaelbromley
Copy link
Member

Hi, I looked into this and cannot reproduce it successfully. Are you sure that the search index has been updated after disabling the variant?

issue-1482.mp4

@simpian
Copy link
Contributor Author

simpian commented Apr 21, 2022

I still have this issue, I'm wondering if it's because I have a custom search options, that may have overwritten your default filtering options?

@michaelbromley
Copy link
Member

Are you using the DefaultSearchPlugin or ElasticsearchPlugin?

@michaelbromley michaelbromley moved this to 🤔 Under consideration in Vendure OS Roadmap Jul 1, 2022
@martijnvdbrug
Copy link
Collaborator

@simpian Can you provide a minimal reproduction + versions + the search plugin you are using (Default, Elastic, or...)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: 👀 Under consideration
Development

No branches or pull requests

3 participants