From 174241c39149a04edeeebdcd5870b52046375fe3 Mon Sep 17 00:00:00 2001 From: Stef Kariotidis Date: Sat, 19 Nov 2016 01:15:49 +0200 Subject: [PATCH] bootstrap button styles for orders --- woocommerce/myaccount/my-orders.php | 105 +++++++++++++++++++++++ woocommerce/myaccount/orders.php | 125 ++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) create mode 100755 woocommerce/myaccount/my-orders.php create mode 100755 woocommerce/myaccount/orders.php diff --git a/woocommerce/myaccount/my-orders.php b/woocommerce/myaccount/my-orders.php new file mode 100755 index 0000000..8d6c4b0 --- /dev/null +++ b/woocommerce/myaccount/my-orders.php @@ -0,0 +1,105 @@ + __( 'Order', 'woocommerce' ), + 'order-date' => __( 'Date', 'woocommerce' ), + 'order-status' => __( 'Status', 'woocommerce' ), + 'order-total' => __( 'Total', 'woocommerce' ), + 'order-actions' => ' ', +) ); + +$customer_orders = get_posts( apply_filters( 'woocommerce_my_account_my_orders_query', array( + 'numberposts' => $order_count, + 'meta_key' => '_customer_user', + 'meta_value' => get_current_user_id(), + 'post_type' => wc_get_order_types( 'view-orders' ), + 'post_status' => array_keys( wc_get_order_statuses() ) +) ) ); + +if ( $customer_orders ) : ?> + +

+ + + + + + $column_name ) : ?> + + + + + + + get_item_count(); + ?> + + $column_name ) : ?> + + + + + +
+ + + + + + get_order_number(); ?> + + + + + + + get_status() ); ?> + + + get_formatted_order_total(), $item_count ); ?> + + + array( + 'url' => $order->get_checkout_payment_url(), + 'name' => __( 'Pay', 'woocommerce' ) + ), + 'view' => array( + 'url' => $order->get_view_order_url(), + 'name' => __( 'View', 'woocommerce' ) + ), + 'cancel' => array( + 'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ), + 'name' => __( 'Cancel', 'woocommerce' ) + ) + ); + + if ( ! $order->needs_payment() ) { + unset( $actions['pay'] ); + } + + if ( ! in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_cancel', array( 'pending', 'failed' ), $order ) ) ) { + unset( $actions['cancel'] ); + } + + if ( $actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order ) ) { + foreach ( $actions as $key => $action ) { + echo '' . esc_html( $action['name'] ) . ''; + } + } + ?> + +
+ diff --git a/woocommerce/myaccount/orders.php b/woocommerce/myaccount/orders.php new file mode 100755 index 0000000..c2b1591 --- /dev/null +++ b/woocommerce/myaccount/orders.php @@ -0,0 +1,125 @@ + + + + + + + + $column_name ) : ?> + + + + + + + orders as $customer_order ) : + $order = wc_get_order( $customer_order ); + $item_count = $order->get_item_count(); + ?> + + $column_name ) : ?> + + + + + +
+ + + + + + get_order_number(); ?> + + + + + + + get_status() ); ?> + + + get_formatted_order_total(), $item_count ); ?> + + + array( + 'url' => $order->get_checkout_payment_url(), + 'name' => __( 'Pay', 'woocommerce' ) + ), + 'view' => array( + 'url' => $order->get_view_order_url(), + 'name' => __( 'View', 'woocommerce' ) + ), + 'cancel' => array( + 'url' => $order->get_cancel_order_url( wc_get_page_permalink( 'myaccount' ) ), + 'name' => __( 'Cancel', 'woocommerce' ) + ) + ); + + if ( ! $order->needs_payment() ) { + unset( $actions['pay'] ); + } + + if ( ! in_array( $order->get_status(), apply_filters( 'woocommerce_valid_order_statuses_for_cancel', array( 'pending', 'failed' ), $order ) ) ) { + unset( $actions['cancel'] ); + } + + if ( $actions = apply_filters( 'woocommerce_my_account_my_orders_actions', $actions, $order ) ) { + foreach ( $actions as $key => $action ) { + echo '' . esc_html( $action['name'] ) . ''; + } + } + ?> + +
+ + + + max_num_pages ) : ?> +
+ + + + + max_num_pages ) ) : ?> + + +
+ + + +
+ + + + +
+ + +