You've already forked wc-bootstrap
22 lines
530 B
Twig
22 lines
530 B
Twig
|
|
{#
|
||
|
|
# Sale Badge (Bootstrap 5 Override)
|
||
|
|
#
|
||
|
|
# Renders a sale badge overlay on product cards.
|
||
|
|
#
|
||
|
|
# Expected context:
|
||
|
|
# product - WC_Product object with:
|
||
|
|
# .is_on_sale() - Whether product is currently on sale
|
||
|
|
# post - Global post object
|
||
|
|
#
|
||
|
|
# WooCommerce PHP equivalent: loop/sale-flash.php
|
||
|
|
#
|
||
|
|
# @package WcBootstrap
|
||
|
|
# @since 0.1.0
|
||
|
|
#}
|
||
|
|
|
||
|
|
{% if product is defined and product.is_on_sale() %}
|
||
|
|
<span class="badge bg-danger position-absolute top-0 start-0 m-2 onsale">
|
||
|
|
{{ __('Sale!') }}
|
||
|
|
</span>
|
||
|
|
{% endif %}
|