Ejemplo n.º 1
0
 /**
  * Delivers customer export files to the browser
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function export_customers()
 {
     if (!current_user_can('shopp_export_customers')) {
         exit;
     }
     if (!isset($_POST['settings']['customerexport_columns'])) {
         $Customer = ShoppCustomer::exportcolumns();
         $Billing = BillingAddress::exportcolumns();
         $Shipping = ShippingAddress::exportcolumns();
         $_POST['settings']['customerexport_columns'] = array_keys(array_merge($Customer, $Billing, $Shipping));
         $_POST['settings']['customerexport_headers'] = 'on';
     }
     shopp_set_formsettings();
     // Save workflow setting
     $format = shopp_setting('customerexport_format');
     if (empty($format)) {
         $format = 'tab';
     }
     switch ($format) {
         case 'csv':
             new CustomersCSVExport();
             break;
         default:
             new CustomersTabExport();
     }
     exit;
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     $this->customer_cols = ShoppCustomer::exportcolumns();
     $this->billing_cols = BillingAddress::exportcolumns();
     $this->shipping_cols = ShippingAddress::exportcolumns();
     $this->defined = array_merge($this->customer_cols, $this->billing_cols, $this->shipping_cols);
     $this->sitename = get_bloginfo('name');
     $this->headings = shopp_setting('customerexport_headers') == "on";
     $this->selected = shopp_setting('customerexport_columns');
     shopp_set_setting('customerexport_lastexport', current_time('timestamp'));
 }