You've already forked wc-bootstrap
33 lines
1.1 KiB
Twig
33 lines
1.1 KiB
Twig
|
|
{#
|
||
|
|
# Product Attributes Table (Bootstrap 5 Override)
|
||
|
|
#
|
||
|
|
# Renders product attributes as a Bootstrap striped table.
|
||
|
|
#
|
||
|
|
# Expected context:
|
||
|
|
# product_attributes - Array of attribute objects, each with:
|
||
|
|
# .label - Attribute label
|
||
|
|
# .value - Attribute value (HTML)
|
||
|
|
#
|
||
|
|
# WooCommerce PHP equivalent: single-product/product-attributes.php
|
||
|
|
#
|
||
|
|
# @package WcBootstrap
|
||
|
|
# @since 0.1.0
|
||
|
|
#}
|
||
|
|
|
||
|
|
{% if product_attributes is defined and product_attributes|length > 0 %}
|
||
|
|
<table class="woocommerce-product-attributes table table-sm table-striped mb-0">
|
||
|
|
<tbody>
|
||
|
|
{% for attribute in product_attributes %}
|
||
|
|
<tr class="woocommerce-product-attributes-item">
|
||
|
|
<th class="woocommerce-product-attributes-item__label fw-semibold" scope="row">
|
||
|
|
{{ attribute.label|esc_html }}
|
||
|
|
</th>
|
||
|
|
<td class="woocommerce-product-attributes-item__value">
|
||
|
|
{{ attribute.value|raw }}
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
{% endfor %}
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
{% endif %}
|