Actually, this revision works better, no need to use a product tag, still for functions.php.
I realised that this wasn’t a “fault” as such, the badge sticks to the featured image (or the first product image) of the product you are viewing, this snip will bypass this and force the sticker to appear on top at all times.
I’ll leave it here in case anyone else wants to use it:
add_action( 'woocommerce_before_single_product_summary', 'product_page_sale_price' );
function product_page_sale_price() {
global $product;
if ( $product->is_on_sale() ) {
?>
<style>
.NEWSALEBADGE {
z-index: 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;
top: 12px;
left: 12px;
font-size: 10px;
background: red;
border-color: white;
color: white !important;
position: absolute;
border: none;
border-top-color: currentcolor;
border-right-color: currentcolor;
border-bottom-color: currentcolor;
border-left-color: currentcolor;
text-align: center;
color: #fff;
font-size: 1em;
font-weight: 700;
width: 45px;
height: 45px;
line-height: 45px;
border-radius: 45px;
padding: 0; }
.onsale {
display: none;
}
</style>
<div class="NEWSALEBADGE">SALE</div>
<?php
} else {
echo '';
}
}