Display extra info on your product pages with this PHP code! Showcase a custom ACF field, enhancing your product descriptions effortlessly.
add_action('woocommerce_single_product_summary', 'codebykp_display_custom_product_field', 25);
function codebykp_display_custom_product_field() {
global $product;
$custom_field_value = get_field('custom_product_field', $product->get_id());
if ($custom_field_value) {
echo '<div class="custom-product-field"><h3>Additional Information</h3><p>' . esc_html($custom_field_value) . '</p></div>';
}
}