I'm trying to write a shortcode to display users woocommerce order history. I've found an answer here in woocommerce, is there a shortcode/page to view all orders? , but that does'nt work anymore.
If i follow the current answer it gives me a fatal error.
Fatal error: Call to undefined function wc_get_account_orders_actions() in /wp-content/themes/wrapgate/woocommerce/myaccount/my-orders.php on line 72
Anybody knows updated code to get my shortcode to work? Here's the shortcode function i've tried
add_shortcode( 'woocommerce_history', 'woo_order_history' );
function woo_order_history() {
ob_start();
wc_get_template( 'myaccount/my-orders.php', array(
'current_user' => get_user_by( 'id', get_current_user_id() ),
'order_count' => -1
));
return ob_get_clean();
}
Same error occurs if i try to use
woocommerce_account_orders( -1 );
Woocommerce as well as wordpress are on the latest version. I've tried to call the shortcode function from my themes functions.php
Thanks in advance for every help.