Title: wordpress conditional function for processing order template
Last modified: October 22, 2020

---

# wordpress conditional function for processing order template

 *  Resolved [el.severo](https://wordpress.org/support/users/elsevero/)
 * (@elsevero)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/)
 * I am looking for right WordPress conditional function, like: `is_confirmation_email_template()`.
 * I have a custom filter which is used in e-mail templates that gets sent to the
   customer and would like to know if its confirmation e-mail or not in order to
   display / include some texts or not.
 * Right now I only have (for conditional statements):
 * `is_order_received_page() && is_view_order_page()`
 * Anyone?
    -  This topic was modified 5 years, 11 months ago by [el.severo](https://wordpress.org/support/users/elsevero/).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13569375)
 * The ones you do have aren’t WordPress functions, since WordPress doesn’t have
   anything about orders. You should ask in the support forum for whatever plugin
   you are using.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13569640)
 * You could use the “wp_mail” filter to check for telltale signs of the target 
   email, like a unique string fragment in the subject. In the same filter callback
   you can alter the message body. This is a very generic filter, nearly all WP 
   emails go through it. You’d be better off finding one that’s more specific to
   order confirmations. Doesn’t your current filter callback collect adequate data
   to determine the nature of the email? Such as by searching for a unique string
   fragment?
 * For information specific to your ecommerce plugin, I second Joy’s recommendation.
 *  Thread Starter [el.severo](https://wordpress.org/support/users/elsevero/)
 * (@elsevero)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13570078)
 * Hi guys,
 * Thanks for the feedback, I’d share more context in order to understand better:
 * Here’s a snapshot of the confirmation order:
    `https://i.imgur.com/N9Z62Em.png`
 * And current code:
 *     ```
       		if (   !is_order_received_page() && !is_view_order_page()) {
   
       				$_currencies = $this->settings->get_list_currencies();
       				$_converted_price = number_format(($price * $_currencies["RON"]['rate']), 2, '.', '');
   
       				$return = '<span class="woocommerce-Price-amount amount">' . $formatted_price . '</span><span class="converted-price"> ' . $_converted_price . " " . $_currencies["RON"]['custom'] . '</span>';
       		}
       ```
   
 * I am displaying two currencies on the site, and when I make the order / payment
   I send the national currency to the third parties (payment processor & courier).
 * Since the plugin does not have support for displaying multiple currencies I come
   up with this customisation but now I have to detect the confirmation e-mail part
   in order to hide the second currency (since its converted again).
    -  This reply was modified 5 years, 11 months ago by [el.severo](https://wordpress.org/support/users/elsevero/).
    -  This reply was modified 5 years, 11 months ago by [el.severo](https://wordpress.org/support/users/elsevero/).
 *  Thread Starter [el.severo](https://wordpress.org/support/users/elsevero/)
 * (@elsevero)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13570115)
 * What’s even more strange even if I have the following part:
 *     ```
       if ( is_product_category() == true || is_product() == true || is_front_page() == true || is_front_page() == true) {
   
       $_currencies = $this->settings->get_list_currencies();
       $_converted_price = number_format(($price * $_currencies["RON"]['rate']), 2, '.', '');
   
       $return = '<span class="woocommerce-Price-amount amount">' . $formatted_price . '</span><span class="converted-price"> ' . $_converted_price . " " . $_currencies["RON"]['custom'] . '</span>';
       }
       ```
   
 * The second currency gets displayed, now I’m wondering how the e-mail part is 
   being built.
 *  Thread Starter [el.severo](https://wordpress.org/support/users/elsevero/)
 * (@elsevero)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13570219)
 * Got to the final question:
 *     ```
       if(is_front_page()) {
       //SHOW ONLY ON HOME PAGE
       //BUG: THIS GETS DISPLAYED TO WOOCOMMERCE CONFIRMATION E-MAIL 
       }
       ```
   
 * Why this gets displayed to the WooCommerce confirmation e-mail?
    -  This reply was modified 5 years, 11 months ago by [el.severo](https://wordpress.org/support/users/elsevero/).
 *  Thread Starter [el.severo](https://wordpress.org/support/users/elsevero/)
 * (@elsevero)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13570520)
 * I’ve ended up using: `class_exists( 'WC_Email' )` and it seems to work.

Viewing 6 replies - 1 through 6 (of 6 total)

 The topic ‘wordpress conditional function for processing order template’ is closed
to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 6 replies
 * 3 participants
 * Last reply from: [el.severo](https://wordpress.org/support/users/elsevero/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/wordpress-conditional-function-for-processing-order-template/#post-13570520)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
