Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Colored Order Status

WCMp Advanced Frontend Manager

Resolved
Viewing 8 reply threads
  • Author
    Posts
    • #141965
      donald_punk
      Participant

      Hi, I tried to make the order status colored. Therefore I need a class. I got it working when I rewrite class-wcmp-ajax.php with this code:

      $data[] = apply_filters(‘wcmp_datatable_order_list_row_data’, array(
      ‘select_order’ => ‘<input type=”checkbox” class=”select_’ . $order->get_status() . ‘” name=”selected_orders[‘ . $order->get_id() . ‘]” value=”‘ . $order->get_id() . ‘” />’,
      ‘order_id’ => $order->get_id(),
      ‘order_date’ => wcmp_date($order->get_date_created()),
      ‘vendor_earning’ => ($vendor_order->get_commission_total()) ? $vendor_order->get_commission_total() : ‘-‘,
      ‘order_status’ => ‘<span class=”class_’.esc_html(wc_get_order_status_name($order->get_status())).'”>’.esc_html(wc_get_order_status_name($order->get_status())).'</span>’, //ucfirst($order->get_status()),
      ‘action’ => apply_filters(‘wcmp_vendor_orders_row_action_html’, $action_html, $actions)
      ), $order);

      But I am bad at getting this into a filter. Could you help me on this part? And what do I need to make changes in the dashboard css?

      Thank you for your help!

    • #141980

      @donald_punk, can you please share a scrrenshot and explain what flow are you looking for so we can assist you accordingly.

    • #141983
      donald_punk
      Participant

      Hi Moumita,
      Sorry I didn’t make myself clear. I attached a screenshot. On the status I want to show with color, when there was an error in the order process.

    • #141997

      HI,
      Let us know which status you want in color red.

      Regards,

    • #141999

      HI,
      Let us know which status you want in red colour.

      Regards,

    • #142002
      donald_punk
      Participant

      Hi Abhirup,
      thanks for the fast response and help!

      I would like to have order-status “failed” in red (maybe: “#ff0000”) and order-status “cancelled” in something like “#a0a0a0”.

      Thank you!

    • #142064

      Hi,
      Kindly add below code to your active theme function.php

      add_filter('wcmp_datatable_order_list_row_data', 'wcmp_custom_order_table_modify', 10, 2);
      function wcmp_custom_order_table_modify($data, $order) {
          if ( $order->get_status() == 'failed') {
              $before = '<span style="color:#ff0000">';
              $after = '</span>';
              $data['order_status'] = $before . wc_get_order_status_name($order->get_status()) . $after;
          } else if ($order->get_status() == 'cancelled') {
              $before = '<span style="color:#a0a0a0">';
              $after = '</span>';
              $data['order_status'] = $before . wc_get_order_status_name($order->get_status()) . $after;
          }
          
          return $data;
      }
      Copy

      Regards,

    • #142067
      donald_punk
      Participant

      Wow, thank you so much! And it works 🙂

    • #142109

      You are welcome @donald_punk

Viewing 8 reply threads

The topic ‘Colored Order Status’ is closed to new replies.