-1

I am trying to get orders by user id. I have tried this and not working.

          <?php echo do_shortcode("[woocommerce_view_order per_page='20']"); ?>

is there any way to put pagination to show all of order history?

I also wonder which file, function I need to modify if I want to add "see more" button at the bottom of the order page show 10 each when it's clicked. we may work on "see more" button with ajax.

Thanks,

closed as off-topic by birgire, Johannes Pille, mrwweb, Pieter Goosen, Nicolai Aug 29 '14 at 8:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – birgire, Johannes Pille, mrwweb, Pieter Goosen, Nicolai
If this question can be reworded to fit the rules in the help center, please edit the question.

1

It appears the shortcode uses the key order_count and not per_page. You can modify this on the View Order page, where the shortcode exists.

[woocommerce_view_order order_count="20"]

If you would want some kind of AJAX order loader you may have to make some significant changes.

A note order_count also accepts the parameter all which will get all orders. Perhaps that is a solution?

EDIT:

The shortcode uses the template file myaccount/my-orders.php. You could modify this to look through a certain amount of orders, seperate them into seperate divs and have it show the additional divs with each button press.

It is also in this template file where they actually get all the orders, so you could add a paged parameter to this and quite easily do the AJAX content load.

  • thanks! I don't know why I couldn't find it on woo commerce shortcode document. how did you know that? anyway, you saved my day! – pulla Nov 1 '13 at 8:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.