Free cookie consent management tool by TermsFeed Generator
All Products & Integrations

jalpi page builder docs

Product Elements

WooCommerce product grid backed by a real WC_Query, with skins, five pagination modes and AJAX add-to-cart.

Jalpi CoreDeveloper
4 min read Β· November 2026

products-grid β€” WooCommerce product grid backed by a real WC_Query, with skins, five pagination modes and AJAX add-to-cart. It is a bespoke widget with a dedicated PHP renderer and editor components.

Identity#

FieldValue
Widget nameProducts Grid
Node type (node.type)products-grid
Palette groupWooCommerce
Implementation pathBespoke (dedicated PHP element class + hand-written editor preview)
Available in the Elements panelYes
PHP element classJalpi_Element_Products_Grid
Editor canvas previewProductsGridPreview
Inspector Content tabProductsGridContent
Inspector Style tabProductsGridStyleTab
Needs the frontend scriptYes

Purpose#

WooCommerce product grid backed by a real WC_Query, with skins, five pagination modes and AJAX add-to-cart.

Where it is registered#

Editor β€” WIDGET_REGISTRY in admin/editor/src/widgets/registry.ts with bespoke: true. The registry entry carries palette metadata and the seed defaultNode only; behaviour comes from the dedicated components.

Server β€” Jalpi_Element_Products_Grid is listed in Jalpi_Renderer::register_elements() and keyed by its type() return value, 'products-grid'.

Sanitizer β€” 'products-grid' is in the $allowed_types array of Jalpi_Sanitizer::sanitize_node(), and sanitize_content() has a dedicated case 'products-grid' branch.

Content schema (node.content)#

These are the keys that survive Jalpi_Sanitizer::sanitize_content(). Anything else sent by a client is discarded on save.

KeyType / allowed valuesDefaultNotes
skin'classic' | 'cards' | 'minimal''classic'
perPageinteger 1–1008
rows / useRowsinteger 1–20 / boolean1 / falseWhen useRows is on, the page size is columns Γ— rows
equalHeight / masonrybooleantrue / false
sourcelatest | featured | sale | best-selling | top-rated | related | upsells | cross-sells | manual'latest'
categories / tags / brandscomma list of slugs or ids''
includeProducts / excludeProducts / includeIds / excludeIdscomma list of ids''Digits only β€” they feed post__in / post__not_in
stockStatusany | instock | outofstock | onbackorder'any'
productStatuspublish | private | any'publish'
orderBydate | title | price | popularity | rating | menu_order | rand | modified'date'
order'ASC' | 'DESC''DESC'
offsetinteger 0–100000
showImage / showSaleBadge / showTitle / showRating / showPrice / showAddToCartbooleantrue
showExcerpt / showWishlist / showCompare / showQuickView / showCategories / showSkubooleanfalse
secondaryImage / showQuantity / ignoreStickybooleanfalse
lazyLoad / ajaxAddToCartbooleantrue
buttonTextstring''
paginationnone | numbers | prev-next | load-more | infinite'none'
loadMoreText / emptyMessage / emptyIconstring'Load More' / 'No products found.' / 'πŸ›’'

Settings schema (node.settings)#

Keys accepted by Jalpi_Sanitizer::sanitize_settings() for this type, in addition to the shared keys every node has (cssId, cssClass, cssClasses, customCss, bgNormal/bgHover, overlayNormal/overlayHover, borderNormal/borderHover, and the st_* Split Animation group).

KeyType / allowed valuesDefaultNotes
pg_cols_desktop / pg_cols_tablet / pg_cols_mobilestring'4' / '2' / '1'
pg_col_gap / pg_row_gapstring px'24' / '32'
pg_img_ratio / pg_img_fit / pg_img_hover / pg_img_sizestring'1/1' / 'cover' / 'zoom' / 'woocommerce_thumbnail'
pg_card_align / pg_card_radiusstring'left' / '12'
pg_badge_pos / pg_btn_icon / pg_btn_icon_posstring'top-left' / 'none' / 'before'

Rendering#

Editor canvas β€” ProductsGridPreview in admin/editor/src/widgets/ProductsGridPreview.tsx. CanvasNode builds the inline preview style by layering Design-System token values, attached reusable classes, the node's own styles, then the active breakpoint's tabletStyles/mobileStyles.

Frontend β€” Jalpi_Element_Products_Grid::render() returns a single root tag scoped by the CSS selector .jalpi-el.jalpi-{id}, and pushes its rule set into the renderer with $renderer->add_css(). That single-root-tag contract is what lets the interaction engine inject data-jalpi-interact on any widget without per-widget code.

Behaviour β€” the element calls $renderer->set_needs_js('generic'), so assets/js/jalpi-frontend.js is enqueued. Each init*() function in that file guards on its own DOM selector, so nothing runs on pages that do not contain this widget.

Capabilities inherited from the node model#

Every node type β€” including this one β€” gets the following for free, because they operate on the tree rather than on any single widget:

  • Style tab β€” typography, colours, background, border, shadow, spacing.
  • Advanced tab β€” margin, padding, per-device visibility, CSS ID / class, reusable classes, per-element Custom CSS.
  • Responsive overrides β€” tabletStyles and mobileStyles sibling maps, plus hideOn.
  • Animation tab β€” the Interaction Engine (node.interactions) and the Split Animation group (settings.st_*).
  • Design System links β€” node.globalStyleRef for atomic tokens and composite typography/button presets.
  • Editor operations β€” copy, paste, duplicate, lock, drag-reorder, undo/redo, save as template, revision history.

Code Examples#

Minimal node JSON#

The shape this widget takes inside `page_data.sections`. Ids must be unique across the whole tree.

{
  "id": "products_grid_a1b2c3d",
  "type": "products-grid",
  "content": {
    "skin": "…",
    "perPage": "…",
    "rows": "…",
    "equalHeight": "…",
    "source": "…",
    "categories": "…"
  },
  "styles": {}
}

Notes#

Good to know

  • Query building lives in Jalpi_Woo_Query::build_args() and is filterable through jalpi_products_grid_query_args.
  • Pagination and add-to-cart run through admin-ajax.php actions jalpi_pg_page and jalpi_pg_cart (Jalpi_Woo_Ajax), both nonce-checked with the jalpi_pg action.
  • With WooCommerce inactive the grid still renders and paginates using Jalpi_Woo_Placeholder demo products.
Source

Files

includes/elements/class-jalpi-element-products-grid.php admin/editor/src/widgets/ProductsGridPreview.tsx admin/editor/src/components/panels/PropertiesPanel.tsx admin/editor/src/widgets/registry.ts includes/class-jalpi-sanitizer.php includes/class-jalpi-renderer.php assets/js/jalpi-frontend.js

Classes

Jalpi_Element_Products_Grid

Functions

render type