Product name not showing on single product page

This topic has 2 replies, 2 voices, and was last updated 1 years, 11 months ago ago by Olga Barlow

  • Avatar: Jennifer
    Jennifer
    Participant
    May 25, 2022 at 13:27

    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>';
       }
    }

    Single product page

    Do you know what can be causing this?
    Best regards,

    Please, contact administrator
    for this information.
    1 Answer
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    May 25, 2022 at 22:00

    Hello,

    1) Go to Theme Options > WooCommerce > Single product > Move Product Name In Breadcrumbs > Off.

    2) Single product displays the badge depending on the hook that you used. You used the woocommerce_single_product_summary, check this guide about hooks positions https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
    So, everything is according to your code. If you want to place that over the image use woocommerce_before_single_product_summary hook. Check label now, please.

    Regards

  • Viewing 2 results - 1 through 2 (of 2 total)

The issue related to '‘Product name not showing on single product page’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.