Tagged: acf, custom fields, Product page
-
AuthorPosts
-
December 11, 2015 at 1:23 pm #551018
Hello
I use your enfold child theme.
In the directory I have the woocommerce folder and inside my single-product.php.I want to display on product pages a new tab (next to : Description, Reviews, vendor ratings and shipping) containing a custom field created with ACF.
At the moment I can display this field called ‘_wcv_custom_product_ingredients’ but it displays below the box containing the tabs.How could I include in in that group to get a new tab containing my custom field?
My single-product.php :
<?php /** * The Template for displaying all single products. * * Override this template by copying it to yourtheme/woocommerce/single-product.php * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } get_header( 'shop' ); ?> <?php /** * woocommerce_before_main_content hook * * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) * @hooked woocommerce_breadcrumb - 20 */ do_action( 'woocommerce_before_main_content' ); ?> <?php while ( have_posts() ) : the_post(); ?> <?php wc_get_template_part( 'content', 'single-product' ); ?> <?php the_field('_wcv_custom_product_ingredients'); ?> <?php endwhile; // end of the loop. ?> <?php /** * woocommerce_after_main_content hook * * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) */ do_action( 'woocommerce_after_main_content' ); ?> <?php /** * woocommerce_sidebar hook * * @hooked woocommerce_get_sidebar - 10 */ do_action( 'woocommerce_sidebar' ); ?> <?php get_footer( 'shop' ); ?>If anyone could help me find the right direction I’d be grateful.
Thanks
NicolasDecember 14, 2015 at 3:44 pm #552378Anyone?
December 14, 2015 at 6:02 pm #552515Hey Nicolas!
Check this article:
https://docs.woothemes.com/document/editing-product-data-tabs/Cheers!
JosueDecember 14, 2015 at 10:03 pm #552628Thanks very much Josue, it works perfectly now :)
-
AuthorPosts
- The topic ‘ACF : displaying a custom field as a new tab in product page’ is closed to new replies.
