Exemplo n.º 1
0
 public function __construct()
 {
     if (!class_exists('WooCommerce') or XmlExportEngine::$exportOptions['export_type'] == 'specific' and !in_array('shop_order', XmlExportEngine::$post_types) or XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'shop_order') === false) {
         self::$is_active = false;
         return;
     }
     $this->filter_sections = array('general' => array('title' => __("Order", "wp_all_export_plugin"), 'fields' => array('ID' => __('Order ID', 'wp_all_export_plugin'), 'cf__order_key' => __('Order Key', 'wp_all_export_plugin'), 'post_date' => __('Order Date', 'wp_all_export_plugin'), 'cf__completed_date' => __('Completed Date', 'wp_all_export_plugin'), 'post_title' => __('Title', 'wp_all_export_plugin'), 'post_status' => __('Order Status', 'wp_all_export_plugin'), 'cf__order_currency' => __('Order Currency', 'wp_all_export_plugin'), 'cf__payment_method_title' => __('Payment Method', 'wp_all_export_plugin'), 'cf__order_total' => __('Order Total', 'wp_all_export_plugin'))), 'customer' => array('title' => __("Customer", "wp_all_export_plugin"), 'fields' => array()));
     foreach ($this->available_customer_data() as $key => $value) {
         $this->filter_sections['customer']['fields'][$key == 'post_excerpt' ? $key : 'cf_' . $key] = $value;
     }
     if (empty(PMXE_Plugin::$session)) {
         $id = $_GET['export_id'];
         $export = new PMXE_Export_Record();
         $export->getById($id);
         if (!$export->isEmpty() and $export->options['export_to'] == 'csv') {
             $this->init_additional_data();
         }
     } else {
         self::$orders_data = PMXE_Plugin::$session->get('orders_data');
         //self::$exportQuery = XmlExportEngine::$exportQuery;
     }
     add_filter("wp_all_export_available_sections", array(&$this, "filter_available_sections"), 10, 1);
     add_filter("wp_all_export_available_filter_sections", array(&$this, "filter_available_filter_sections"), 10, 1);
     add_filter("wp_all_export_csv_rows", array(&$this, "filter_csv_rows"), 10, 2);
     self::$order_sections = $this->available_sections();
 }
 public function __construct()
 {
     $this->order_core_fields = array('_prices_include_tax', '_customer_ip_address', '_customer_user_agent', '_created_via', '_order_version', '_payment_method', '_cart_discount_tax', '_order_shipping_tax', '_recorded_sales', '_order_stock_reduced', '_recorded_coupon_usage_counts', '_transaction_id');
     if (!class_exists('WooCommerce') or XmlExportEngine::$exportOptions['export_type'] == 'specific' and !in_array('shop_order', XmlExportEngine::$post_types) or XmlExportEngine::$exportOptions['export_type'] == 'advanced' and strpos(XmlExportEngine::$exportOptions['wp_query'], 'shop_order') === false) {
         self::$is_active = false;
         return;
     }
     self::$is_active = true;
     if (empty(PMXE_Plugin::$session)) {
         $id = $_GET['export_id'];
         $export = new PMXE_Export_Record();
         $export->getById($id);
         if (!$export->isEmpty() and $export->options['export_to'] == 'csv') {
             $this->init_additional_data();
         }
     } else {
         $this->init_additional_data();
     }
     add_filter("wp_all_export_available_sections", array(&$this, "filter_available_sections"), 10, 1);
     add_filter("wp_all_export_csv_rows", array(&$this, "filter_csv_rows"), 10, 2);
     add_filter("wp_all_export_init_fields", array(&$this, "filter_init_fields"), 10, 1);
     self::$order_sections = $this->available_sections();
 }