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

PriceRange includes prices of soft deleted product variants #266

Closed
oncode opened this issue Feb 19, 2020 · 1 comment
Closed

PriceRange includes prices of soft deleted product variants #266

oncode opened this issue Feb 19, 2020 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@oncode
Copy link
Contributor

oncode commented Feb 19, 2020

Describe the bug
The PriceRange also includes the prices of the soft deleted product variants when using the search query.

To Reproduce
Steps to reproduce the behavior:

  1. Add a new product with just the default variant and set the price to "10"
  2. Use "Manage variants" to add a new option and fill up with two option values (creates two variants) and set both their prices to "20" and save (confirm the "Delete default variant" dialog) -> the variant with the price "10" will be soft deleted
  3. Execute a search query to the the prices of the product.
query (...) {
  search(...) {
    items {
      price {
        ... on SinglePrice {
          value
        }
        ... on PriceRange {
          min
          max
        }
      }
    }
  }
}

Outputs:

...
"price": {
   "min": 1000,
   "max": 2000
 }
...

Expected behavior
The prices of soft deleted product variants should be ignored/excluded. The output should be:

...
"price": {
   "min": 2000,
   "max": 2000
 }
...

Environment (please complete the following information):

  • @vendure/core version: 0.8.0
  • elasticsearch plugin installed
  • Nodejs version: 12.4.1
  • Database: mysql
@oncode oncode added the type: bug 🐛 Something isn't working label Feb 19, 2020
@oncode oncode changed the title PriceRange includes prices of soft deleted product variants. PriceRange includes prices of soft deleted product variants Feb 19, 2020
@michaelbromley
Copy link
Member

Thanks for the report. Can reproduce when using the ElasticSearchPlugin. DefaultSearchPlugin handles this correctly.

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
None yet
Development

No branches or pull requests

2 participants