CompareAtPrice correct on a ProductVariant, but not on Product

Kieran-madefres
Tourist
9 0 0

We have some items on sale, with a `compareAtPrice` higher than the `price`, that are displaying correctly on our website. But when getting the product’s `minVariantPrice` inside both `priceRange` and `compareAtPriceRange` these values are always equal, the `compareAtPrice` never seems to be higher than the actual `price`. However, when accessing those variables inside a `productVariant` they’re different (which is correct). This is consistent on all products with a `compareAtPrice`.

 

Shouldn’t `minVariantPrice` inside `compareAtPriceRange` on a product relate to the cheapest `compareAtPrice` on a variant, whether that is the default variant or not?

0 Likes
vix
Shopify Staff
Shopify Staff
535 105 106

Hi @Kieran-madefres 

 

We are aware of this and will be putting out a fix. Keep an eye on the changelog! 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

marissatraina
New Member
2 0 0

@vix Querying compareAtPriceRange on the Product object does not work for me. I believe it should be a field on the Product object according to the docs. Could this be related and is shopify aware? 

0 Likes
vix
Shopify Staff
Shopify Staff
535 105 106

@Kieran-madefres We just released the fix that correctly returns the compare at price range vs. returning the product price in the range. 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Kieran-madefres
Tourist
9 0 0

Hi @vix , thanks for this, unfortunately a new larger issue seems to have been introduced with this release.

When requesting products via GraphQL (not just MobileBuySDK but using a GraphQL explorer too) we receive an error - see below.

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: 1fcf74e0-e0a8-471b-8548-0343c410abf0 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "1fcf74e0-e0a8-471b-8548-0343c410abf0"
      }
    }
  ]
}

 

By removing fields from our query, we have narrowed the error down to 'currencyCode' on either of 'minVariantPrice' or 'maxVariantPrice' within 'compareAtPriceRange'. Requesting this field seems to cause the error.

Interestingly, if the query is only returning products that all have a different compare at prices to their actual price, e.g our sale collection, then we get no error. So it seems to only surface when requesting currency code for products that don't have a compare at price set.

This is actually breaking many areas of our app as 99% of our collections cannot load.

0 Likes
vix
Shopify Staff
Shopify Staff
535 105 106

@Kieran-madefres Looking into it

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Kieran-madefres
Tourist
9 0 0

Hi @vix, what's the latest on this?

Also, can we mark this question as `not solved` as it's still not solved?

Cheers

0 Likes
vix
Shopify Staff
Shopify Staff
535 105 106

Hi @Kieran-madefres 

 

Still working on re-releasing the fix. We have everything tracked in Github so don't worry too much about the status of the forums - that being said i've marked it as unsolved for now. 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Kieran-madefres
Tourist
9 0 0

Hi @vix,

Are there any updates on when the fix will be released?

Cheers,

Kieran

0 Likes
Kieran-madefres
Tourist
9 0 0

Is there anyone else from Shopify available to update on this? Or @vix ? It's been quite a while since we last heard anything

Cheers,

Kieran

0 Likes