Answer the question
In order to leave comments, you need to log in
How to display a label in a product?
How to display the product tag of Wookomers?
1. <?php woocommerce_show_product_loop_sale_flash(); ?>
2. <?php print_r($product) ?>
Answer the question
In order to leave comments, you need to log in
In general, without waiting for an answer ....... I post the answer that I got
<div class="prod__tags">
<?php if ( !empty(woocommerce_show_product_loop_sale_flash()) ) : ?>
<?php woocommerce_show_product_loop_sale_flash(); ?>
<?php else : ?>
<?php endif; ?>
<?php if ( has_term('hit', 'product_tag') ) : ?>
<?php $tagz = get_term_by('slug', 'hit', 'product_tag'); ?>
<div class="prod__tags-item prod__tags-fire">
<span class="prod__tags-item-text"><?php echo $tagz->name; ?></span>
</div>
<?php endif; ?>
<?php if ( $product->is_on_sale() ) : ?>
<div class="prod__tags-item prod__tags-sale">
<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="prod__tags-item-text">' . esc_html__( 'Скидка', 'woocommerce' ) . '</span>', $post, $product ); ?>
</div>
<?php endif;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question