Skip to main content

Interface: ProductGridConfig

Defined in: context/ProductGridContext.tsx:28

Tier 2 grid config context. Collapses the feature-flag/display and callback props that ProductGrid otherwise cascades through ProductCard/ClusterCard down to AddToCart/ItemStock. ProductGrid is the provider; the card subtree consumes via useProductGridConfig() instead of receiving ~20 threaded props.

Prop-name aliases are resolved here to a single canonical name:

  • ProductGrid stockValidation -> enableStockValidation (ProductGrid addToCartLabels stays as-is; ProductCard already maps it to AddToCart's labels prop at its existing render site.)

Properties

addToCartComponent?

optional addToCartComponent?: ComponentType<AddToCartComponentProps>

Defined in: context/ProductGridContext.tsx:90

Replaces the default add-to-cart control.


addToCartLabels?

optional addToCartLabels?: Record<string, string>

Defined in: context/ProductGridContext.tsx:61

Localised label overrides forwarded to each card's AddToCart component.


afterAddToCart?

optional afterAddToCart?: (cart, item?) => void

Defined in: context/ProductGridContext.tsx:69

Called after an item is successfully added to the cart.

Parameters

cart

Cart

item?

CartMainItem

Returns

void


allowAddToCart?

optional allowAddToCart?: boolean

Defined in: context/ProductGridContext.tsx:41

When true, cards render the add-to-cart control.


allowIncrDecr?

optional allowIncrDecr?: boolean

Defined in: context/ProductGridContext.tsx:47

When true, cards show quantity increment/decrement steppers.


badgesComponent?

optional badgesComponent?: ComponentType<BadgesComponentProps>

Defined in: context/ProductGridContext.tsx:94

Replaces the default product / cluster badges block.


bulkPricesComponent?

optional bulkPricesComponent?: ComponentType<ProductBulkPricesComponentProps>

Defined in: context/ProductGridContext.tsx:100

Replaces the default product-bulk-prices block on a PDP.


bundlesComponent?

optional bundlesComponent?: ComponentType<ProductBundlesComponentProps>

Defined in: context/ProductGridContext.tsx:98

Replaces the default product-bundles block on a PDP.


cartId?

optional cartId?: string

Defined in: context/ProductGridContext.tsx:51

Target cart ID that add-to-cart actions operate on.


childItems?

optional childItems?: number[]

Defined in: context/ProductGridContext.tsx:53

Child product IDs to add alongside the main product (bundle/cluster children).


clusterCardComponent?

optional clusterCardComponent?: ComponentType<object & Record<string, unknown>>

Defined in: context/ProductGridContext.tsx:110

Replaces the whole ClusterCard rendered inside ProductGrid / ProductSlider.


columns

columns: number

Defined in: context/ProductGridContext.tsx:31

Number of columns the grid renders cards in.


createCart?

optional createCart?: boolean

Defined in: context/ProductGridContext.tsx:43

When true, adding an item creates a cart if none exists yet.


enableAddFavorite?

optional enableAddFavorite?: boolean

Defined in: context/ProductGridContext.tsx:39

When true, cards show the add-to-favorites control.


enableStockValidation?

optional enableStockValidation?: boolean

Defined in: context/ProductGridContext.tsx:49

When true, add-to-cart validates the requested quantity against stock. Aliased from ProductGrid's stockValidation prop.


favoriteComponent?

optional favoriteComponent?: ComponentType<FavoriteComponentProps>

Defined in: context/ProductGridContext.tsx:96

Replaces the default add-to-favorite control.


imageComponent?

optional imageComponent?: ComponentType<ImageComponentProps>

Defined in: context/ProductGridContext.tsx:92

Replaces the default product / cluster image block.


notes?

optional notes?: string

Defined in: context/ProductGridContext.tsx:55

Free-text note attached to items added to the cart.


onCartCreated?

optional onCartCreated?: (cart) => void

Defined in: context/ProductGridContext.tsx:67

Called when a new cart is created during an add-to-cart action.

Parameters

cart

Cart

Returns

void


onClusterClick?

optional onClusterClick?: (cluster) => void

Defined in: context/ProductGridContext.tsx:79

Called when a cluster card is clicked.

Parameters

cluster

Cluster

Returns

void


onProceedToCheckout?

optional onProceedToCheckout?: () => void

Defined in: context/ProductGridContext.tsx:71

Called when the user chooses to proceed to checkout.

Returns

void


onProductClick?

optional onProductClick?: (product) => void

Defined in: context/ProductGridContext.tsx:77

Called when a product card is clicked.

Parameters

product

Product

Returns

void


onRequestQuoteClick?

optional onRequestQuoteClick?: (cart) => void

Defined in: context/ProductGridContext.tsx:73

Called when the user clicks the request-a-quote action.

Parameters

cart

Cart

Returns

void


onToggleFavorite?

optional onToggleFavorite?: (item, isFavorite) => void

Defined in: context/ProductGridContext.tsx:75

Called when a product/cluster favorite is toggled; isFavorite is the new state.

Parameters

item

Product | Cluster

isFavorite

boolean

Returns

void


price?

optional price?: number

Defined in: context/ProductGridContext.tsx:57

Explicit unit price override passed to add-to-cart.


priceComponent?

optional priceComponent?: ComponentType<PriceComponentProps>

Defined in: context/ProductGridContext.tsx:86

Replaces the default price block in cards / PDP / cart row / order row.


priceLabels?

optional priceLabels?: Record<string, string>

Defined in: context/ProductGridContext.tsx:63

Localised label overrides forwarded to the embedded <ProductPrice> display inside each card.


productCardComponent?

optional productCardComponent?: ComponentType&lt;object & Record&lt;string, unknown>>

Defined in: context/ProductGridContext.tsx:108

Replaces the whole ProductCard rendered inside ProductGrid / ProductSlider.


showAvailability?

optional showAvailability?: boolean

Defined in: context/ProductGridContext.tsx:37

When true, cards display the availability indicator.


showModal?

optional showModal?: boolean

Defined in: context/ProductGridContext.tsx:45

When true, the add-to-cart flow opens a confirmation modal.


showPrice?

optional showPrice?: boolean

Defined in: context/ProductGridContext.tsx:33

When true, cards display the product price.


showStock?

optional showStock?: boolean

Defined in: context/ProductGridContext.tsx:35

When true, cards display the stock level / status.


stockComponent?

optional stockComponent?: ComponentType&lt;StockComponentProps>

Defined in: context/ProductGridContext.tsx:88

Replaces the default stock / availability block.


stockLabels?

optional stockLabels?: Record&lt;string, string>

Defined in: context/ProductGridContext.tsx:59

Localised label overrides for stock-status text rendered on cards.


surchargesComponent?

optional surchargesComponent?: ComponentType&lt;ProductSurchargesComponentProps>

Defined in: context/ProductGridContext.tsx:102

Replaces the default surcharges block on a PDP / cart row.