`@deprecated` Use `Money` instead. To migrate, use the `priceType` prop that matches the corresponding property on the `CartLine` object: - `regular`: `cartLine.cost.totalAmount` - `compareAt`: `cartLine.cost.compareAtAmountPerQuantity` For example Before: `<CartLinePrice data={cartLine} priceType="regular" />` After: `<Money data={cartLine.cost.totalAmount} />` The `CartLinePrice` component renders a `Money` component for the cart line merchandise's price or compare at price.
import {CartLinePrice} from '@shopify/hydrogen-react';
export default function ProductCartLinePrice({cartLine}) {
return ;
}
import {CartLinePrice} from '@shopify/hydrogen-react';
import type {CartLine} from '@shopify/hydrogen-react/storefront-api-types';
export default function ProductCartLinePrice({cartLine}: {cartLine: CartLine}) {
return ;
}
A [CartLine object](https://shopify.dev/api/storefront/reference/objects/CartLine).
The type of price. Valid values:`regular` (default) or `compareAt`.
An HTML tag or React Component to be rendered as the base element wrapper. The default is `div`.
Whether to remove the currency symbol from the output.
Whether to remove trailing zeros (fractional money) from the output.
A [UnitPriceMeasurement object](https://shopify.dev/api/storefront/latest/objects/unitpricemeasurement).
Customizes the separator between the money output and the measurement output. Used with the `measurement` prop. Defaults to `'/'`.