The PowerElements add-on added a new element “New Badge” for the WooCommerce site. It will add the “New” or “Hot” or any custom text as a badge to the product list and visitors can easily understand which product(s) newly arrived in the store.
Open your global block of the Post Loop Builder, add the New Badge element on the canvas, and set the Days (Show badge if the product is less than .. days old. Default is 14 days.).
How do you show it on the Product List or WooCommerce Archive template?
We can also add the new badge there. We need some custom PHP code to achieve it. At first, we shall create the global block with the New Badge element only. Later we shall add this code in the code snippet section like the native code block element or WPCodex or Snippets plugin.
add_action('woocommerce_before_shop_loop_item_title', 'pe_add_new_badge_shop_loop' );
function pe_add_new_badge_shop_loop() {
echo do_shortcode('[breakdance_block blockId=1063]');
}
woocommerce_before_shop_loop_item_title is the WooCommerce hook. You will get this hook in plugins/woocommerce/templates/content-product.php file. You can change the hook and place the global block as per your design. 1063 is our global block ID. You will replace it with your global block ID.