My default market is Denmark, and the compare at price is displayed by default on the product page.
However, when I fetch data for this product using the Storefront GraphQL API, the compareAtPrice field returns null
// variant id mentioned below is a dummy one
query Product @inContext(country: DK, language: EN) {
productVariant445: node(id: "gid://shopify/ProductVariant/445") {
...on ProductVariant {
id
title
price {
amount
currencyCode
}
compareAtPrice {
amount
currencyCode
}
}
}
}
The compareAtPrice value only appears in the Storefront API after I disable the “Compare-at price hiding” toggle in Markets => Preferences => Price
Over here: it is mentioned that even though the “Compare-at price hiding” toggle is on, if the default market is eu then we need to show compare at price
How do i handle this in storefront? why is there a disparity here?