Site logo

Archived topic

Add/Display custom Field in Single Product Page

1 reply · Started by Ritesh on December 21, 2021

Viewing posts 1–2 of 2

Dear Team,
I want to display 4 custom field/data in Single Product Page. The cognizavest.com is website related to education/coaching, so I am planning to show the trainer data to this single post.

I want to show Trainer Name, Trainer Image, Designation, Trainer Bio Just above the Product Tab
Shown in this screenshot (Graphics Demo) : https://prnt.sc/23vqboa

Current Single Product is https://cognizavest.com/product/certificate-course-in-family-therapy/

These are custom fields https://prnt.sc/23vqsnh (created in custom field plugin)

Looking forward for your support

Ritesh

Hi there,

you can use a Block Element:

https://docs.generatepress.com/article/generate_element_display/

The Element Type will be: Hook

You need to select this Hook: woocommerce_after_single_product_summary
You can see its position in the template here: https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/

And set the Display Rules to Products > All Products

To construct the content you will use the GenerateBlocks plugin as its Headline Block will allow you to set the Dynamic Data type to Post Meta where you can add your Custom Field Names.

More info here;

https://docs.generatepress.com/article/dynamic-data/

For the Image you can use the Dynamic Image block:

https://docs.generatepress.com/article/dynamic-blocks/

This archived topic is closed to new replies.