Created
August 8, 2023 06:24
-
-
Save wooxperto/82628019339d8dcf3cd14c3543999331 to your computer and use it in GitHub Desktop.
Display advance custom field at WooCommerce single product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @snippet Display advance custom field at single product | WooCommerce | |
* @author WooXperto | |
* @date 08.08.2023 | |
*/ | |
if( !function_exists("wooXperto_display_acf_custom_field_at_single_product")){ | |
function wooXperto_display_acf_custom_field_at_single_product(){ | |
echo '<b>Trade Price:</b> ' . get_field('trade_price'); | |
// Note: 'trade_price' is the slug of the ACF | |
} | |
} | |
add_action("woocommerce_product_meta_start","wooXperto_display_acf_custom_field_at_single_product"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment