Types: CartNetTotals to RemoveBundlesButtonProps
The types of @poltura/theme-sdk/cart, CartNetTotals to RemoveBundlesButtonProps.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/cart';CartNetTotals
The cart totals without tax.
itemsrequiredMoneyThe items without tax.
discountrequiredMoneyThe discounts without tax.
shippingrequiredMoneyShipping without tax.
taxrequiredMoneyThe tax added on top of the net total.
totalrequiredMoneyThe total without tax.
CartPageView
What the cart page shows beside the cart itself.
recommendationsrequiredreadonly ProductCard[]Products suggested to add, at most four.
minimumOrderrequiredMinimumOrder | nullThe minimum order value not reached yet, or null.
bundlePriceReviewrequiredBundlePriceReview | nullThe changed bundle price to accept, or null when no bundle price changed.
CartResult
The outcome of a cart action.
okrequiredtrueThe action worked.
CartState
The cart with the actions that change it; the host runs every mutation.
cartrequiredCart | nullThe cart, or null before the shopper has one.
statusrequired'loading' | 'ready' | 'error'Whether the cart is loading, ready, or failed to load.
addrequired(input: CartAddInput) => Promise<CartResult>Adds a variant to the cart and opens the mini cart.
setQuantityrequired(lineId: string, quantity: number) => Promise<CartResult>Changes a line's quantity.
removerequired(lineId: string) => Promise<CartResult>Removes a line and its bundle components.
applyCoderequired(code: string) => Promise<CartResult>Applies a code, trying it as a gift card first and then as a discount.
removeCoderequired(code: string) => Promise<void>Removes an entered discount code.
removeGiftCardrequired(giftCardId: string) => Promise<void>Removes an applied gift card.
checkoutrequired() => voidGoes to checkout; does nothing while a change is in flight.
isBusyrequiredbooleanWhether any change is in flight.
miniCartrequiredMiniCartStateThe mini cart's open state.
CartTotals
What the cart adds up to.
itemsrequiredMoneyThe items before discounts.
discountrequiredMoneyThe discounts taken off.
shippingrequiredMoneyShipping.
taxrequiredMoneyThe tax in the total.
giftCardrequiredMoneyThe gift card credit taken off.
totalrequiredMoneyWhat the shopper pays.
netrequiredCartNetTotals | nullThe same totals without tax, or null when the market has no tax split.
taxIncludedrequiredbooleanWhether the prices include tax.
taxPendingrequiredbooleanWhether tax is not worked out yet, so the total is not final.
taxRatePercentrequirednumber | nullThe tax rate as a percentage, or null when rates are mixed or unknown.
MiniCartState
The mini cart's open state.
openrequiredbooleanWhether the mini cart is open.
setOpenrequired(open: boolean) => voidOpens or closes the mini cart.
MinimumOrder
The minimum order value the cart does not reach yet.
minimumrequiredMoneyThe minimum order value.
shortfallrequiredMoneyHow much is missing.
basisrequired'gross' | 'net'Whether the minimum is measured with or without tax.
CartButtonClassKey
The parts of CartButton that take their own classes.
type CartButtonClassKey = 'icon' | 'label' | 'count'CartButtonProps
Props of CartButton.
icon'cart' | 'bag'The icon: a cart or a bag.
showLabelbooleanWhether the word "Cart" shows beside the icon; omitted shows it from large screens up.
countPlacement'inline' | 'overlay'Where the item count sits: beside the icon, or as a badge over it.
labelLayout'inline' | 'stack'Whether the label sits beside the icon or under it.
classNamestringClasses added to the button.
classesPartial<Record<CartButtonClassKey, string>>Classes added to the icon, the label and the count.
MiniCartProps
Props of MiniCart.
surface'popover' | 'sheet'The surface it fills: the desktop popover, or the narrow side sheet with larger touch targets and wallet buttons.
onClose() => voidCalled when a link inside it is followed, so the surface around it can close.
classNamestringClasses added to the mini cart.
CartLineItemProps
Props of CartLineItem.
linerequiredCartLineThe line to show, from `useCart().cart.lines`.
compactbooleanDraws the narrow layout the mini cart uses, for drawers and side panels.
classNamestringClasses added to the line.
CartLineQuantityProps
Props of CartLineQuantity.
linerequiredCartLineThe line whose quantity it changes.
classNamestringClasses added to the stepper.
CartLineRemoveProps
Props of CartLineRemove.
linerequiredCartLineThe line it removes, with its bundle items.
classNamestringClasses added to the button.
CartSummaryProps
Props of CartSummary.
cartrequiredCartThe cart whose totals it lists.
classNamestringClasses added to the summary.
CartCodeFormProps
Props of CartCodeForm.
classNamestringClasses added to the form.
CartCodesProps
Props of CartCodes.
cartrequiredCartThe cart whose entered codes it lists.
classNamestringClasses added to the list.
CheckoutButtonProps
Props of CheckoutButton.
labelstringThe button text; the translated default when omitted.
classNamestringClasses added to the button.
EmptyCartProps
Props of EmptyCart.
headingstringThe heading; the translated default when omitted.
bodystringThe line under the heading; the translated default when omitted.
continueLabelstringThe button text; the translated default when omitted.
continueHrefstringWhere the button goes; the product listing when omitted.
classNamestringClasses added to the empty state.
CartRecommendationsProps
Props of CartRecommendations.
itemsrequiredreadonly ProductCard[]The products to suggest; the first four are shown.
classNamestringClasses added to the section.
MinimumOrderNoticeProps
Props of MinimumOrderNotice.
minimumrequiredMinimumOrderThe minimum order value not reached yet.
classNamestringClasses added to the notice.
BundlePriceNoticeProps
Props of BundlePriceNotice.
reviewrequiredBundlePriceReviewThe changed bundle price.
classNamestringClasses added to the notice.
CartLockBannerProps
Props of CartLockBanner.
classNamestringClasses added to the banner.
RemoveBundlesButtonProps
Props of RemoveBundlesButton.
classNamestringClasses added to the row around the button.