DocumentationAmertaThemeUtilitiesGet product pricingFunctions

Get Product Pricing

amerta


amerta / amerta/theme/utilities/get-product-pricing / getProductPricing

Function: getProductPricing()

getProductPricing(product, currency): { currency: Currency; maxPrice?: undefined; minPrice?: undefined; price: number; quantity: number; salePrice: number | null; trackInventory: boolean; type: string; variants?: undefined; } | { currency: Currency; maxPrice?: undefined; minPrice?: undefined; price: number; quantity: number; salePrice: number; trackInventory?: undefined; type: string; variants: never[]; } | { currency: Currency; maxPrice: number; minPrice: number; price: number; quantity?: undefined; salePrice?: undefined; trackInventory?: undefined; type: string; variants: { barcode: string | null | undefined; image: string | ProductMedia | null | undefined; price: number; quantity: number; salePrice: number | null; sku: string | null | undefined; stockStatus: "in_stock" | "out_of_stock" | "on_backorder"; trackInventory: boolean; variantOptions: {[k: string]: {[k: string]: unknown; name: string; value: string; }; }; }[]; } | null

Defined in: amerta/theme/utilities/get-product-pricing.ts:3

Parameters

| Parameter | Type | | ------ | ------ | | product | Product | | currency | Currency |

Returns

{ currency: Currency; maxPrice?: undefined; minPrice?: undefined; price: number; quantity: number; salePrice: number | null; trackInventory: boolean; type: string; variants?: undefined; } | { currency: Currency; maxPrice?: undefined; minPrice?: undefined; price: number; quantity: number; salePrice: number; trackInventory?: undefined; type: string; variants: never[]; } | { currency: Currency; maxPrice: number; minPrice: number; price: number; quantity?: undefined; salePrice?: undefined; trackInventory?: undefined; type: string; variants: { barcode: string | null | undefined; image: string | ProductMedia | null | undefined; price: number; quantity: number; salePrice: number | null; sku: string | null | undefined; stockStatus: "in_stock" | "out_of_stock" | "on_backorder"; trackInventory: boolean; variantOptions: {[k: string]: {[k: string]: unknown; name: string; value: string; }; }; }[]; } | null