Hello, ziga32,
Please provide us with the FTP and admin panel access details for the websites experiencing issues.
Best regards,
8Theme Team
Solved12 replies3 participantsUpdated by Tony Rodriguez
Another store I have the same problem.
Sale label in settings
https://cleanshot.com/share/j32Rc4x9
Shows ok on archive
https://cleanshot.com/share/ZQmKqqwK
But not on single product page
https://cleanshot.com/share/zmlmlGQL
Tried to translate PRO elements with loco translate but no. What should I do.
another thing, if I enable to show percentage
https://cleanshot.com/share/DHjd0qXz
It does not show on archive
https://cleanshot.com/share/K7Q2M6f2
But it show on single product page
https://cleanshot.com/share/nGwjSXWx
Hello, ziga32,
Please provide us with the FTP and admin panel access details for the websites experiencing issues.
Best regards,
8Theme Team
thank you
Hello, ziga32,
We have noticed that your website is currently using theme version 9.7, while the latest available version is 9.7.2, which includes fixes for the discount label. May we proceed with updating the theme on your website?
Best regards,
8Theme Team
sure, sorry, did not know a minor update will fix this.
Hello, ziga32,
We have updated your theme and plugins. Please check if the issue has been resolved. If not, kindly send us a link to the single product page where the problem occurs.
Best regards,
8Theme Team
Thank you for your clarification. We have added the following code to the functions.php file of your child theme to resolve this issue
function etheme_sale_label_percentage_text( $product_object, $sale_text, $is_single_product = false ) {
$element_options = array();
if ( ! $product_object->is_on_sale() ) {
return $sale_text;
}
$element_options['sale_label_text'] = $sale_text;
$sale_variables = $is_single_product || etheme_get_option( 'sale_percentage_variable', 0 );
$product_type = $product_object->get_type();
if ( $product_type == 'variable' ) {
if ( $sale_variables ) {
$element_options['variation_sale_prices'] = array();
foreach ( $product_object->get_available_variations() as $key ) {
if ( $key['display_regular_price'] == $key['display_price'] ) {
continue;
}
$element_options['variation_sale_prices'][] = (float) round( ( ( $key['display_regular_price'] - $key['display_price'] ) / $key['display_regular_price'] ) * 100 );
}
if ( count($element_options['variation_sale_prices']) )
$element_options['sale_label_text'] = sprintf( esc_html__( 'ZNIŽANO - %s', 'xstore' ), max( $element_options['variation_sale_prices'] ) . '%' );
}
} elseif ( $product_type == 'grouped' ) {
if ( $sale_variables ) {
$element_options['grouped_sale_prices'] = array();
foreach ( $product_object->get_children() as $key ) {
$_product = wc_get_product( $key );
if ( $_product->get_type() == 'variable' && $_product->is_on_sale() ) {
foreach ( $_product->get_available_variations() as $key ) {
if ( $key['display_regular_price'] == $key['display_price'] ) {
continue;
}
$element_options['grouped_sale_prices'][] = (float) round( ( ( $key['display_regular_price'] - $key['display_price'] ) / $key['display_regular_price'] ) * 100 );
}
} else {
if ( $_product->is_on_sale() ) {
$regular_price = (float) $_product->get_regular_price();
$sale_price = (float) $_product->get_sale_price();
if ( $regular_price == $sale_price ) {
continue;
}
$element_options['grouped_sale_prices'][] = (float) round( ( ( $regular_price - $sale_price ) / $regular_price ) * 100 );
}
}
}
$element_options['sale_label_text'] = sprintf( esc_html__( 'ZNIŽANO - %s', 'xstore' ), max( $element_options['grouped_sale_prices'] ) . '%' );
}
} else {
if ( apply_filters( 'etheme_sale_label_percentage', etheme_get_option( 'sale_percentage', 0 ) ) ){
if ( $product_type == 'bundle') {
$element_options['regular_price'] = (float) $product_object->min_raw_regular_price;
$element_options['sale_price'] = (float) $product_object->min_raw_price;
}
else {
$element_options['regular_price'] = (float) $product_object->get_regular_price();
$element_options['sale_price'] = (float) $product_object->get_sale_price();
}
if ( $element_options['regular_price'] && $element_options['sale_price'] ) {
$element_options['sale_label_text'] = sprintf( str_replace('{sales_text}', $element_options['sale_label_text'], __( '{sales_text} %s', 'xstore' )),round( ( ( $element_options['regular_price'] - $element_options['sale_price'] ) / $element_options['regular_price'] ) * 100 ) . '%' );
}
}
}
if ( class_exists( 'WAD_Discount' ) ) {
$all_discounts = wad_get_active_discounts( true );
$product_id = $product_object->get_id();
if ( in_array( $product_type, array( 'variation', 'variable' ) ) ) {
$product_id = $product_object->get_available_variations();
}
foreach ( $all_discounts as $discount_type => $discounts ) {
foreach ( $discounts as $discount_id ) {
$discount_obj = new WAD_Discount( $discount_id );
if ( $discount_obj->is_applicable( $product_id ) ) {
$settings = $discount_obj->settings;
$element_options['sale_label_text'] = sprintf( esc_html__( 'ZNIŽANO - %s', 'xstore' ),$settings['percentage-or-fixed-amount'] . '%' );
}
}
}
}
return $element_options['sale_label_text'];
}
Best regards,
8Theme Team
thank you, works great.
just wondering, should this not be a default way of working or am I missing something?
Hello, ziga32,
The text field with the percentage is not in a completely standard format – it is a single line. However, to ensure that the percentage works correctly with translations, we had to split this line into two parts; otherwise, the percentages were lost during translation.
Best regards,
8Theme Team
many thanky, works great!
Thanks for the support! My topic “Unable to properly show sale badges on single product page and archive” has been successfully resolved.
Dear ziga32,
It’s great having you in our WordPress & WooCommerce community!
Every insight you share helps us refine XStore and build tools that empower thousands of online store owners worldwide.
Leave Feedback →
(takes less than a minute)
Together, we grow stronger with every release.
Topic closed.
The 8Theme Team
The issue related to '‘Unable to properly show sale badges on single product page and archive’' has been successfully resolved, and the topic is now closed for further responses
Free AI store scan · SalesMax
Paste your store address. SalesMax AI shows which upsell moments are missing. No signup.
Free AI speed test · FlashMax
Paste your site address. FlashMax runs Google Lighthouse for phone and desktop, checks Core Web Vitals and lists what to fix. No signup.
Lifestyle BlogFashion
(live demo, opens in a new tab)
Industrial Power Tools StoreElectronics
(live demo, opens in a new tab)
Coffee StoreFood & drinks
(live demo, opens in a new tab)
RestaurantFood & drinks
(live demo, opens in a new tab)
Medical 02Business
(live demo, opens in a new tab)
Bakery StoreFood & drinks
(live demo, opens in a new tab)
Jewellery Niche MarketMarketplace
(live demo, opens in a new tab)
Organic Store 01Food & drinks
(live demo, opens in a new tab)
Marseille 03Fashion
(live demo, opens in a new tab)
DesignersBusiness
(live demo, opens in a new tab)
Landing WatchElectronics
(live demo, opens in a new tab)
InteriorFurniture
(live demo, opens in a new tab)
Spice StoreFood & drinks
(live demo, opens in a new tab)
Chocolate BoutiqueFood & drinks
(live demo, opens in a new tab)
Beauty & CosmeticsBeauty
(live demo, opens in a new tab)
Minimal Fashion 02 StoreFashion
(live demo, opens in a new tab)