PluginProbe
Import Users & Customers with Meta | WP Ultimate CSV Importer Add-on / 1.2
Import Users & Customers with Meta | WP Ultimate CSV Importer Add-on v1.2
2.0 1.7.1 1.2.9 1.3 1.4 1.4.1 1.4.2 1.4.3 1.5 1.6 1.7 trunk 1.0 1.1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8
import-users / importExtensions / BSIImport.php

BSIImport.php in Import Users & Customers with Meta | WP Ultimate CSV Importer Add-on 1.2, at importExtensions/BSIImport.php

59 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /******************************************************************************************
3 * Copyright (C) Smackcoders. - All Rights Reserved under Smackcoders Proprietary License
4 * Unauthorized copying of this file, via any medium is strictly prohibited
5 * Proprietary and confidential
6 * You can contact Smackcoders at email address info@smackcoders.com.
7 *******************************************************************************************/
8
9 namespace Smackcoders\SMUSERS;
10
11 if ( ! defined( 'ABSPATH' ) )
12 exit; // Exit if accessed directly
13
14 class BSIImport extends UsersImport {
15 private static $bsi_instance = null;
16
17 public static function getInstance() {
18 if (BSIImport::$bsi_instance == null) {
19 BSIImport::$bsi_instance = new BSIImport;
20 global $bsi_instance;
21 return BSIImport::$bsi_instance;
22 }
23 return BSIImport::$bsi_instance;
24 }
25 public function set_bsi_values($header_array ,$value_array , $map, $post_id , $type){
26 $post_values = [];
27 $helpers_instance = ImportHelpers::getInstance();
28 $post_values = $helpers_instance->get_header_values($map , $header_array , $value_array);
29
30 $this->bsi_import_function($post_values, $post_id);
31 }
32
33 public function bsi_import_function($data_array, $uID){
34 foreach( $data_array as $daKey => $daVal ) {
35 if(strpos($daKey, 'msi_') === 0) {
36 $msi_custom_key = substr($daKey, 4);
37 $msi_shipping_array[$msi_custom_key] = $daVal;
38 } elseif(strpos($daKey, 'mbi_') === 0) {
39 $mbi_custom_key = substr($daKey, 4);
40 $mbi_billing_array[$mbi_custom_key] = $daVal;
41 } else {
42 update_user_meta($uID, $daKey, $daVal);
43 }
44 }
45 //Import MarketPress Shipping Info
46 if (!empty ($msi_shipping_array)) {
47 $custom_key = 'mp_shipping_info';
48 update_user_meta($uID, $custom_key, $msi_shipping_array);
49 }
50 //Import MarketPress Billing Info
51 if (!empty ($mbi_billing_array)) {
52 $custom_key = 'mp_billing_info';
53 update_user_meta($uID, $custom_key, $mbi_billing_array);
54 }
55 }
56 }
57 global $billing_class;
58 $billing_class = new BSIImport();
59