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:
| Source | Description | Compatible Facet Types |
|---|---|---|
| wc:stock_status | Product stock status: instock, outofstock, onbackorder | checkbox, dropdown, radio, button_group, toggle |
| wc:on_sale | Whether the product has a sale price set | toggle, checkbox |
| wc:attribute:pa_color | WC product attribute taxonomy (replace pa_color with your attribute) | checkbox, dropdown, color, button_group |
| taxonomy:product_cat | WooCommerce product category taxonomy | checkbox, radio, dropdown, hierarchy |
| taxonomy:product_tag | WooCommerce product tag taxonomy | checkbox, dropdown |
| post_meta:_price | Product price (raw, WC-formatted for display) | range |
| post_meta:_sale_price | Sale price | range |
| post_meta:_regular_price | Regular (non-sale) price | range |
| post_meta:_wc_average_rating | Average customer rating (0.0–5.0) | rating, range |
| post_meta:_stock_quantity | Stock quantity as a numeric value | range |
| post_meta:_weight | Product weight | range |
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 StatusGenerates a meta_query on _stock_status with compare='IN'. Values: instock, outofstock, onbackorder.
wc:on_saleOn SaleCalls 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 AttributesGenerates 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 RangeGenerates 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 FilterGenerates 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_priceFormatted product price with sale/regular display. Handles simple, variable, grouped, and external products. Shows original + sale price with configurable layout.
wc_sale_badgeShows '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_ratingStar rating display using WooCommerce's _wc_average_rating meta. Settings: max stars, show review count, show numeric value.
wc_stock_badgeIn Stock / Out of Stock / Backorder status badge. Configurable labels and colors per status.
wc_add_to_cartNative 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:
| Tag | Resolves 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 |
