Usage

import { getDisplayedPrices } from "@slicekit/core"

const { displayedPrice, displayedFullPrice, isDiscounted, discountPercentage } =
  await getDisplayedPrices({
    product,
    ethUsd
  })

Parameters

product
ProductCart
required
Product to display the price of.
ethUsd
bigint
required
Current ETH to USD rate, with 6 decimal places.

Return Type

displayedPrice
string
Produce price the buyer has to pay.
displayedFullPrice
string
Produce price the buyer has to pay, excluding discounts.
isDiscounted
boolean
Boolean indicating if the product is discounted.
discountPercentage
number
Percentage of discount applied to the product.