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

Variants query hasStock(true) not working #1356

Closed
gijsstegehuis opened this issue Apr 3, 2020 · 1 comment
Closed

Variants query hasStock(true) not working #1356

gijsstegehuis opened this issue Apr 3, 2020 · 1 comment

Comments

@gijsstegehuis
Copy link
Contributor

gijsstegehuis commented Apr 3, 2020

Description

Using hasStock(true) on a variant query causes an SQL error:

SQLSTATE[42703]: Undefined column: 7 ERROR: column commerce_variants.hasunlimitedstock does not exist
LINE 8: WHERE (((commerce_variants.stock > 0 AND commerce_variants.h...

Workaround:

.where('stock > 0 or [[hasUnlimitedStock]]')

Additional info

  • Craft version: 3.4.13
  • Commerce version: 3.1.0.1
  • PHP version: 7.4.4
  • Database driver & version: PostgreSQL 11.7
@brandonkelly
Copy link
Member

Thanks for reporting that, @gijsstegehuis! We just released Commerce 3.1.1 with a fix for this.

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

2 participants