Related products
On a product page, shows other SKUs from the same (or chosen) category except the current resource.
Информация
Requires PageBuilder Pro and miniShop3.
Cross-sell on product page
- Excludes current product from picks
- Product page context, no extra snippet
- Category and limit in inspector
Typical placement
- Product page: "You may also like"
- Cart: upsell
- Thank-you page
Page examples
- Product template (MS3): … → Related products → FAQ
- Cart: Related products “Add to order”
Category and exclude
Category, Exclude product (current), Limit. Best on product resource context.
Similar sections
- Curated products for fixed IDs
- Products carousel for generic category strip
Block parameters
| Parameter | Value |
|---|---|
| key | related_products |
| Layer | Pro |
| Category | commerce (commerce) |
| Chunk | pagebuilderpro_related_products |
| Requires | pro, minishop3 |
Inspector fields
Fill these fields in the section inspector. Field types are documented in the field types reference.
Title (title)
Type text. Optional.
Catalog parent (parent)
Type relation. Required. Pick one MODX resource in a search modal.
Exclude product (product)
Type relation. Optional. Pick one MODX resource in a search modal.
Limit (limit)
Type number. Optional.
Sort (sortby)
Type select. Optional. Dropdown with predefined options.
Site output
pb-related-products grid via msProducts.
Section data
Example payload after save. Media, video, and map values may be enriched on output:
{
"title": "Section title",
"parent": 101,
"product": 201,
"limit": 6,
"sortby": "menuindex"
}Chunk template
Fenom chunk pagebuilderpro_related_products:
{var $catalogParent = $parent.id|default:($parent_id|default:0)}
{var $excludeId = $product.id|default:($product_id|default:0)}
{var $listing = ''}
{if $catalogParent}
{var $listing = $modx->runSnippet('msProducts', [
'parents' => $catalogParent,
'depth' => 10,
'limit' => $limit|default:4,
'tpl' => 'pagebuilderpro_ms3_product_row',
'includeVendorFields' => '*',
'includeOptions' => 'color,size',
'withCurrency' => 1,
'showZeroPrice' => 1,
'resources' => ($excludeId > 0) ? ('-' ~ $excludeId) : '',
'sortby' => $ms_sortby|default:'msProduct.menuindex',
'sortdir' => $ms_sortdir|default:'ASC'
])}
{/if}
<section class="pb-section pb-section--related-products pb-related-products pb-listing{if $cssClass} {$cssClass|escape}{/if}" data-pb-section="related_products"{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">No matching products yet.</p>
{/if}
</div>
</section>JSON definition
PageBuilderPro/core/components/pagebuilderpro/sections/related_products.json
