I'd like to have a simple custom meta for order items that says if the item has been fulfilled or not.
I have this in my functions.php:
add_action( 'woocommerce_admin_order_item_values', 'pd_admin_order_item_values', 10, 3 );
function pd_admin_order_item_values( $product, $item, $item_id ) {
//Get what you need from $product, $item or $item_id
echo '<td class="fulfilled">';
$fulfilled = wc_get_order_item_meta($item_id, '_fulfilled', true);
if ($fulfilled) {
echo '<p><strong>Fulfilled:</strong> <span style="color:#00FF00;">Yes</span></p>';
} else {
echo '<p><strong>Fulfilled:</strong> <span style="color:#FF0000;">No</span></p>';
}
echo'</td>';
}
Is there an easy way to update the meta value just by clicking the Yes/No?
Like, click the green Yes and it updates to a red No and viceversa.
Will I have to create a custom WC API endpoint?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745332537a4622948.html
评论列表(0条)