Can someone explain to me ?
i wanna simply change sale-flash in woocommerce into 2 type of text, one is "sale", and other is "rent"..
it's working for page that display category of products,,but not working for display a single product..
here's the code
<?php
if(is_product()){
if ( is_product_category( 'Sale' ) ) {
echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product );
}
if ( is_product_category( 'Rental' ) ) {
echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Rent!', 'woocommerce' ) . '</span>', $post, $product );
}
}else{
if ( is_product_category() ) {
if ( is_product_category( 'Sale' ) ) {
echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product );
}
if ( is_product_category( 'Rental' ) ) {
echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Rent!', 'woocommerce' ) . '</span>', $post, $product );
}
}
}
?>
When i access the page of category,,for every product with sale category shows "Sale!" text on the flash,and "Rent!" on the flash for every product with rental category,,,,
but when i click the product with rental category to view their detail, flash still shows "Sale!" text..