• Hello,

    I have a text that I want to dispay as a description on every single product page

    Example: ”Buy this (product name) from our store. This is the best (product name) in the industry. By using this (product name) you save more.”

    I used the epho function but it seems not to work properly.

    <? echo woocommerce_template_single_title(); ?>
    Could some one please help me with that issue, it will be verry appreciated

    P.S.: I use WooCommerce and WordPress

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Claudio Sanches

    (@claudiosanches)

    Depends on you are trying to access it.
    You can use on WooCommerce 3.0:

    global $product;
    
    echo $product->get_name();

    If inside a loop that already have a product instance.

    Or create a new instance:

    $product = wc_get_product( $product_id );
    
    echo $product->get_name();
    Thread Starter softdeveloper

    (@softdeveloper)

    I am sorry for asking, but should I insert those lines of code inside the post itself (text editor) or inside the core file for php the posts?

    Thank you

    Plugin Contributor Mike Jolley

    (@mikejolley)

    This is PHP code, not something for posts.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘echo product name – WordPress/Woocommerce’ is closed to new replies.