Woocommerce $ ACF
-
Good afternoon
I have Woocommerce and ACF on my site.
using ACF, I have created a field for the product product_subtitle.
I want the value of this field to be displayed in the admin panel in the order details. such as – https://prnt.sc/8uQq5ajtJxJ7
i am using code in functions.php.
function the_custom_product_subtitle_woo( $item_id, $item, $order, $plain_text){
if( $product_subtitle_woo = get_field( ‘product_subtitle_woo’, $item->get_product_id() )) {
echo ” ” . “$product_subtitle_woo”;
}
}
add_action(‘woocommerce_product_read’, ‘the_custom_product_subtitle_woo’, 20, 4);
but as a result – Fatal error: Uncaught Error
Can someone please help?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Woocommerce $ ACF’ is closed to new replies.