Plugin Directory

Changeset 1979975


Ignore:
Timestamp:
11/24/2018 07:31:22 PM (7 years ago)
Author:
ImagiSol
Message:

Added a new feature to export email and phone and performance improvements.

Location:
woocommerce-export-orders/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-export-orders/trunk/readme.txt

    r1978276 r1979975  
    22Contributors: ImagiSol, dhruvin
    33Donate link: https://paypal.me/DhruvinS?_ga=1.134259249.1705473128.1507170477
    4 Tags: woocommerce, export orders, csv, pdf
     4Tags: woocommerce, export orders, csv, pdf, export emails, export items
    55Requires at least: 3.0.1
    66Tested up to: 4.9.8
     
    1313
    1414== Description ==
     15
     16**What's new**
     17With version 1.1.0 export Customer Billing Email and Phone along with the other information.
    1518
    1619**[Woocommerce Export Orders](https://imaginate-solutions.com/downloads/woocommerce-export-orders/)** enables store managers to export the itemized list of the products for all the orders.
     
    5457== Changelog ==
    5558
     59= 1.1.0 =
     60* Added Customer Email and Phone to be exported with the other information.
     61* Performance improvement in getting the order details. Now the plugin uses wc_get_orders instead of custom queries.
     62
    5663= 1.0 =
    5764* Bug Fixes related to new WooCommerce Functions
  • woocommerce-export-orders/trunk/woocommerce-export-orders.php

    r1978276 r1979975  
    44Plugin URI: https://imaginate-solutions.com/
    55Description: This plugin lets store owners to export orders
    6 Version: 1.0.0
     6Version: 1.1.0
    77Author: Dhruvin Shah
    88Author URI: https://imaginate-solutions.com/
     
    9191            function woo_export_orders_menu(){
    9292               
    93                 add_menu_page( 'Export Orders','Export Orders','manage_woocommerce', 'export_orders_page');
     93                add_menu_page(
     94                    'Export Orders',
     95                    'Export Orders',
     96                    'manage_woocommerce',
     97                    'export_orders_page',
     98                    '',
     99                    'dashicons-media-spreadsheet',
     100                    '55.7'
     101                );
    94102                add_submenu_page('export_orders_page.php', __( 'Export Orders Settings', 'woo-export-order' ), __( 'Export Orders Settings', 'woo-export-order' ), 'manage_woocommerce', 'export_orders_page', array(&$this, 'export_orders_page' ));
    95103                //remove_submenu_page('export_settings','exports_settings');
     
    108116               
    109117                <?php
    110                 $query_order = "SELECT ID as 'order_id' FROM `" . $wpdb->prefix . "posts` where post_type='shop_order' ";
    111                 $order_results = $wpdb->get_results( $query_order );
    112                
     118                $args = array(
     119                    'limit' => -1,
     120                );
     121                $orders = wc_get_orders( $args );
    113122                $var = $today_checkin_var = $today_checkout_var = $booking_time = "";
    114                 foreach ( $order_results as $id_key => $id_value ) {
    115 
    116                     $order = wc_get_order( $id_value->order_id );
     123                foreach ( $orders as $id_key => $order ) {
     124
     125                    //$order = wc_get_order( $id_value->order_id );
    117126
    118127                    //if ( $order->get_status() === 'completed' ) {
    119128                        $order_items = $order->get_items();
    120129                       
    121                         $my_order_meta = get_post_custom( $id_value->order_id );
     130                        $my_order_meta = get_post_custom( $order->get_id() );
    122131
    123132                        $c = 0;
    124133                        foreach ($order_items as $items_key => $items_value ) {
    125134                            $var .= "<tr>
    126                             <td>".$id_value->order_id."</td>
     135                            <td>".$order->get_id()."</td>
    127136                            <td>".$this->order_status[$order->get_status()]."</td>
    128137                            <td>".$my_order_meta['_billing_first_name'][0]." ".$my_order_meta['_billing_last_name'][0]."</td>
     138                            <td>".$my_order_meta['_billing_email'][0]."</td>
     139                            <td>".$my_order_meta['_billing_phone'][0]."</td>
    129140                            <td>".$items_value['name']."</td>
    130141                            <td>".$items_value['line_total']."</td>
    131                             <td>".$order->get_date_created('view')."</td>
    132                             <td><a href=\"post.php?post=". $id_value->order_id."&action=edit\">View Order</a></td>
     142                            <td>".$order->get_date_created()."</td>
     143                            <td><a href=\"post.php?post=". $order->get_id()."&action=edit\">View Order</a></td>
    133144                            </tr>";
    134145                               
     
    199210                            <th><?php _e( 'Order Status', 'woo-export-order' ); ?></th>
    200211                            <th><?php _e( 'Customer Name' , 'woo-export-order' ); ?></th>
     212                            <th><?php _e( 'Customer Email', 'woo-export-order' ); ?></th>
     213                            <th><?php _e( 'Customer Phone', 'woo-export-order' ); ?></th>
    201214                            <th><?php _e( 'Product Name' , 'woo-export-order' ); ?></th>
    202215                            <th><?php _e( 'Amount' , 'woo-export-order' ); ?></th>
Note: See TracChangeset for help on using the changeset viewer.