WooCommerce Integration

Grid Panda auto-detects WooCommerce and unlocks WC-specific facet sources, card blocks, and dynamic tags. No manual configuration required — activate WooCommerce before Grid Panda and the integration boots automatically.

Activation

The WooCommerce integration is enabled when class_exists('WooCommerce') returns true. Grid Panda detects this at boot and registers the WooCommerce resolver, additional card blocks, and WC-specific dynamic tags. You can also explicitly enable it under Grid Panda → Settings → Integrations.

After enabling WooCommerce, run a full reindex so WC-specific values (stock status, prices, ratings) are added to the index table.

WooCommerce Facet Sources

When creating facets for WooCommerce products, use the wc: source prefix for WC-specific fields, or standard taxonomy: / post_meta:sources for standard WP fields:

SourceDescriptionCompatible Facet Types
wc:stock_statusProduct stock status: instock, outofstock, onbackordercheckbox, dropdown, radio, button_group, toggle
wc:on_saleWhether the product has a sale price settoggle, checkbox
wc:attribute:pa_colorWC product attribute taxonomy (replace pa_color with your attribute)checkbox, dropdown, color, button_group
taxonomy:product_catWooCommerce product category taxonomycheckbox, radio, dropdown, hierarchy
taxonomy:product_tagWooCommerce product tag taxonomycheckbox, dropdown
post_meta:_priceProduct price (raw, WC-formatted for display)range
post_meta:_sale_priceSale pricerange
post_meta:_regular_priceRegular (non-sale) pricerange
post_meta:_wc_average_ratingAverage customer rating (0.0–5.0)rating, range
post_meta:_stock_quantityStock quantity as a numeric valuerange
post_meta:_weightProduct weightrange

WooCommerce Meta Key Mapping

For range facets, Grid Panda automatically maps WC source keys to their internal meta keys:

wc:price          → _price
wc:sale_price     → _sale_price
wc:regular_price  → _regular_price
wc:rating         → _wc_average_rating
wc:weight         → _weight

WooCommerce Query Logic

Grid Panda applies WC-specific query logic when the source is a WC field:

wc:stock_statusStock Status

Generates a meta_query on _stock_status with compare='IN'. Values: instock, outofstock, onbackorder.

wc:on_saleOn Sale

Calls wc_get_product_ids_on_sale() to get the current sale product IDs, then generates post__in (to show on-sale products) or post__not_in (for NOT operator). Results are cached in memory per request.

wc:attribute:pa_*Product Attributes

Generates a tax_query on the product attribute taxonomy (e.g. pa_color). Supports IN, AND, and NOT operators. include_children is applied based on facet config.

post_meta:_price (range)Price Range

Generates a meta_query with compare='BETWEEN', type='DECIMAL(10,4)' on _price. The range bounds are taken from the slider selection.

post_meta:_wc_average_rating (rating)Rating Filter

Generates a meta_query with compare='>=' and type='DECIMAL(3,2)' on _wc_average_rating. In exact mode, uses BETWEEN to match a specific rating tier.

WooCommerce Card Blocks

When WooCommerce is active, the card builder adds these WC-specific blocks:

wc_price

Formatted product price with sale/regular display. Handles simple, variable, grouped, and external products. Shows original + sale price with configurable layout.

wc_sale_badge

Shows 'On Sale', a percentage discount, or a custom label when the product has a sale price. Supports conditional visibility — hidden for non-sale products.

wc_rating

Star rating display using WooCommerce's _wc_average_rating meta. Settings: max stars, show review count, show numeric value.

wc_stock_badge

In Stock / Out of Stock / Backorder status badge. Configurable labels and colors per status.

wc_add_to_cart

Native WooCommerce AJAX Add to Cart button. Renders the standard WC button with quantity input option. Works with WC's own JS and cart handling.

WooCommerce Dynamic Tags

These dynamic tags are available in all text blocks and custom HTML when WooCommerce is active:

TagResolves To
{{wc:price}}WooCommerce formatted price HTML (respects currency position, decimals, etc.)
{{wc:regular_price}}Formatted regular price
{{wc:sale_price}}Formatted sale price (empty if not on sale)
{{wc:rating}}Average rating value (0.0–5.0)
{{wc:review_count}}Number of reviews
{{wc:stock_status}}Stock status slug: instock, outofstock, onbackorder
{{wc:sku}}Product SKU
{{wc:weight}}Product weight (raw)
{{wc:dimensions}}Formatted dimensions (L × W × H)
{{wc:categories}}Comma-joined product category names
{{wc:tags}}Comma-joined product tag names
{{wc:add_to_cart_url}}Add to Cart URL for this product

Recommended WooCommerce Shop Grid Setup

Post Type:Set the grid source to post_type=product, post_status=publish
Facets:Create facets: product categories (hierarchy/checkbox), product attributes (checkbox/color/button_group), price range (range), stock status (checkbox/toggle), rating (rating)
Card:Include featured_image, post_title, wc_price, wc_sale_badge, wc_rating, and wc_add_to_cart blocks
Layout:Grid layout with 3 desktop / 2 tablet / 1 mobile columns and a 20px gap works well for most shops
Pagination:load_more or infinite scroll is preferred for shop grids to keep users in context
Reindex:After setting up all product facets, run Reindex All to populate the index with WC-specific values