Title: custom parameter
Last modified: July 31, 2024

---

# custom parameter

 *  Resolved [rdcc34](https://wordpress.org/support/users/rdcc34/)
 * (@rdcc34)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/)
 * Hi can any one give me full code for custom parameter such as tracking link

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

 *  Plugin Support [ashlyjohny](https://wordpress.org/support/users/ashlyjohny/)
 * (@ashlyjohny)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/#post-17927181)
 * Hello [@rdcc34](https://wordpress.org/support/users/rdcc34/) ,
 *     ```wp-block-code
       add_filter('woom_additional_template_params', 'function_name', 10, 2);function function_name($parameters, $order){    $custom_params = array(        "param1" => '',        "param2" => ''    );    if ($order !== null) {        $custom_params = array(            "param1" => 'value1',            "param2" => 'value2'        );    }    $parameters = array_merge($parameters, $custom_params);    return $parameters;}
       ```
   
 * The code mentioned above demonstrates how to provide customised parameters when
   selecting a template message on the WC Messaging template setting page. Once 
   you’ve specified the parameters you require, you can select the template messages
   and matching parameters as needed.
 * For an example you can refer the blog post : [https://sevengits.com/add-custom-parameters-on-wc-messaging-templates/](https://sevengits.com/add-custom-parameters-on-wc-messaging-templates/)
 * Thank you!
 *  Thread Starter [rdcc34](https://wordpress.org/support/users/rdcc34/)
 * (@rdcc34)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/#post-17929204)
 * I use this code but it show error, can any one check it what is wrong
 *     ```wp-block-code
       add_filter('woom_additional_template_params', 'function_name', 10, 2);function function_name($parameters, $order){$custom_params = array("order_total" =&gt; '',);if ($order !== null) {$custom_params = array("order_total" =&gt; $order-&gt;get_total());}$parameters = array_merge($parameters, $custom_params);return $parameters;}
       ```
   
 *  Plugin Support [ashlyjohny](https://wordpress.org/support/users/ashlyjohny/)
 * (@ashlyjohny)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/#post-17929344)
 * Hello [@rdcc34](https://wordpress.org/support/users/rdcc34/) ,
 * Previous code has some styling issues.You can go for the code give below:
 *     ```wp-block-code
       add_filter('woom_additional_template_params', 'woom_add_order_total_to_params', 10, 2); function woom_add_order_total_to_params($parameters, $order) {     $custom_params = array(         "order_total" => '',     );     if ($order !== null) {         $custom_params = array(             "order_total" => $order->get_total()          );     }     $parameters = array_merge($parameters, $custom_params);     return $parameters; }
       ```
   
 * You can refer the blog post : [https://sevengits.com/add-custom-parameters-on-wc-messaging-templates/](https://sevengits.com/add-custom-parameters-on-wc-messaging-templates/)
 * Thank you!
 *  Thread Starter [rdcc34](https://wordpress.org/support/users/rdcc34/)
 * (@rdcc34)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/#post-17930322)
 * Hi can you give me a full code for purched product name and tracking link
 *  Plugin Support [ashlyjohny](https://wordpress.org/support/users/ashlyjohny/)
 * (@ashlyjohny)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/#post-17930702)
 * Hello [@rdcc34](https://wordpress.org/support/users/rdcc34/) ,
 * [https://customdomain.com/product?utm_source=campaign_source&utm_medium=medium&utm_campaign=name&utm_id=campaignID](https://customdomain.com/product?utm_source=campaign_source&utm_medium=medium&utm_campaign=name&utm_id=campaignID)
 * How your tracking link will look like? is it look like above or you have a custom
   tracking link?
 * If you can explain your use case little bit more we can add more supports in 
   upcoming versions.
 * Thank you!

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

The topic ‘custom parameter’ is closed to new replies.

 * ![](https://ps.w.org/wc-messaging/assets/icon-256x256.png?rev=3332248)
 * [Notiqoo – Order Notification & Customer Chat for WooCommerce](https://wordpress.org/plugins/wc-messaging/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-messaging/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-messaging/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-messaging/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-messaging/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-messaging/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [ashlyjohny](https://wordpress.org/support/users/ashlyjohny/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/custom-parameter-2/#post-17930702)
 * Status: resolved