Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Shortcode to display "My Orders" in a custom page, instead of in the "My Account" Page in WooCommerce
function txl_my_orders_sc( $atts ) {
$atts = shortcode_atts( array(
'order_count' => -1,
), $atts ));
ob_start();
wc_get_template( 'myaccount/my-orders.php', array(
'order_count' => $atts[ 'order_count' ],
));
return ob_get_clean();
}
add_shortcode( 'my_orders', 'txl_my_orders_sc' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment