2026-02-28 10:28:13 +01:00
|
|
|
{#
|
|
|
|
|
# Related Products (Bootstrap 5 Override)
|
|
|
|
|
#
|
|
|
|
|
# Renders the related products section below the single product.
|
|
|
|
|
#
|
|
|
|
|
# Expected context:
|
|
|
|
|
# related_products - Array of WC_Product objects
|
|
|
|
|
# columns - Number of columns for the grid
|
|
|
|
|
# heading - Section heading text (filtered)
|
|
|
|
|
#
|
|
|
|
|
# WooCommerce PHP equivalent: single-product/related.php
|
|
|
|
|
#
|
|
|
|
|
# @package WcBootstrap
|
|
|
|
|
# @since 0.1.0
|
|
|
|
|
#}
|
|
|
|
|
|
|
|
|
|
{% if related_products is defined and related_products|length > 0 %}
|
|
|
|
|
<section class="related products mt-5">
|
|
|
|
|
{% set heading = heading|default(__('Related products')) %}
|
|
|
|
|
{% if heading %}
|
2026-02-28 18:50:19 +01:00
|
|
|
<h2 class="h4 mb-4">{{ heading|raw }}</h2>
|
2026-02-28 10:28:13 +01:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{{ woocommerce_product_loop_start() }}
|
|
|
|
|
|
|
|
|
|
{% for product in related_products %}
|
|
|
|
|
{% include 'content-product.html.twig' with { product: product } %}
|
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
{{ woocommerce_product_loop_end() }}
|
|
|
|
|
</section>
|
|
|
|
|
{% endif %}
|