Please help to customize Orders table template
-
Hi,
I am trying to customize the orders.php template and I want to echo a custom string message on a new column of the Orders table when the commission for one (or more) of the vendor’s product(s) is “paid”.
In other words, when I mark as “paid” in backend and the Status thus changes to “paid”, a message should be echoed.
Can you please help me with the condition? It should be something like “If the vendor’s product’s commission status is “paid” for the respective order displayed in Orders table, echo something”. I’ve been trying for so many hours now, but I simply can’t get the hang of it because I’m not familiar with the WC Vendors’ internal functions and queries.
This is what I’ve tried but with no luck:
<?php foreach ( $order_summary as $order ) :
$order = wc_get_order( $order->order_id );
$order_id = $order->get_id();
$valid_items = WCV_Queries::get_products_for_order( $order_id );if ($valid_items->status == ‘paid’) { // DOES THIS WORK?
echo ‘Something’;
}
?>Pretty please help.
- The topic ‘Please help to customize Orders table template’ is closed to new replies.