Title: Add order_comments
Last modified: August 28, 2021

---

# Add order_comments

 *  [krakazyabra](https://wordpress.org/support/users/krakazyabra/)
 * (@krakazyabra)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/add-order_comments/)
 * This PR will add order_comments (customer’s comment) to message template:
 * file Classes/WooCommerce.php
 *     ```
       public function filterTemplate($replace){
               $replace['{order_id}'] = $this->order_id;
               $replace['{order_comments}'] = $this->order->get_customer_note();
               $replace['{order_status}'] = wc_get_order_status_name($this->order->get_status());
               $replace['{total}'] = wc_price($this->order->get_total());
               $replace['{order_date_created}'] = $this->order->get_date_created()->date(get_option('links_updated_date_format'));
               return $replace;
           }
       ```
   
 * file Classes/SettingPage.php
 *     ```
       <div class="row">
                   <table class="form-table">
                       <tbody>
                       <tr>
                           <th></th>
                           <td> <button id="nktgnfw_send_test_message" type="button" class="button-primary"><?= __('Send test message','nktgnfw')?></button></td>
                       </tr>
                       <tr>
                           <th><h4><?= __('Allow tags for Telegram Message', 'nktgnfw') ?></h4></th>
                           <td><textarea class="code wp-editor-area" rows="15" readonly><b>bold</b>
       <strong>bold</strong>
       <i>italic</i>
       <em>italic</em>
       <u>underline</u>
       <ins>underline</ins>
       <s>strikethrough</s>
       <strike>strikethrough</strike>
       <del>strikethrough</del>
       <a href="http://www.domain.com/">inline URL</a>
       <code>code</code>
       <pre>code block</pre></textarea></td>
                       </tr>
                       <tr>
                           <th><h4><?= __('Shortcodes for Telegram Message', 'nktgnfw') ?></h4></th>
                           <td><textarea class="code wp-editor-area" rows="15" readonly>{order_comments}
       {order_id}
       {order_date_created}
       {order_status}
       {products}
       {total}
       {billing-first_name}
       {billing-last_name}
       {billing-address_1}
       {billing-address_2}
       {billing-city}
       {billing-state}
       {billing-postcode}
       {billing-email}
       {billing-phone}
       {payment_method}
       {payment_method_title}
       {customer_ip_address}
       {customer_user_agent}
                               </textarea></td>
                       </tr>
                       <tr>
                           <th></th>
                           <td><?= wp_kses(__("Visit <a href='https://choplugins.com' target='_blank'>our website</a> to get more useful plugins", "nktgnfw"), ['a' => ['href' => 'https://choplugins.com','target' =>'_blank']]); ?></td>
                       </tr>
                       </tbody>
                   </table>
               </div>
       ```
   

The topic ‘Add order_comments’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/order-notification-for-telegram_6e71b4.
   svg)
 * [Order Notification for Telegram](https://wordpress.org/plugins/order-notification-for-telegram/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/order-notification-for-telegram/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/order-notification-for-telegram/)
 * [Active Topics](https://wordpress.org/support/plugin/order-notification-for-telegram/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/order-notification-for-telegram/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/order-notification-for-telegram/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [krakazyabra](https://wordpress.org/support/users/krakazyabra/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/add-order_comments/)
 * Status: not resolved