craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
215 stars 169 forks source link

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

Closed stanislavprokopov closed 2 months ago

stanislavprokopov commented 2 months ago

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 https://github.com/craftcms/commerce/blob/37c8af23fde9a6312812f19d296a5cd57ec05b8f/src/elements/db/VariantQuery.php#L493

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

-

linear[bot] commented 2 months ago

PT-1703 [5.x]: Unknown column 'commerce_products.promotable' in 'where clause'

lukeholder commented 2 months ago

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.