Hi,
You guys helped me pulling extra data into the order processing mail and it looks like this:
add_action( 'woocommerce_email_after_order_table', 'custom_add_content_specific_email', 20, 4 );
function custom_add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
if ( ($email->id == 'customer_on_hold_order') || ($email->id == 'new_order') ) {
// ID of the CT to get the content from
$target_ct = 1288;
ob_start();
// cycle through each product in the order
foreach ($order->get_items() as $item_id => $item_values) {
// get the product's ID
$product_id = $item_values['product_id'];
// get the related camp's ID
$related_camp_id = toolset_get_related_post( $product_id, 'camp-product' );
// get the content template's output with the related camp post set as the source
echo render_view_template( $target_ct, $related_camp_id );
}
echo ob_get_clean();
}
}
Is it possible to add some details like a title called "Praktisk info" above the data? And also change "Camp name" to "Camp navn"?
You can see the screenshot for explanation
Thanks so much
hi, did this go through? I can not see it on my site with the ticket overview?
Hi Mai,
Thank you for contacting us and I'd be happy to assist.
That content in the email is coming from the content template named "Test CT to show camp details in email".
( yourwebsite.com/wp-admin/admin.php?page=ct-editor&ct_id=1288 )
You can change the text label for the existing fields or add a new one in there.
regards,
Waqar
Thanks Waqar, I found it and i think i got it. Will test later
You're very welcome and please let me know if you have any follow-up questions.
For a new question or concern, please start a new ticket.
My issue is resolved now. Thank you!
Hi Waqar,
So i tested the email and now all the data from the test template is gone. Can you please check and see what I did wrong? Thanks