Support

Account

Home Forums General Issues Text Field not working in a WooCommerce single-product.php template

Solving

Text Field not working in a WooCommerce single-product.php template

  • Hi all,

    Using the basic text field from ACF in the template from WooCommerce, but nothing is getting shown.

    I have tried the following:

    <?php the_field(‘text’); ?>

    <?php get_field(‘text’); ?>

    Any ideas why it is not showing up? I have gone into a product and added text into the text ACF block.

    Help!

    Thanks!

  • Did you try?

    echo get_field(‘text’, $product->get_id());

    Are you sure your field name is “text”?

    You can see all custom fields on single page using var_dump(get_fields($product->get_id())) and print it out to see if that field exists.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.