Skip to main content

shopify-money

Accepts query a reference to a Money object, and uses the store's country and language market to format it correctly. This component must be a child of a shopify-context component. The component takes a query attribute that defines the context it's a part of, and the field to query. This component produces a text node with the formatted price.

Usually you want a product price to update based on the selected variant, so make sure to reference the product.selectedOrFirstAvailableVariant.price field if you are using the shopify-variant-selector component.

See the playground for more complete examples.

Anchor to query
query
string
required

Defines the context to reference and field to query. For example query="product.title" would query the title of the product context.

Anchor to format
format

The format of the price. Defaults to money.


Was this page helpful?