lundi 28 mai 2018

How can i display "Conditional" custom text on WooCommerce Order Email

I'm trying to display some "conditional" custom text on the "Order Complete" email, which is sent to the customers when an order is marked as completed.

I have used the following code from, Business Blommer.

Now, I want to make this code conditional, so this code should only be active for the "Gift" Category products. I couldn't find any appropriate Woocommerce functions for this particular functionality.

Any help would be appreciated.

Thank You So Much.

add_action( 'woocommerce_email_before_order_table', 
'bbloomer_add_content_specific_email', 20, 4 );

function bbloomer_add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
if ( $email->id == 'customer_completed_order' ) {
    echo '<p class="email-text-conditional">Thank you for your order with Adventure Clues, we have sent your recipient the gift card’</p>';
}
}

(https://businessbloomer.com/woocommerce-add-extra-content-order-email/)

Aucun commentaire:

Enregistrer un commentaire