Viewing 1 replies (of 1 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @designique

    Please try this instead:

    add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_product_custom_field', 10, 3 );
    function wpo_wcpdf_product_custom_field ( $document_type, $item, $order )
    {
    	if ( !empty($order) && $document_type == 'invoice' ) {
    		$group_data = get_field( 'heroes', $item['product_id'] ); // ACF group 'heroes'
    		if ( is_array( $group_data ) && array_key_exists( 'name', $group_data ) ) { // ACF subfield 'name'
    			echo '<div class="heroe">Heroe: '.$group_data[ 'name' ].'</div>'; // ACF subfield 'name'
    		}
        }
    }

    Let me know.

Viewing 1 replies (of 1 total)
  • The topic ‘ACF group subfield on an invoice’ is closed to new replies.