Created
January 29, 2020 06:36
-
-
Save KeylorCR/04e96ea6535b5757b261983793afb26c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
** Add extra information to admin order actions column | |
** @keylocr - 29-01-2020 | |
**/ | |
function wc_custom_admin_order_actions_end($object) { | |
$order_id = $object->get_id(); | |
$store = (!empty(get_post_meta($order_id, '_shipping_pickup_stores', true))) ? get_post_meta($order_id, '_shipping_pickup_stores', true) : ''; | |
if(!empty($store)) : | |
?> | |
<p> | |
<strong class="title"><?php echo __('Pickup Store', 'wc-pickup-store') . ':' ?></strong> | |
<span class="data"><?= $store ?></span> | |
</p> | |
<?php | |
endif; | |
} | |
add_action('woocommerce_admin_order_actions_end', 'wc_custom_admin_order_actions_end', 99); | |
/** | |
** Add extra information to shipping address column | |
** @keylocr - 29-01-2020 | |
**/ | |
function wc_manage_shop_order_posts_custom_column( $column ) { | |
global $post; | |
if ($column == 'shipping_address') { | |
$order = wc_get_order( $post->ID ); | |
$order_id = $order->get_id(); | |
$store = (!empty(get_post_meta($order_id, '_shipping_pickup_stores', true))) ? get_post_meta($order_id, '_shipping_pickup_stores', true) : ''; | |
if(!empty($store)) : | |
?> | |
<p> | |
<strong class="title"><?php echo __('Pickup Store', 'wc-pickup-store') . ':' ?></strong> | |
<span class="data"><?= $store ?></span> | |
</p> | |
<?php | |
endif; | |
} | |
} | |
add_action('manage_shop_order_posts_custom_column', 'wc_manage_shop_order_posts_custom_column', 99); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment