Hello. I am trying to add a shortcode on the button.
I first get the count for processing in woocommerce order.
and I made a shortcode for it to add on the button.
However, when I add it on the button, it appears on the top of the page.
add_shortcode('get_count_processing', 'count_for_processing');
function count_for_processing() {
$args = array(
'status' => array('wc-processing'),
'return' => 'ids',
'limit' => -1
);
$processing_order = wc_get_orders($args);
echo "Number of processing order = " . count($processing_order);
}
These are the code I added to get the count.
I want to add this inside button, but whereever I put this code, it appears on the top of the page.