Price Hooks
useIgPrices()
useIgPrices()export interface UseIgPricesProps {
productId?: string;
variantId?: string;
originalPrice?: number | string;
originalCompareAtPrice?: number | string;
currencyCode?: string;
}
export interface IgPriceReturn {
value: number | null;
currencyCode: string;
}
export interface DuplicateProductReturn {
productId: string;
variantId: string;
handle: string;
}
export interface UseIgPricesReturn {
igPrice?: IgPriceReturn;
igCompareAtPrice?: IgPriceReturn;
duplicateProduct?: DuplicateProductReturn;
experienceId?: string;
variationId?: string;
isIgPrice: boolean;
isReady: boolean;
}
type UseIgPricesInput = UseIgPricesProps | UseIgPricesProps[];
export type UseIgPricesOutput<T extends UseIgPricesInput> =
T extends UseIgPricesProps[]
? Record<string, UseIgPricesReturn>
: UseIgPricesReturn;
const useIgPrices = <T extends UseIgPricesInput>(
props: UseIgPricesInput
) => UseIgPricesOutputuseIgStyles
useIgStylesLast updated