Open seminarian opened 11 months ago
We're also seeing the same error after upgrading from v2.0.4 to v2.1.4. Nothing else has changed that could have caused the error to appear. The error we have is:
No price information was found for ProductVariant ID "99" in the Channel "default_channel”
The query that causes this is:
query ProductListQuery($options: ProductListOptions) {
products(options: $options) {
items {
...ProductListQueryProductFragment
__typename
}
totalItems
__typename
}
}
fragment ProductListQueryProductFragment on Product {
id
createdAt
updatedAt
enabled
languageCode
name
slug
featuredAsset {
id
createdAt
updatedAt
preview
focalPoint {
x
y
__typename
}
__typename
}
variantList {
totalItems
__typename
}
customFields {
canChooseColor
__typename
}
__typename
}
Variables
{
"options": {
"skip": 0,
"take": 10,
"filter": {
"name": {
"contains": ""
}
},
"sort": {
"createdAt": "DESC"
}
}
}
And the error response is
{
"errors": [
{
"message": "No price information was found for ProductVariant ID \"99\" in the Channel \"__default_channel__\".",
"locations": [
{
"line": 32,
"column": 3
}
],
"path": [
"products",
"items",
4,
"variantList"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": null
}
We're also seeing the same error after upgrading from v2.0.4 to v2.1.4. Nothing else has changed that could have caused the error to appear. The error we have is:
No price information was found for ProductVariant ID "99" in the Channel "default_channel”
The DefaultVariantPriceStrategy inside the core is not falling back anymore if a currency was requested which there is not a price for in the channel. Check that.
Or override the strategy with your own version which suits your business needs.
Hello! Thank you! I'm not sure I follow re:"currency was requested which there is not a price for in the channel" - could you please provide an example? Note that this is the default channel that it complains about - which, as far as I know, has access to all channel-specific variants/prices/currencies..etc.
tldr; the error happens when a currencyCode for a productVariant X channelId combo do not match the channelId's default currency code. Vendure doesn't know what to do with that so it throws an exception. To resolve this I deleted the products that had variants with incorrect currencyCodes and started over. In hindsight, I should have updated the currencyCode associated with the productVariant x channelId combination to match the channel's default currency.
Details below I did a quick investigation before that and I found:
select * from "product_variant_price" where "channelId" = 1;
In hindsight, I could have removed the association of those product variants to the channels that have currency issues then re-assigned them to those channels, hoping that would resolve the currency issues, but I didn't think of this at the time. Deleting the products seemed easier since that's all done in a development instance.
Describe the bug
No price information was found for ProductVariant ID "8" in the Channel "british-isles".
Error message when loading products in subchannelbritish-isles
The cause was Product assigned to
british-isles
which has a custom field of type relation which has PVs configured that are not assigned tobritish-isles
channel.In our case I think the channel-aware custom fields would actually be the solution to use. Because up sell variants are actually channel dependent.
Product variant is not assigned to the channel:
But that specific PV was assigned to a Product assigned to
british-isles
To Reproduce Steps to reproduce the behavior:
Environment (please complete the following information):