Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Echo product title in woo commerce

At the bottom of every product I want to add the sentence:

Any Questions about "Product Name", get in touch with us

The code I'm using is

<h1>Questions about <?php the_product); ?> get in touch</h1>

This however doesn't seem to work, how do I pull the product name in Woocommerce?

like image 847
Adam Scot Avatar asked Dec 09 '22 14:12

Adam Scot


1 Answers

It's outdated question, but if anybody is looking like me these days:

<? echo $product->post->post_title; ?>

or get full html title element:

<? echo woocommerce_template_single_title(); ?>

Works for Woocommerce 2.5+

like image 152
Tomas Chudjak Avatar answered Dec 11 '22 10:12

Tomas Chudjak