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

[5.x]: Unknown column 'commerce_products.promotable' in 'where clause' #3483

Closed
stanislavprokopov opened this issue May 6, 2024 · 2 comments

Comments

@stanislavprokopov
Copy link

stanislavprokopov commented May 6, 2024

What happened?

Description

Using this in twig:

{% set sale = craft.products().hasVariant({ hasSales: true }).all() %}

Causes:

Column not found: 1054 Unknown column 'commerce_products.promotable' in 'where clause'

Caused by this line

$query->andWhere(['commerce_products.promotable' => true]);

Steps to reproduce

Add example to twig and refresh page.

Expected behavior

Should work i guess or should be another way of getting products/variants on sale.

Actual behavior

Craft CMS version

5.1.1

Craft Commerce version

5.0.3

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Copy link

linear bot commented May 6, 2024

@lukeholder lukeholder self-assigned this May 7, 2024
@lukeholder
Copy link
Member

Thanks for reporting.

This has been fixed for the next release.

To get the fix early, change your craftcms/commerce requirement in composer.json to:

"require": {
  "craftcms/commerce": "5.x-dev#d3f822b6a0e898b06a7590432f1acb22e9a38530 as 5.0.3",
  "...": "..."
}

Then run composer update.

I will let you know here once the release is out.

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

No branches or pull requests

2 participants