
- MODX 3
- PHP 8.2
- Vue 3


Classic store grid: cards with image, price, badges, and add to cart. Products from a selected category.

Информация
Requires PageBuilder Pro and miniShop3.
Category search uses mgr/ms3/categories/search. parent is required. An empty limit becomes 12 in the chunk. The type is "cacheable": false.
Before the chunk, ProSectionRenderSupport writes parent_id and pb_parent_resource. It maps sortby to ms_sortby and ms_sortdir:
sortby | ms_sortby | ms_sortdir |
|---|---|---|
menuindex | msProduct.menuindex | ASC |
popular | Data.popular | DESC |
new | Data.new | DESC |
price_asc | Data.price | ASC |
price_desc | Data.price | DESC |
An unknown value sorts like menuindex. An empty category shows the chunk text «В этой категории пока нет товаров.»
| Parameter | Value |
|---|---|
| key | products_grid |
| Layer | Pro |
| Category | commerce (commerce) |
| Chunk | pagebuilderpro_products_grid |
| Requires | pro, minishop3 |
Fill these fields in the section inspector. Field types are documented in the field types reference.
title) Type text. Optional.
parent) Type relation. Required. Pick one MODX resource in a search modal.
limit) Type number. Optional.
sortby) Type select. Optional. Dropdown with predefined options.
pb-products-grid via msProducts.
Example payload after save. Media, video, and map values may be enriched on output:
{
"title": "Section title",
"parent": 101,
"limit": 6,
"sortby": "menuindex"
}Fenom chunk pagebuilderpro_products_grid:
{set $catalogParent = $parent.id|default:($parent_id|default:0)}
{set $listing = ''}
{if $catalogParent}
{set $listing = $modx->runSnippet('msProducts', [
'parents' => $catalogParent,
'depth' => 10,
'limit' => $limit|default:12,
'tpl' => 'pagebuilderpro_ms3_product_row',
'includeVendorFields' => '*',
'includeOptions' => 'color,size',
'withCurrency' => 1,
'showZeroPrice' => 1,
'sortby' => $ms_sortby|default:'msProduct.menuindex',
'sortdir' => $ms_sortdir|default:'ASC'
])}
{/if}
<section class="pb-section pb-section--products-grid pb-products-grid pb-listing{if $cssClass} {$cssClass|escape}{/if}" data-pb-section="products_grid"{if $id} id="pb-{$id|escape}"{/if}>
<div class="pb-section__inner">
{if $title}
<h2 class="pb-heading">{$title|escape}</h2>
{/if}
{if $listing}
<div class="pb-listing__grid">
{$listing}
</div>
{else}
<p class="pb-listing__empty">{'pagebuilder_fe_listing_empty_products' | lexicon}</p>
{/if}
</div>
</section>