Closed pimago closed 2 months ago
The availableForPurchasable
query param has been moved to the variant/purchasable
You would need to do:
{% set products = craft.products()
.hasVariant({ hasStock: true, availableForPurchase: true })
.orderBy('defaultPrice DESC')
.all() %}
We will fix that in the upgrade guide before release. Thanks.
What happened?
Description
I updated to Craft and Commerce 5. When I load templates that use availableForPurchase() I get an error
Calling unknown method: craft\commerce\elements\db\ProductQuery::availableForPurchase()
This is my product query
Craft CMS version
5.0.4
Craft Commerce version
5.0.0-beta.3
PHP version
8.2.9
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
-