From 256a38b5d892be53926315d88a2f0b95a3553522 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 11 Mar 2013 16:12:29 +0000 Subject: [PATCH] Option for number of orders shown on view order page. --- classes/shortcodes/class-wc-shortcode-view-order.php | 6 +++++- readme.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/classes/shortcodes/class-wc-shortcode-view-order.php b/classes/shortcodes/class-wc-shortcode-view-order.php index be471a4cbc8..9e43df747e7 100644 --- a/classes/shortcodes/class-wc-shortcode-view-order.php +++ b/classes/shortcodes/class-wc-shortcode-view-order.php @@ -36,12 +36,16 @@ class WC_Shortcode_View_Order { if ( ! is_user_logged_in() ) return; + extract( shortcode_atts( array( + 'order_count' => 10 + ), $atts ) ); + $user_id = get_current_user_id(); $order_id = ( isset( $_GET['order'] ) ) ? $_GET['order'] : 0; $order = new WC_Order( $order_id ); if ( $order_id == 0 ) { - woocommerce_get_template('myaccount/my-orders.php', array( 'order_count' => 10 )); + woocommerce_get_template( 'myaccount/my-orders.php', array( 'order_count' => 'all' == $order_count ? -1 : $order_count ) ); return; } diff --git a/readme.txt b/readme.txt index 21646612c74..cae99cab9f6 100644 --- a/readme.txt +++ b/readme.txt @@ -165,6 +165,8 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc == Changelog == +* Tweak - Like my account, added order_count attribute to view order shortcode. + = 2.0.3 - 11/03/2013 = * Feature - Added products by attribute shortcode, e.g. [product_attribute attribute="color" filter="blue"] * Tweak - Made coupon label more clear.