You've already forked wc-bootstrap
33 lines
966 B
Twig
33 lines
966 B
Twig
|
|
{#
|
||
|
|
# 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 %}
|
||
|
|
<h2 class="h4 mb-4">{{ heading|esc_html }}</h2>
|
||
|
|
{% 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 %}
|