Adding Item Meta after payment, doesn’t make it onto the email until re-send
-
I am adding a piece of item meta to the order once payment is complete.
Using this hook woocommerce_pre_payment_complete
The Complete Order template we are using, prints other item meta which has been set prior to payment.
Viewing the order in WC, the new meta shows, and if I resend the email, it is added to the email.
It is just at the point of order, it is not being added to the email.
This is how the information is being added from the above hook.foreach ( $order->get_items() as $item_id => $item ) {
if ($item->get_product_id() === $myProductId ) {
$item->add_meta_data('My META', $myMeta, true);
$item->save_meta_data();
}
}Please help as we really need this piece of information on the email
- The topic ‘Adding Item Meta after payment, doesn’t make it onto the email until re-send’ is closed to new replies.