• Resolved dcbuffalo

    (@dcbuffalo)


    I’m struggling to figure out where this information gets stored in the system, or how to pass it via the automated WooCommerce emails. I have tested the fields, and the responses show up in the cart and during the checkout process, but they don’t appear to be stored anywhere for the order, and they are definitely not passed via email. I’m collecting information that is crucial to the order, and I need to be able to access it beyond that initial customer experience. (I’m not sure how it would be useful to anyone otherwise.)

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Maarten

    (@maartenbelmans)

    Hi @dcbuffalo

    So if you complete a purchase and go to the admin order screen, you do not see any of the options being added to the product? Can you send a screenshot of an order screen?

    Thread Starter dcbuffalo

    (@dcbuffalo)

    I tested it again and the info is actually getting passed through to the orders now. (Who knows.) Could you possibly tell me . . . what portion of the WooCommerce Order email code in email-order-details.php relates to this metadata?

    Plugin Author Maarten

    (@maartenbelmans)

    The data is saved as order item meta data in WooCommerce. It should also already be included in the order emails. If that’s not the case, we have to find out what’s wrong. Have you tried disabling all other plugins except ours and WooCommerce?

    Thread Starter dcbuffalo

    (@dcbuffalo)

    Sorry if I wasn’t clear, it’s also being passed through the order emails. I am going to want/need to do a little bit of email customization, and this is the bit in email-order-items.php (sorry again, quoted the wrong file above) that seems related:

    // allow other plugins to add additional product information here.
    do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
    
    		wc_display_item_meta(
    			$item,
    			array(
    				'label_before' => '<strong class="wc-item-meta-label" style="float: ' . esc_attr( $text_align ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
    			)
    		);
    
    // allow other plugins to add additional product information here.
    do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
    
    ?>
    Plugin Author Maarten

    (@maartenbelmans)

    Our data is stored as order item meta so the code you showed above indeed seems what you’d need to edit, depending on what you want.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding Product Field Responses to WooCommerce Emails’ is closed to new replies.