WCMp Advanced Frontend Manager
-
AuthorPosts
-
-
September 15, 2022 at 1:24 AM #141965donald_punkParticipant
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!
-
September 15, 2022 at 6:53 PM #141980NerdySupportExpert MoumitaKeymaster
@donald_punk, can you please share a scrrenshot and explain what flow are you looking for so we can assist you accordingly.
-
September 15, 2022 at 7:57 PM #141983donald_punkParticipant
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. -
September 16, 2022 at 2:03 PM #141997MVX Support NinjaKeymaster
HI,
Let us know which status you want in color red.Regards,
-
September 16, 2022 at 2:32 PM #141999MVX Support NinjaKeymaster
HI,
Let us know which status you want in red colour.Regards,
-
September 16, 2022 at 4:41 PM #142002donald_punkParticipant
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!
-
September 19, 2022 at 6:15 PM #142064MVX Support NinjaKeymaster
Hi,
Kindly add below code to your active theme function.phpadd_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; }
CopyRegards,
-
September 19, 2022 at 6:29 PM #142067donald_punkParticipant
Wow, thank you so much! And it works 🙂
-
September 21, 2022 at 11:06 AM #142109NerdySupportExpert MoumitaKeymaster
You are welcome @donald_punk
-
-
AuthorPosts
The topic ‘Colored Order Status’ is closed to new replies.