Hi there,
I have an issue with my single product page.
It is not showing the name of the product. I stead, shows.
I tried disableing all the plugins to see if it was a proble with another plugin compatibilty, but with woocommerce and Xstore plugin activated, it has this issue.
Also, the NEW IN badge is showing on the side, in stead of being over the photo.
Iam using this codes on my function.php to display the NEW IN badge. On the shop page, it show ok, but single product page is being missplaced.
// New badge for recent products ON SHOP
add_action( 'woocommerce_before_shop_loop_item_title', 'new_badge', 3 ); function new_badge() { global $product; $newness_days = 10; // Number of days the badge is shown
$created = strtotime( $product->get_date_created() ); if ( ( time() - ( 60 * 60 * 24 * $newness_days ) ) < $created ) { echo '<span class="new-badge onsale">' . esc_html__( 'NEW', 'woocommerce' ) . '</span>'; } }
// New badge for recent products on single product page
add_action( 'woocommerce_single_product_summary', 'new_badge_single_product', 7 );
function new_badge_single_product() {
global $product;
$newness_days = 30; // Number of days the badge is shown
$created = strtotime( $product->get_date_created() );
if ( ( time() - ( 60 * 60 * 24 * $newness_days ) ) < $created ) {
echo '<span class="itsnew">' . esc_html__( 'NEW', 'woocommerce' ) . '</span>';
}
}
Do you know what can be causing this?
Best regards,