Skip to content

Commit

Permalink
Merge pull request #6 from vbiweb/dev
Browse files Browse the repository at this point in the history
1.1.0 Release PR
  • Loading branch information
kgkrishnavbi authored Nov 5, 2019
2 parents b1d6824 + e1d0c77 commit 58652d4
Show file tree
Hide file tree
Showing 13 changed files with 1,054 additions and 49 deletions.
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://kgopalkrishna.com
Tags: woocommerce, order, view
Requires at least: 5.0.0
Tested up to: 5.2.3
Stable tag: 1.0.1
Stable tag: 1.1.0
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand All @@ -27,29 +27,11 @@ higher versions... this is just the highest one you've verified.
* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for
stable.

Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so
if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used
for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt`
is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in
your in-development version, without having that information incorrectly disclosed about the current stable version
that lacks those changes -- as long as the trunk's `readme.txt` points to the correct stable tag.

If no stable tag is provided, it is assumed that trunk is stable, but you should specify "trunk" if that's where
you put the stable version, in order to eliminate any doubt.

== Installation ==

1. Upload `wc-order-view.php` to the `/wp-content/plugins/` directory
1. Upload `wc-order-view` folder to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress

== Screenshots ==

1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot

== Changelog ==

= 1.0.0 =
Expand All @@ -59,16 +41,21 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove
* Issue #2 - Fixed Date created value displayed for each order
* Issue #3 - Fixed the total orders count shown in all orders page

= 1.1.0 =
* Issue #5 - Fixed cancelled orders not visible
* Feature - Support for 3rd party woocommerce plugins ( PDF Invoices, Woocommerce Subscriptions, Woocommerce API Mananger )
* Dev - New hooks added to the view order details page ( Details will be shared in a separate documentation )

== Features ==

1. Strict view only access to orders.
1. View each orders individually.

== Planned Features ==

* Support for 3rd party woocommerce plugins
* hooks and filters for adding custom content in view order page
* Export orders in CSV format
* Custom order view actions

Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax].
Titles are optional, naturally.
Expand Down
61 changes: 59 additions & 2 deletions admin/class-wc-order-view-admin-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function get_orders( $per_page = 5, $page_number = 1 ) {
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'shop_order',
'post_status' => ( isset ( $_REQUEST[ 'post_status' ] ) && $_REQUEST[ 'post_status' ] != "" ) ? $_REQUEST[ 'post_status' ] : array( 'wc-completed', 'wc-on-hold' ),
'post_status' => ( isset ( $_REQUEST[ 'post_status' ] ) && $_REQUEST[ 'post_status' ] != "" ) ? $_REQUEST[ 'post_status' ] : array_keys( wc_get_order_statuses() ),
'meta_query' => $meta_query
);

Expand Down Expand Up @@ -164,7 +164,7 @@ public static function record_count() {
$args = array (
'numberposts' => -1,
'post_type' => 'shop_order',
'post_status' => ( isset ( $_REQUEST[ 'post_status' ] ) && $_REQUEST[ 'post_status' ] != "" ) ? $_REQUEST[ 'post_status' ] : array( 'wc-completed', 'wc-on-hold' ),
'post_status' => ( isset ( $_REQUEST[ 'post_status' ] ) && $_REQUEST[ 'post_status' ] != "" ) ? $_REQUEST[ 'post_status' ] : array_keys( wc_get_order_statuses() ),
'meta_query' => $meta_query
);

Expand Down Expand Up @@ -215,10 +215,20 @@ function get_columns() {
'name' => __( 'Name', 'wc-order-view' )
);

if( get_option( 'wcov_pdf_invoices' ) == "enabled" ) {
$columns[ 'pdf_invoice' ] = __( 'Invoice', 'wc-order-view' );
}

$columns[ 'date' ] = __( 'Date', 'wc-order-view' );
$columns[ 'status' ] = __( 'Status', 'wc-order-view' );
$columns[ 'billing_address' ] = __( 'Billing', 'wc-order-view' );
$columns[ 'shipping_address' ] = __( 'Ship To', 'wc-order-view' );

if( get_option( 'wcov_subscriptions' ) == "enabled" ) {

$columns[ 'subscription_relationship' ] = '<div class="subscription_head tooltip">' . esc_attr__( 'Subscription Relationship', 'wc-order-view' ) . '<span class="tooltiptext">' . esc_attr__( 'Subscription Relationship', 'wc-order-view' ) . '</span></div>';
}

$columns[ 'total' ] = __( 'Total', 'wc-order-view' );


Expand Down Expand Up @@ -392,6 +402,53 @@ function column_billing_address( $item ) {

}

/**
* Render the invoice column
*
* @param array $item
*
* @return string
* @since 1.1.0
*/
function column_pdf_invoice( $item ) {

$order_id = $item[ 'order_id' ];

$invoice_number_display = get_post_meta( $order_id, '_invoice_number_display', true );
$invoice_date = get_post_meta( $order_id, '_invoice_date', true );

$invoice = '<a href="' . admin_url( 'edit.php?post_type=shop_order&pdfid=' . $order_id ) .'">' . $invoice_number_display . '<br>' . date( 'j F, Y' ) . '</a>';

return $invoice;

}

/**
* Render the subscription relationship column
*
* @param array $item
*
* @return string
* @since 1.1.0
*/
function column_subscription_relationship( $item ) {

$order_id = $item[ 'order_id' ];

if ( wcs_order_contains_subscription( $order_id, 'renewal' ) ) {
echo '<div class="subscription_renewal_order tooltip"><span class="tooltiptext">' . esc_attr__( 'Renewal Order', 'woocommerce-subscriptions' ) . '</span></div>';
} elseif ( wcs_order_contains_subscription( $order_id, 'resubscribe' ) ) {
echo '<div class="subscription_resubscribe_order tooltip"><span class="tooltiptext">' . esc_attr__( 'Resubscribe Order', 'woocommerce-subscriptions' ) . '</span></div>';
} elseif ( wcs_order_contains_subscription( $order_id, 'parent' ) ) {
echo '<div class="subscription_parent_order tooltip"><span class="tooltiptext">' . esc_attr__( 'Parent Order', 'woocommerce-subscriptions' ) . '</span></div>';
} else {
echo '<div class="normal_order">&ndash;</span>';
}

return $subscription_relationship;

}

/**
* Returns an associative array containing the bulk action
*
Expand Down
16 changes: 10 additions & 6 deletions admin/class-wc-order-view-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public function enqueue_scripts() {
* class.
*/

wp_register_script('wc_order_view_select2', "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.full.min.js", array('jquery'), '4.0.7', true);
wp_enqueue_script('wc_order_view_select2');
wp_register_script( 'wc_order_view_select2', "https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/js/select2.full.min.js", array( 'jquery' ), '4.0.7', true );
wp_enqueue_script( 'wc_order_view_select2' );

wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/wc-order-view-admin.js', array( 'jquery' ), $this->version, false );

Expand Down Expand Up @@ -169,13 +169,17 @@ public function wc_order_view_page() {

if( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == "view" ) {

$post = get_post( $_GET[ 'order_id' ] );
if( isset( $_GET[ 'order_id' ] ) ) {

$order = new WC_Order( $_GET[ 'order_id' ] );
$post = get_post( $_GET[ 'order_id' ] );

$user = $order->get_user();
$order = new WC_Order( $_GET[ 'order_id' ] );

require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/wc-order-view-order-details-display.php';
$user = $order->get_user();

require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/wc-order-view-order-details-display.php';

}

} else {

Expand Down
Loading

0 comments on commit 58652d4

Please sign in to comment.