Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/cart/Types: BundleMode to CartLineState

Types: BundleMode to CartLineState

Ez az oldal még csak angolul érhető el.

The types of @poltura/theme-sdk/cart, BundleMode to CartLineState.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/cart';

BundleMode

How a bundle in the cart was put together.

type BundleMode = 'addOn' | 'fixed' | 'fbt' | 'bxgy'

BundlePriceReview

A bundle price the shop changed since the shopper added the bundle, which they must accept before paying.

needsReviewrequiredboolean

Whether a changed bundle price waits for the shopper's approval.

proposedTotalrequiredMoney | null

The new total of the changed bundles, or null while it is not known.

loadingrequiredboolean

Whether the new price is loading.

acceptingrequiredboolean

Whether the approval is being sent.

failedrequiredboolean

Whether the last approval failed.

acceptrequired() => Promise<void>

Accepts the new price; the cart reloads with it.

Cart

The shopper's cart.

idrequiredstring

The cart's id.

currencyCoderequiredCurrencyCode

The cart's currency.

linesrequiredreadonly CartLine[]

The lines, with bundle components folded under their bundle.

itemCountrequirednumber

How many units the cart holds.

totalsrequiredCartTotals

What the cart adds up to.

codesrequiredreadonly CartCode[]

The discount codes the shopper entered.

giftCardsrequiredreadonly CartGiftCard[]

The gift cards applied.

minimumOrderrequiredMinimumOrder | null

The minimum order value not reached yet, or null.

checkoutBlockedrequiredboolean

Whether checkout is blocked until the shopper fixes the cart.

CartAddInput

What to add to the cart.

variantIdrequiredstring

The variant to add.

quantitynumber

How many units; 1 when omitted.

personalizationReadonly<Record<string, string>>

The shopper's personalisation texts by field key.

CartCode

A discount code the shopper entered.

coderequiredstring

The code as entered.

statusrequiredCartCodeStatus

Whether it takes effect.

messagerequiredstring | null

What a pending code waits for or why it does not apply, in the page language; null when applied.

tonerequired'success' | 'info' | 'warning'

The tone to show `message` in.

CartCodeStatus

Whether an entered code takes effect: now, once a checkout fact is known, or not at all.

type CartCodeStatus = 'applied' | 'pending' | 'notApplicable'

CartError

A failed cart action, with a message ready to show.

coderequiredCartErrorCode

Why it failed.

messagerequiredstring

The reason in the page language.

CartErrorCode

Why a cart action failed.

type CartErrorCode = 'outOfStock' | 'limitReached' | 'codeExpired' | 'codeUsedUp' | 'codeInvalid' | 'codeRejected' | 'notInCart' | 'unknown'

CartGiftCard

A gift card applied to the cart.

idrequiredstring

The applied card's id; pass it to `removeGiftCard`.

kindrequired'amount' | 'product'

Whether the card carries an amount or redeems for a product.

last4requiredstring

The card code's last four characters.

appliedrequiredMoney

The credit this order uses.

balanceAfterrequiredMoney

What stays on the card after this order; zero for a product card.

productTitlerequiredstring | null

The product a product card redeems for, or null.

CartLine

One line of the cart, with the bundle components folded under it.

idrequiredstring

The line's id; pass it to the cart actions.

productIdrequiredstring

The product's id.

variantIdrequiredstring

The variant's id.

titlerequiredstring

The product's title.

variantTitlerequiredstring | null

The variant's title, or null for a single-variant product.

hrefrequiredstring | null

The product page's path, or null when the product has no page.

imagerequiredMediaImageRef | null

The line's image, or null.

quantityrequirednumber

How many units are in the cart.

unitPricerequiredMoney

The price of one unit as charged.

totalrequiredMoney

The line total as charged.

compareAtTotalrequiredMoney | null

The line total before discounts, or null when nothing was discounted.

netUnitPricerequiredMoney | null

The price of one unit without tax, or null when the market has no tax split.

netTotalrequiredMoney | null

The line total without tax, or null when the market has no tax split.

availabilityrequiredAvailability

Whether the quantity can still be bought.

preorderrequiredCartLinePreorder | null

The delivery promise of a pre-order line, otherwise null.

isDigitalrequiredboolean

Whether the item is delivered digitally.

personalizationrequiredreadonly CartLinePersonalization[]

What the shopper entered to personalise the item.

giftCardDeliveryrequiredCartLineGiftCardDelivery | null

Who a gift card line goes to and when, or null for any other line.

bundlerequiredCartLineBundle | null

The bundle the line belongs to, or null.

componentsrequiredreadonly CartLine[]

The bundle components folded under this line.

staterequiredCartLineState

Whether the line is being changed.

CartLineBundle

The bundle a cart line belongs to.

groupIdrequiredstring

The id shared by every line of this bundle in the cart.

bundleIdrequiredstring

The bundle's id.

titlerequiredstring

The bundle's title.

moderequiredBundleMode

How the bundle was put together: add-on, fixed kit, bought together, or buy X get Y.

itemCountrequirednumber

How many items the bundle holds.

compareAtrequiredMoney | null

The bundle's price before its discount, or null.

CartLineGiftCardDelivery

Who a gift card in the cart goes to and when it is sent.

forSelfrequiredboolean

Whether the shopper buys the card for themselves.

recipientNamerequiredstring | null

The recipient's name, or null.

recipientEmailrequiredstring | null

The recipient's email address, or null when the card is for the shopper.

sendAtrequiredstring | null

The day the card is sent as `YYYY-MM-DD`, or null when it is sent with the order.

CartLinePersonalization

A text the shopper entered to personalise a cart line, with the field's label.

labelrequiredstring

The field's label in the page language.

valuerequiredstring

What the shopper entered.

CartLinePreorder

The delivery date a shopper agrees to by ordering a pre-order line.

expectedrequiredExpectedDate

When the item is expected to ship.

messagerequiredstring | null

The merchant's note to pre-order buyers in the page language, or null.

CartLineState

Whether a cart line is being changed and what went wrong with the last change.

updatingrequiredboolean

A quantity change is in flight.

removingrequiredboolean

A removal is in flight.

errorrequiredstring | null

Why the last change failed, in the page language, or null.

Utoljára frissítve