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?
It’s outdated question, but if anybody is looking like me these days:
or get full html title element:
Works for Woocommerce 2.5+
Please try this line
Note that
echo
use to print the PHP variables value, and every variable in PHP have$
before its name like $the_product.Here is what I use for my product page markups.
try this official solution
https://docs.woocommerce.com/wc-apidocs/source-function-woocommerce_template_loop_product_title.html#742-747
You only need to
echo the_title();
of the product, like any post or page. And where did you get$the_product
variable?