AppmakerDeveloper

useShopifyProduct

The useShopifyProduct hook is used to get the product data in a specific format by passing the product node.

ParamsDescription
productProduct node to be fetched

Usage


import { useShopifyProduct } from '@appmaker-xyz/shopify';

const {
    compareAtPriceRange,
    priceRange,
    onSale,
    tags,
    salePercentage,
    availableForSale,
    product,
    title,
    imageUrl,
    regularPrice,
    regularPriceWithCurrency,
  } = useShopifyProduct({ product });

useShopifyProductV2

Another version of the useShopifyProduct hook is useShopifyProductV2 which is used to get the product data in a specific format by passing the product node.

Usage


import { useShopifyProductV2 } from '@appmaker-xyz/shopify';

const {
    id,
    title,
    featureImageUrl,
    images,
    openProduct,
    regularPriceWithCurrency,
    salePriceWithCurrency,
    isOnSale,
    salePercentage,
    firstAvailableVariant,
    finalRegularPrice,
    finalSalePrice,
    salePrice,
    regularPrice
    } = useShopifyProductV2({ product });