Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/cart

cart

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

The cart: its lines, totals, codes and gift cards, the state and actions the cart hook returns, and the cart page's parts.

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

Hooks

NameWhat it is
useCartThe cart with its actions, usable anywhere on the storefront.
useCartPageWhat the cart page shows beside the cart: recommendations, the minimum order and a changed bundle price.

Parts

NameWhat it is
CartLineItemOne cart line: image, title, variant, delivery note, personalisation, price, quantity and remove, with its bundle items under it.
CartLineQuantityThe quantity stepper of a cart line, following the store's quantity steps; read-only while the cart is locked.
CartLineRemoveThe button that removes a cart line; renders nothing while the cart is locked.
CartSummaryThe order summary: subtotal, shipping, tax, discounts, gift cards and the total, on the visitor's price basis.
CartCodeFormThe field that applies a gift card or discount code, with the entered codes under it.
CartCodesThe discount codes the shopper entered, each with its status and a remove button.
CheckoutButtonThe button that goes to checkout; disabled while a change runs or the cart blocks checkout.
EmptyCartWhat the cart shows when it holds nothing: an icon, a heading, a line and a button back to the shop.
CartRecommendationsProducts suggested to add to the cart, each with its own add button; renders nothing while the cart is locked.
MinimumOrderNoticeHow much is missing to the minimum order value, with a progress bar.
BundlePriceNoticeThe notice that a bundle price changed, with the new total and the button that accepts it.
CartLockBannerThe banner of a cart an app has locked, such as a quote: what holds it, a way back to an editable cart and a link to the app's page.
RemoveBundlesButtonA row with the button that removes every bundle from the cart, its items with it; a failure shows as a toast.

Defaults

NameWhat it is
CartButtonThe header's cart button: the item count, and the mini cart it opens, a popover on large screens and a side sheet below.
MiniCartThe mini cart's body: compact lines, the total, the minimum order, and the cart and checkout buttons, or its empty and loading states.

Constants

NameWhat it is
cartRegionsThe cart template's regions, where merchants place blocks.

Types

NameWhat it is
BundleModeHow a bundle in the cart was put together.
BundlePriceReviewA bundle price the shop changed since the shopper added the bundle, which they must accept before paying.
CartThe shopper's cart.
CartAddInputWhat to add to the cart.
CartCodeA discount code the shopper entered.
CartCodeStatusWhether an entered code takes effect: now, once a checkout fact is known, or not at all.
CartErrorA failed cart action, with a message ready to show.
CartErrorCodeWhy a cart action failed.
CartGiftCardA gift card applied to the cart.
CartLineOne line of the cart, with the bundle components folded under it.
CartLineBundleThe bundle a cart line belongs to.
CartLineGiftCardDeliveryWho a gift card in the cart goes to and when it is sent.
CartLinePersonalizationA text the shopper entered to personalise a cart line, with the field's label.
CartLinePreorderThe delivery date a shopper agrees to by ordering a pre-order line.
CartLineStateWhether a cart line is being changed and what went wrong with the last change.
CartNetTotalsThe cart totals without tax.
CartPageViewWhat the cart page shows beside the cart itself.
CartResultThe outcome of a cart action.
CartStateThe cart with the actions that change it; the host runs every mutation.
CartTotalsWhat the cart adds up to.
MiniCartStateThe mini cart's open state.
MinimumOrderThe minimum order value the cart does not reach yet.
CartButtonClassKeyThe parts of CartButton that take their own classes.
CartButtonPropsProps of CartButton.
MiniCartPropsProps of MiniCart.
CartLineItemPropsProps of CartLineItem.
CartLineQuantityPropsProps of CartLineQuantity.
CartLineRemovePropsProps of CartLineRemove.
CartSummaryPropsProps of CartSummary.
CartCodeFormPropsProps of CartCodeForm.
CartCodesPropsProps of CartCodes.
CheckoutButtonPropsProps of CheckoutButton.
EmptyCartPropsProps of EmptyCart.
CartRecommendationsPropsProps of CartRecommendations.
MinimumOrderNoticePropsProps of MinimumOrderNotice.
BundlePriceNoticePropsProps of BundlePriceNotice.
CartLockBannerPropsProps of CartLockBanner.
RemoveBundlesButtonPropsProps of RemoveBundlesButton.
Utoljára frissítve