Added support for dynamic price suffix in `$addon` data.
This commit is contained in:
parent
dd53c8d62b
commit
e7fa363d8d
|
@ -199,8 +199,14 @@ function wccom_get_star_class( $rating, $index ) {
|
||||||
<?php if ( '$0.00' === $addon->price ) : ?>
|
<?php if ( '$0.00' === $addon->price ) : ?>
|
||||||
<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
|
<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
|
<?php
|
||||||
|
$price_suffix = __( 'per year', 'woocommerce' );
|
||||||
|
if ( $addon->price_suffix ) {
|
||||||
|
$price_suffix = $addon->price_suffix;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
|
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
|
||||||
<span class="price-suffix"><?php esc_html_e( 'per year', 'woocommerce' ); ?></span>
|
<span class="price-suffix"><?php echo esc_html( $price_suffix ); ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php if ( ! empty( $addon->reviews_count ) && ! empty( $addon->rating ) ) : ?>
|
<?php if ( ! empty( $addon->reviews_count ) && ! empty( $addon->rating ) ) : ?>
|
||||||
|
|
Loading…
Reference in New Issue