So I have created a custom action button in my woocommerce order list, but I want the button to link to a page where I will print out information attached to that order. Now to do so I would like to carry data from the order to the page where I am going to print the information.
So I have created my custom button in the woocommerce order list with this code:
add_action( 'woocommerce_admin_order_actions_end', 'add_content_to_wcactions_column' );
function add_content_to_wcactions_column() {
// create some tooltip text to show on hover
$tooltip = __('Print details', 'textdomain');
// create a button label
$label = __('P1', 'textdomain');
$printurl = wc_get_order_item_meta($post_id, 'street-name', true);
echo '<a class="button tips custom-class" href="/order-info/?orderid='.$printurl.'" data-tip="'.$tooltip.'" target="_blank">'.$label.'</a>';
}
The button links to the print page which should carry the orders 'street-name' meta, but the meta doesnt show, it just appears blank in the url.
Heres what my order item information looks like:
I should say im using the WooCommerce Custom Product Addons plugin if that helps.