Import Products from any XML or CSV to WooCommerce - Version 1.2.0

Version Description

  • IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: (http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information)
  • speed up the import of taxonomies/categories
  • updated design
  • new option - adjust prices (mark up, mark down, convert currency)
  • added preview prices feature
  • fixed importing of menu order
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Import Products from any XML or CSV to WooCommerce
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.6 to 1.2.0

actions/admin_notices.php CHANGED
@@ -13,7 +13,7 @@ function pmwi_admin_notices() {
13
  </p></div>
14
  <?php
15
 
16
- deactivate_plugins( PMWI_FREE_ROOT_DIR . '/plugin.php');
17
 
18
  }
19
 
@@ -27,11 +27,11 @@ function pmwi_admin_notices() {
27
  </p></div>
28
  <?php
29
 
30
- deactivate_plugins( PMWI_FREE_ROOT_DIR . '/plugin.php');
31
 
32
  }
33
 
34
- if ( class_exists( 'PMXI_Plugin' ) and ( (version_compare(PMXI_VERSION, '3.3.6') <= 0 or version_compare(PMXI_VERSION, '4.0.0') >= 0 ) and PMXI_EDITION == 'paid' or version_compare(PMXI_VERSION, '3.1.1') <= 0 and PMXI_EDITION == 'free') ) {
35
  ?>
36
  <div class="error"><p>
37
  <?php printf(
@@ -41,8 +41,21 @@ function pmwi_admin_notices() {
41
  </p></div>
42
  <?php
43
 
44
- deactivate_plugins( PMWI_FREE_ROOT_DIR . '/plugin.php');
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  $input = new PMWI_Input();
48
  $messages = $input->get('PMWI_nt', array());
13
  </p></div>
14
  <?php
15
 
16
+ deactivate_plugins( PMWI_ROOT_DIR . '/plugin.php');
17
 
18
  }
19
 
27
  </p></div>
28
  <?php
29
 
30
+ deactivate_plugins( PMWI_ROOT_DIR . '/plugin.php');
31
 
32
  }
33
 
34
+ if ( class_exists( 'PMXI_Plugin' ) and ( (version_compare(PMXI_VERSION, '4.0.0-beta1') < 0 ) and PMXI_EDITION == 'paid' or version_compare(PMXI_VERSION, '3.2.0') < 0 and PMXI_EDITION == 'free') ) {
35
  ?>
36
  <div class="error"><p>
37
  <?php printf(
41
  </p></div>
42
  <?php
43
 
44
+ deactivate_plugins( PMWI_ROOT_DIR . '/plugin.php');
45
+ }
46
+
47
+ if ( class_exists( 'Woocommerce' ) and defined('WOOCOMMERCE_VERSION') and version_compare(WOOCOMMERCE_VERSION, '2.1') <= 0 ) {
48
+ ?>
49
+ <div class="error"><p>
50
+ <?php printf(
51
+ __('<b>%s Plugin</b>: Please update your WooCommerce to the latest version', 'pmwi_plugin'),
52
+ PMWI_Plugin::getInstance()->getName()
53
+ ) ?>
54
+ </p></div>
55
+ <?php
56
+
57
+ deactivate_plugins( PMWI_ROOT_DIR . '/plugin.php');
58
+ }
59
 
60
  $input = new PMWI_Input();
61
  $messages = $input->get('PMWI_nt', array());
classes/updater.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( ! class_exists('PMWI_Updater') ) {
4
+
5
+ class PMWI_Updater {
6
+ private $api_url = '';
7
+ private $api_data = array();
8
+ private $name = '';
9
+ private $slug = '';
10
+
11
+ /**
12
+ * Class constructor.
13
+ *
14
+ * @uses plugin_basename()
15
+ * @uses hook()
16
+ *
17
+ * @param string $_api_url The URL pointing to the custom API endpoint.
18
+ * @param string $_plugin_file Path to the plugin file.
19
+ * @param array $_api_data Optional data to send with API calls.
20
+ * @return void
21
+ */
22
+ function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
23
+ $this->api_url = trailingslashit( $_api_url );
24
+ $this->api_data = urlencode_deep( $_api_data );
25
+ $this->name = plugin_basename( $_plugin_file );
26
+ $this->slug = basename( $_plugin_file, '.php');
27
+ $this->version = $_api_data['version'];
28
+
29
+ // Set up hooks.
30
+ $this->hook();
31
+ }
32
+
33
+ /**
34
+ * Set up Wordpress filters to hook into WP's update process.
35
+ *
36
+ * @uses add_filter()
37
+ *
38
+ * @return void
39
+ */
40
+ private function hook() {
41
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
42
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
43
+ add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
44
+ }
45
+
46
+ /**
47
+ * Check for Updates at the defined API endpoint and modify the update array.
48
+ *
49
+ * This function dives into the update api just when Wordpress creates its update array,
50
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
51
+ * It is reassembled from parts of the native Wordpress plugin update code.
52
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
53
+ *
54
+ * @uses api_request()
55
+ *
56
+ * @param array $_transient_data Update array build by Wordpress.
57
+ * @return array Modified update array with custom plugin data.
58
+ */
59
+ function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
60
+
61
+
62
+ if( empty( $_transient_data ) ) return $_transient_data;
63
+
64
+ $to_send = array( 'slug' => $this->slug );
65
+
66
+ $api_response = $this->api_request( 'plugin_latest_version', $to_send );
67
+
68
+ if( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
69
+ if( version_compare( $this->version, $api_response->new_version, '<' ) )
70
+ $_transient_data->response[$this->name] = $api_response;
71
+ }
72
+ return $_transient_data;
73
+ }
74
+
75
+
76
+ /**
77
+ * Updates information on the "View version x.x details" page with custom data.
78
+ *
79
+ * @uses api_request()
80
+ *
81
+ * @param mixed $_data
82
+ * @param string $_action
83
+ * @param object $_args
84
+ * @return object $_data
85
+ */
86
+ function plugins_api_filter( $_data, $_action = '', $_args = null ) {
87
+ if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
88
+
89
+ $to_send = array( 'slug' => $this->slug );
90
+
91
+ $api_response = $this->api_request( 'plugin_information', $to_send );
92
+ if ( false !== $api_response ) $_data = $api_response;
93
+
94
+ return $_data;
95
+ }
96
+
97
+
98
+ /**
99
+ * Disable SSL verification in order to prevent download update failures
100
+ *
101
+ * @param array $args
102
+ * @param string $url
103
+ * @return object $array
104
+ */
105
+ function http_request_args( $args, $url ) {
106
+ // If it is an https request and we are performing a package download, disable ssl verification
107
+ if( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
108
+ $args['sslverify'] = false;
109
+ }
110
+ return $args;
111
+ }
112
+
113
+ /**
114
+ * Calls the API and, if successfull, returns the object delivered by the API.
115
+ *
116
+ * @uses get_bloginfo()
117
+ * @uses wp_remote_post()
118
+ * @uses is_wp_error()
119
+ *
120
+ * @param string $_action The requested action.
121
+ * @param array $_data Parameters for the API action.
122
+ * @return false||object
123
+ */
124
+ private function api_request( $_action, $_data ) {
125
+
126
+ global $wp_version;
127
+
128
+ $data = array_merge( $this->api_data, $_data );
129
+
130
+ if( $data['slug'] != $this->slug )
131
+ return;
132
+
133
+ $api_params = array(
134
+ 'edd_action' => 'get_version',
135
+ 'license' => false,
136
+ 'name' => $data['item_name'],
137
+ 'slug' => $this->slug,
138
+ 'author' => $data['author']
139
+ );
140
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
141
+
142
+ if ( ! is_wp_error( $request ) ):
143
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
144
+ if( $request && isset( $request->sections ) )
145
+ $request->sections = maybe_unserialize( $request->sections );
146
+ return $request;
147
+ else:
148
+ return false;
149
+ endif;
150
+ }
151
+ }
152
+
153
+ }
config/options.php CHANGED
@@ -4,5 +4,5 @@
4
  * and can be changed by corresponding wordpress function calls
5
  */
6
  $config = array(
7
- /*"info_api_url" => "http://www.wpallimport.com/adminpanel/wooco-update/info.php", */
8
  );
4
  * and can be changed by corresponding wordpress function calls
5
  */
6
  $config = array(
7
+
8
  );
controllers/admin/import.php CHANGED
@@ -17,8 +17,9 @@ class PMWI_Admin_Import extends PMWI_Controller_Admin {
17
  $this->data['id'] = $id = $this->input->get('id');
18
 
19
  $this->data['import'] = $import = new PMXI_Import_Record();
20
- if ( ! $id or $import->getById($id)->isEmpty()) { // specified import is not found
21
- $post = $this->input->post( apply_filters( 'pmxi_options_options', $default, true) );
 
22
  }
23
  else
24
  $post = $this->input->post(
@@ -26,7 +27,7 @@ class PMWI_Admin_Import extends PMWI_Controller_Admin {
26
  + $default
27
  );
28
 
29
- $this->data['is_loaded_template'] = (!empty(PMXI_Plugin::$session->data['pmxi_import']) and !empty(PMXI_Plugin::$session->data['pmxi_import']['is_loaded_template'])) ? PMXI_Plugin::$session->data['pmxi_import']['is_loaded_template'] : false;
30
 
31
  $load_options = $this->input->post('load_template');
32
 
@@ -42,11 +43,7 @@ class PMWI_Admin_Import extends PMWI_Controller_Admin {
42
  $post = $default;
43
 
44
  }
45
-
46
- $this->data['woo_commerce_attributes'] = $woo_commerce_attributes = new PMXI_Model_List();
47
- $woo_commerce_attributes->setTable(PMXI_Plugin::getInstance()->getWPPrefix() . 'woocommerce_attribute_taxonomies');
48
- $woo_commerce_attributes->setColumns('attribute_name', 'attribute_id', 'attribute_label')->getBy(NULL, "attribute_id", NULL, NULL, "attribute_name");
49
-
50
  $this->data['post'] =& $post;
51
 
52
  $this->render();
17
  $this->data['id'] = $id = $this->input->get('id');
18
 
19
  $this->data['import'] = $import = new PMXI_Import_Record();
20
+ if ( ! $id or $import->getById($id)->isEmpty()) { // specified import is not found
21
+ $DefaultOptions = ((!empty(PMXI_Plugin::$session->options)) ? PMXI_Plugin::$session->options : array()) + $default;
22
+ $post = $this->input->post( apply_filters( 'pmxi_options_options', $DefaultOptions, true) );
23
  }
24
  else
25
  $post = $this->input->post(
27
  + $default
28
  );
29
 
30
+ $this->data['is_loaded_template'] = (!empty(PMXI_Plugin::$session->is_loaded_template)) ? PMXI_Plugin::$session->is_loaded_template : false;
31
 
32
  $load_options = $this->input->post('load_template');
33
 
43
  $post = $default;
44
 
45
  }
46
+
 
 
 
 
47
  $this->data['post'] =& $post;
48
 
49
  $this->render();
controllers/controller/admin.php CHANGED
@@ -40,14 +40,14 @@ abstract class PMWI_Controller_Admin extends PMWI_Controller {
40
  if ( ! is_a($wp_styles, 'WP_Styles'))
41
  $wp_styles = new WP_Styles();
42
 
43
- wp_enqueue_style('pmwi-admin-style', PMWI_FREE_ROOT_URL . '/static/css/admin.css');
44
 
45
  if ( version_compare(get_bloginfo('version'), '3.8-RC1') >= 0 ){
46
- wp_enqueue_style('pmwi-admin-style-wp-3.8', PMWI_FREE_ROOT_URL . '/static/css/admin-wp-3.8.css');
47
  }
48
 
49
- wp_enqueue_script('pmwi-script', PMWI_FREE_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
50
- wp_enqueue_script('pmwi-admin-script', PMWI_FREE_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'));
51
 
52
  global $woocommerce;
53
 
40
  if ( ! is_a($wp_styles, 'WP_Styles'))
41
  $wp_styles = new WP_Styles();
42
 
43
+ wp_enqueue_style('pmwi-admin-style', PMWI_ROOT_URL . '/static/css/admin.css');
44
 
45
  if ( version_compare(get_bloginfo('version'), '3.8-RC1') >= 0 ){
46
+ wp_enqueue_style('pmwi-admin-style-wp-3.8', PMWI_ROOT_URL . '/static/css/admin-wp-3.8.css');
47
  }
48
 
49
+ wp_enqueue_script('pmwi-script', PMWI_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
50
+ wp_enqueue_script('pmwi-admin-script', PMWI_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'));
51
 
52
  global $woocommerce;
53
 
filters/pmxi_custom_types.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  function pmwi_pmxi_custom_types($custom_types){
3
  if ( ! empty($custom_types['product']) ) $custom_types['product']->labels->name = __('WooCommerce Products','pmxi_plugin');
 
4
  return $custom_types;
5
  }
6
  ?>
1
  <?php
2
  function pmwi_pmxi_custom_types($custom_types){
3
  if ( ! empty($custom_types['product']) ) $custom_types['product']->labels->name = __('WooCommerce Products','pmxi_plugin');
4
+ if ( ! empty($custom_types['product_variation'])) unset($custom_types['product_variation']);
5
  return $custom_types;
6
  }
7
  ?>
filters/pmxi_unique_key.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmwi_pmxi_unique_key( $unique_key, $options ){
3
+
4
+ if ( $options['custom_type'] == 'product' ){
5
+
6
+ $unique_key .= ( ! empty($options['attribute_value'])) ? implode('-', $options['attribute_value']) : '';
7
+
8
+ }
9
+
10
+ return $unique_key;
11
+ }
helpers/pmwi_adjust_price.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmwi_adjust_price( $price, $field, $options ){
3
+
4
+ switch ($field) {
5
+
6
+ case 'regular_price':
7
+
8
+ if ( ! empty($options['single_product_regular_price_adjust']) ){
9
+
10
+ switch ($options['single_product_regular_price_adjust_type']) {
11
+ case '%':
12
+ $price = ($price/100) * $options['single_product_regular_price_adjust'];
13
+ break;
14
+
15
+ case '$':
16
+
17
+ $price += (double) $options['single_product_regular_price_adjust'];
18
+
19
+ break;
20
+ }
21
+
22
+ }
23
+
24
+ break;
25
+
26
+ case 'sale_price':
27
+
28
+ if ( ! empty($options['single_product_sale_price_adjust']) ){
29
+
30
+ switch ($options['single_product_sale_price_adjust_type']) {
31
+ case '%':
32
+ $price = ($price/100) * $options['single_product_sale_price_adjust'];
33
+ break;
34
+
35
+ case '$':
36
+
37
+ $price += (double) $options['single_product_sale_price_adjust'];
38
+
39
+ break;
40
+ }
41
+
42
+ }
43
+
44
+ break;
45
+
46
+ /*default:
47
+
48
+ return $price;*/
49
+
50
+ break;
51
+ }
52
+
53
+ return ( (double) $price > 0) ? number_format( (double) $price, 2, '.', '' ) : 0;
54
+
55
+ }
helpers/pmwi_prepare_price.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmwi_prepare_price( $price, $disable_prepare_price, $prepare_price_to_woo_format ){
3
+
4
+ if ( $disable_prepare_price ){
5
+
6
+ $price = preg_replace("/[^0-9\.,]/","", $price);
7
+
8
+ }
9
+
10
+ if ( $prepare_price_to_woo_format ){
11
+
12
+ $price = str_replace(",", ".", $price);
13
+
14
+ $price = str_replace(",", ".", str_replace(".", "", preg_replace("%\.([0-9]){1,2}?$%", ",$0", $price)));
15
+
16
+ $price = ("" != $price) ? number_format( (double) $price, 2, '.', '' ) : "";
17
+
18
+ }
19
+
20
+ return apply_filters('pmxi_price', $price);
21
+
22
+ }
helpers/pmwi_update_prices.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function pmwi_update_prices($pid){
3
+ update_post_meta( $pid, '_regular_price', $tmp = get_post_meta( $pid, '_regular_price_tmp', true) );
4
+ delete_post_meta( $pid, '_regular_price_tmp' );
5
+
6
+ update_post_meta( $pid, '_sale_price', $tmp = get_post_meta( $pid, '_sale_price_tmp', true ) );
7
+ delete_post_meta( $pid, '_sale_price_tmp' );
8
+
9
+ update_post_meta( $pid, 'pmxi_wholesale_price', $tmp = get_post_meta( $pid, 'pmxi_wholesale_price_tmp', true ) );
10
+ delete_post_meta( $pid, 'pmxi_wholesale_price_tmp' );
11
+
12
+ update_post_meta( $pid, '_sale_price_dates_from', $tmp = get_post_meta( $pid, '_sale_price_dates_from_tmp', true ) );
13
+ delete_post_meta( $pid, '_sale_price_dates_from_tmp' );
14
+
15
+ update_post_meta( $pid, '_sale_price_dates_to', $tmp = get_post_meta( $pid, '_sale_price_dates_to_tmp', true ) );
16
+ delete_post_meta( $pid, '_sale_price_dates_to_tmp' );
17
+
18
+ update_post_meta( $pid, '_price', $tmp = get_post_meta( $pid, '_price_tmp', true ) );
19
+ delete_post_meta( $pid, '_price_tmp' );
20
+ }
models/import/record.php CHANGED
@@ -10,6 +10,13 @@ class PMWI_Import_Record extends PMWI_Model_Record {
10
 
11
  public $options = array();
12
 
 
 
 
 
 
 
 
13
  /**
14
  * Initialize model instance
15
  * @param array[optional] $data Array of record data to initialize object with
@@ -34,7 +41,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
34
 
35
  add_filter('user_has_cap', array($this, '_filter_has_cap_unfiltered_html')); kses_init(); // do not perform special filtering for imported content
36
 
37
- $this->options = $import->options;
38
 
39
  $cxpath = $xpath_prefix . $import->xpath;
40
 
@@ -114,7 +121,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
114
  }
115
 
116
  if ("" != $import->options['single_product_regular_price']){
117
- $this->data['product_regular_price'] = array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $cxpath, $import->options['single_product_regular_price'], $file)->parse($records)); $tmp_files[] = $file;
118
  }
119
  else{
120
  $count and $this->data['product_regular_price'] = array_fill(0, $count, "");
@@ -135,7 +142,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
135
  }
136
 
137
  if ("" != $import->options['single_product_sale_price']){
138
- $this->data['product_sale_price'] = array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $cxpath, $import->options['single_product_sale_price'], $file)->parse($records)); $tmp_files[] = $file;
139
  }
140
  else{
141
  $count and $this->data['product_sale_price'] = array_fill(0, $count, "");
@@ -218,6 +225,12 @@ class PMWI_Import_Record extends PMWI_Model_Record {
218
  if ($import->options['product_stock_status'] == 'xpath' and "" != $import->options['single_product_stock_status']){
219
  $this->data['product_stock_status'] = XmlImportParser::factory($xml, $cxpath, $import->options['single_product_stock_status'], $file)->parse($records); $tmp_files[] = $file;
220
  }
 
 
 
 
 
 
221
  else{
222
  $count and $this->data['product_stock_status'] = array_fill(0, $count, $import->options['product_stock_status']);
223
  }
@@ -442,109 +455,101 @@ class PMWI_Import_Record extends PMWI_Model_Record {
442
  return ("" == $var) ? false : true;
443
  }
444
 
445
- public function import($importData = array()){ //$pid, $i, $import, $articleData, $xml, $is_cron = false, $xpath_prefix = ""
446
 
447
- extract($importData);
448
 
449
- if ($import->options['custom_type'] != 'product') return;
450
 
451
- $cxpath = $xpath_prefix . $import->xpath;
452
 
453
  global $woocommerce;
454
 
455
  extract($this->data);
456
 
457
- // Add any default post meta
458
- add_post_meta( $pid, 'total_sales', '0', true );
459
 
460
  // Get types
461
- $product_type = empty( $product_types[$i] ) ? 'simple' : sanitize_title( stripslashes( $product_types[$i] ) );
462
 
463
- if ( ! $import->options['is_update_product_type'] and ! empty($articleData['ID']) ){
464
-
465
- $product = get_product($pid);
466
- $product_type = $product->product_type;
467
 
468
- /*if ( strpos($articleData['post_title'], 'Variation') === 0 ) {
469
- $this->wpdb->update( $this->wpdb->posts, array('post_type' => 'product_variation', array('ID' => $articleData['ID']) ));
470
- $product_type = 'variable';
471
- }*/
472
 
473
- }
 
 
 
474
 
475
  $is_downloadable = $product_downloadable[$i];
476
  $is_virtual = $product_virtual[$i];
477
  $is_featured = $product_featured[$i];
478
 
479
- if ( class_exists('woocommerce_wholesale_pricing') ):
480
- if ($product_type == "simple") add_action( 'woocommerce_process_product_meta_simple', array( &$this, 'process_product_meta' ), 2, 1 );
481
- if ($product_type == "variable") add_action( 'woocommerce_save_product_variation', array( &$this, 'process_product_meta_variable' ), 1000, 1 );
482
- endif;
483
-
484
- $existing_meta_keys = array();
485
- foreach (get_post_meta($pid, '') as $cur_meta_key => $cur_meta_val) $existing_meta_keys[] = $cur_meta_key;
486
-
487
  // Product type + Downloadable/Virtual
488
- if (empty($articleData['ID']) or $import->options['is_update_product_type']) wp_set_object_terms( $pid, $product_type, 'product_type' );
489
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_downloadable')) update_post_meta( $pid, '_downloadable', ($is_downloadable == "yes") ? 'yes' : 'no' );
490
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_virtual')) update_post_meta( $pid, '_virtual', ($is_virtual == "yes") ? 'yes' : 'no' );
 
 
491
 
492
  // Update post meta
493
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_regular_price')) update_post_meta( $pid, '_regular_price', stripslashes( $product_regular_price[$i] ) );
494
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price')) update_post_meta( $pid, '_sale_price', stripslashes( $product_sale_price[$i] ) );
495
- if ( class_exists('woocommerce_wholesale_pricing') and (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, 'wholesale_price'))) update_post_meta( $pid, 'pmxi_wholesale_price', stripslashes( $product_whosale_price[$i] ) );
496
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_tax_status')) update_post_meta( $pid, '_tax_status', stripslashes( $product_tax_status[$i] ) );
497
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_tax_class')) update_post_meta( $pid, '_tax_class', stripslashes( $product_tax_class[$i] ) );
498
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_visibility')) update_post_meta( $pid, '_visibility', stripslashes( $product_visibility[$i] ) );
499
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_purchase_note')) update_post_meta( $pid, '_purchase_note', stripslashes( $product_purchase_note[$i] ) );
500
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_featured')) update_post_meta( $pid, '_featured', ($is_featured == "yes") ? 'yes' : 'no' );
501
 
502
  // Dimensions
503
  if ( $is_virtual == 'no' ) {
504
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_weight')) update_post_meta( $pid, '_weight', stripslashes( $product_weight[$i] ) );
505
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_length')) update_post_meta( $pid, '_length', stripslashes( $product_length[$i] ) );
506
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_width')) update_post_meta( $pid, '_width', stripslashes( $product_width[$i] ) );
507
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_height')) update_post_meta( $pid, '_height', stripslashes( $product_height[$i] ) );
508
  } else {
509
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_weight')) update_post_meta( $pid, '_weight', '' );
510
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_length')) update_post_meta( $pid, '_length', '' );
511
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_width')) update_post_meta( $pid, '_width', '' );
512
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_height')) update_post_meta( $pid, '_height', '' );
513
- }
514
 
515
  $this->wpdb->update( $this->wpdb->posts, array('comment_status' => ($product_enable_reviews[$i] == 'yes') ? 'open' : 'closed' ), array('ID' => $pid));
516
- // update menu order
517
- if ($import->options['is_update_menu_order']) $this->wpdb->update( $this->wpdb->posts, array('menu_order' => ($product_menu_order[$i] != '') ? $product_menu_order[$i] : 0 ), array('ID' => $pid));
518
 
519
  // Save shipping class
520
- if ( pmwi_is_update_taxonomy($articleData, $import->options, 'product_shipping_class') ){
521
  $pshipping_class = is_numeric($product_shipping_class[$i]) && $product_shipping_class[$i] > 0 && $product_type != 'external' ? absint( $product_shipping_class[$i] ) : $product_shipping_class[$i];
522
  if ($pshipping_class == "-1")
523
  wp_set_object_terms( $pid, NULL, 'product_shipping_class');
524
  else
525
- wp_set_object_terms( $pid, $pshipping_class, 'product_shipping_class');
526
  }
527
 
528
  // Unique SKU
529
- $sku = get_post_meta($pid, '_sku', true);
530
  $new_sku = esc_html( trim( stripslashes( $product_sku[$i] ) ) );
531
 
532
- if ( $new_sku == '' and $import->options['disable_auto_sku_generation'] ) {
533
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sku'))
534
- update_post_meta( $pid, '_sku', '' );
535
  }
536
- elseif ( $new_sku == '' and ! $import->options['disable_auto_sku_generation'] ) {
537
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sku')){
538
- $unique_keys = XmlImportParser::factory($xml, $cxpath, $import->options['unique_key'], $file)->parse(); $tmp_files[] = $file;
539
  foreach ($tmp_files as $file) { // remove all temporary files created
540
- unlink($file);
541
  }
542
  $new_sku = substr(md5($unique_keys[$i]), 0, 12);
543
  }
544
  }
545
  if ( $new_sku != '' and $new_sku !== $sku ) {
546
  if ( ! empty( $new_sku ) ) {
547
- if ( ! $import->options['disable_sku_matching'] and
548
  $this->wpdb->get_var( $this->wpdb->prepare("
549
  SELECT ".$this->wpdb->posts.".ID
550
  FROM ".$this->wpdb->posts."
@@ -555,19 +560,21 @@ class PMWI_Import_Record extends PMWI_Model_Record {
555
  ", $new_sku ) )
556
  ) {
557
  $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Product SKU must be unique.', 'pmxi_plugin')));
558
- $logger and PMXI_Plugin::$session['pmxi_import']['warnings'] = ++PMXI_Plugin::$session->data['pmxi_import']['warnings'];
559
- } else {
560
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sku')) update_post_meta( $pid, '_sku', $new_sku );
561
  }
562
  } else {
563
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sku')) update_post_meta( $pid, '_sku', '' );
564
  }
565
  }
566
 
567
  // Save Attributes
568
  $attributes = array();
569
 
570
- if ( $import->options['update_all_data'] == "yes" or ( $import->options['update_all_data'] == "no" and $import->options['is_update_attributes']) or empty($articleData['ID'])): // Update Product Attributes
 
 
571
 
572
  $is_update_attributes = true;
573
 
@@ -588,9 +595,9 @@ class PMWI_Import_Record extends PMWI_Model_Record {
588
  $is_taxonomy = intval( $attr_data['in_taxonomy'][$i] );
589
 
590
  // Update only these Attributes, leave the rest alone
591
- if ($import->options['update_all_data'] == "no" and $import->options['update_attributes_logic'] == 'only'){
592
- if ( ! empty($import->options['attributes_list']) and is_array($import->options['attributes_list'])) {
593
- if ( ! in_array( ( ($is_taxonomy) ? wc_attribute_taxonomy_name( $attr_name ) : $attr_name ) , array_filter($import->options['attributes_list'], 'trim'))){
594
  $attribute_position++;
595
  continue;
596
  }
@@ -602,9 +609,9 @@ class PMWI_Import_Record extends PMWI_Model_Record {
602
  }
603
 
604
  // Leave these attributes alone, update all other Attributes
605
- if ($import->options['update_all_data'] == "no" and $import->options['update_attributes_logic'] == 'all_except'){
606
- if ( ! empty($import->options['attributes_list']) and is_array($import->options['attributes_list'])) {
607
- if ( in_array( ( ($is_taxonomy) ? wc_attribute_taxonomy_name( $attr_name ) : $attr_name ) , array_filter($import->options['attributes_list'], 'trim'))){
608
  $attribute_position++;
609
  continue;
610
  }
@@ -624,39 +631,26 @@ class PMWI_Import_Record extends PMWI_Model_Record {
624
 
625
  if ( ! empty($values) and taxonomy_exists( wc_attribute_taxonomy_name( $attr_name ) )){
626
 
627
- $attr_values = array();
628
-
629
- $terms = get_terms( wc_attribute_taxonomy_name( $attr_name ), array('hide_empty' => false));
630
-
631
- if ( ! is_wp_error($terms) ){
632
 
633
- foreach ($values as $key => $value) {
634
- $term_founded = false;
635
- if ( count($terms) > 0 ){
636
- foreach ( $terms as $term ) {
637
- if ( strtolower($term->name) == trim(strtolower($value)) or $term->slug == sanitize_title(trim(strtolower($value))) or $term->slug == trim($value)) {
638
- $attr_values[] = (int) $term->term_id;
639
- $term_founded = true;
640
- break;
641
- }
642
- }
643
- }
644
- if ( ! $term_founded and intval($attr_data['is_create_taxonomy_terms'][$i]) ){
645
- $term = wp_insert_term(
646
  $value, // the term
647
- wc_attribute_taxonomy_name( $attr_name ) // the taxonomy
648
- );
649
- if ( ! is_wp_error($term) )
650
- $attr_values[] = (int) $term['term_id'];
651
-
652
- }
653
- }
654
-
655
- }
656
- else {
657
- $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: %s.', 'pmxi_plugin'), $terms->get_error_message()));
658
- $logger and PMXI_Plugin::$session['pmxi_import']['warnings'] = ++PMXI_Plugin::$session->data['pmxi_import']['warnings'];
659
- }
660
 
661
  $values = $attr_values;
662
  $values = array_map( 'intval', $values );
@@ -668,7 +662,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
668
 
669
  // Update post terms
670
  if ( taxonomy_exists( wc_attribute_taxonomy_name( $attr_name ) ))
671
- wp_set_object_terms( $pid, $values, wc_attribute_taxonomy_name( $attr_name ) );
672
 
673
  if ( !empty($values) ) {
674
  // Add attribute to array, but don't set values
@@ -704,15 +698,19 @@ class PMWI_Import_Record extends PMWI_Model_Record {
704
 
705
  }
706
 
 
 
 
 
707
  $attribute_position++;
708
  }
709
  }
710
 
711
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_product_attributes') and $is_update_attributes) {
712
 
713
  $current_product_attributes = get_post_meta($pid, '_product_attributes', true);
714
 
715
- update_post_meta( $pid, '_product_attributes', (( ! empty($current_product_attributes)) ? array_merge($current_product_attributes, $attributes) : $attributes) );
716
  }
717
 
718
  endif; // is update attributes
@@ -725,65 +723,46 @@ class PMWI_Import_Record extends PMWI_Model_Record {
725
 
726
  // Dates
727
  if ( $date_from ){
728
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_from')) update_post_meta( $pid, '_sale_price_dates_from', strtotime( $date_from ) );
729
  }
730
  else{
731
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_from')) update_post_meta( $pid, '_sale_price_dates_from', '' );
732
  }
733
 
734
  if ( $date_to ){
735
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_to')) update_post_meta( $pid, '_sale_price_dates_to', strtotime( $date_to ) );
736
  }
737
  else{
738
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_to')) update_post_meta( $pid, '_sale_price_dates_to', '' );
739
  }
740
 
741
  if ( $date_to && ! $date_from ){
742
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_from')) update_post_meta( $pid, '_sale_price_dates_from', strtotime( 'NOW', current_time( 'timestamp' ) ) );
743
  }
744
 
745
  // Update price if on sale
746
  if ( $product_sale_price[$i] != '' && $date_to == '' && $date_from == '' ){
747
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_price')) update_post_meta( $pid, '_price', stripslashes( $product_sale_price[$i] ) );
748
  }
749
  else{
750
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_price')) update_post_meta( $pid, '_price', stripslashes( $product_regular_price[$i] ) );
751
  }
752
 
753
- if ( $product_sale_price[$i] != '' && $date_from && strtotime( $date_from ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ){
754
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_price')) update_post_meta( $pid, '_price', stripslashes($product_sale_price[$i]) );
755
  }
756
 
757
  if ( $date_to && strtotime( $date_to ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
758
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_price')) update_post_meta( $pid, '_price', stripslashes($product_regular_price[$i]) );
759
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_from')) update_post_meta( $pid, '_sale_price_dates_from', '');
760
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_to')) update_post_meta( $pid, '_sale_price_dates_to', '');
761
  }
762
- }
763
-
764
- // Variable and grouped products have no prices
765
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_regular_price')){
766
- update_post_meta( $pid, '_regular_price_tmp', $tmp = get_post_meta( $pid, '_regular_price', true) );
767
- }
768
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price')){
769
- update_post_meta( $pid, '_sale_price_tmp', $tmp = get_post_meta( $pid, '_sale_price', true ) );
770
- }
771
- if ( class_exists('woocommerce_wholesale_pricing') and (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, 'wholesale_price'))){
772
- update_post_meta( $pid, 'pmxi_wholesale_price_tmp', $tmp = get_post_meta( $pid, 'pmxi_wholesale_price', true ) );
773
  }
774
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_from')){
775
- update_post_meta( $pid, '_sale_price_dates_from_tmp', $tmp = get_post_meta( $pid, '_sale_price_dates_from', true ) );
776
- }
777
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sale_price_dates_to')){
778
- update_post_meta( $pid, '_sale_price_dates_to_tmp', $tmp = get_post_meta( $pid, '_sale_price_dates_to', true ) );
779
- }
780
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_price')){
781
- update_post_meta( $pid, '_price_tmp', $tmp = get_post_meta( $pid, '_price', true ) );
782
- }
783
 
784
  if (in_array( $product_type, array( 'simple', 'external' ) )) {
785
- if ($import->options['is_multiple_grouping_product'] != 'yes'){
786
- if ($import->options['grouping_indicator'] == 'xpath' and ! is_numeric($product_grouping_parent[$i])){
 
787
  $dpost = pmxi_findDuplicates(array(
788
  'post_type' => 'product',
789
  'ID' => $pid,
@@ -795,7 +774,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
795
  else
796
  $product_grouping_parent[$i] = 0;
797
  }
798
- elseif ($import->options['grouping_indicator'] != 'xpath'){
799
  $dpost = pmxi_findDuplicates($articleData, $custom_grouping_indicator_name[$i], $custom_grouping_indicator_value[$i], 'custom field');
800
  if (!empty($dpost))
801
  $product_grouping_parent[$i] = array_shift($dpost);
@@ -805,12 +784,11 @@ class PMWI_Import_Record extends PMWI_Model_Record {
805
  }
806
 
807
  if ( "" != $product_grouping_parent[$i] and absint($product_grouping_parent[$i]) > 0){
808
- wp_update_post(array(
809
- 'ID' => $pid,
810
- 'post_parent' => absint( $product_grouping_parent[$i] )
811
- ));
812
  }
813
- }
814
 
815
  // Update parent if grouped so price sorting works and stays in sync with the cheapest child
816
  if ( $product_type == 'grouped' || ( "" != $product_grouping_parent[$i] and absint($product_grouping_parent[$i]) > 0)) {
@@ -837,67 +815,67 @@ class PMWI_Import_Record extends PMWI_Model_Record {
837
  ) );
838
  if ( $children_by_price ) {
839
  foreach ( $children_by_price as $child ) {
840
- $child_price = get_post_meta( $child, '_price', true );
841
  update_post_meta( $clear_id, '_price', $child_price );
842
  }
843
  }
844
 
845
  // Clear cache/transients
846
- wc_delete_product_transients( $clear_id );
847
  }
848
  }
849
- }
850
 
851
  // Sold Individuall
852
  if ( "yes" == $product_sold_individually[$i] ) {
853
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sold_individually')) update_post_meta( $pid, '_sold_individually', 'yes' );
854
  } else {
855
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_sold_individually')) update_post_meta( $pid, '_sold_individually', '' );
856
  }
857
-
858
  // Stock Data
859
  if ( strtolower($product_manage_stock[$i]) == 'yes' ) {
860
 
861
  if ( $product_type == 'grouped' ) {
862
 
863
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', stripslashes( $product_stock_status[$i] ) );
864
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', '' );
865
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_manage_stock')) update_post_meta( $pid, '_manage_stock', 'no' );
866
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_backorders')) update_post_meta( $pid, '_backorders', 'no' );
867
-
868
  } elseif ( $product_type == 'external' ) {
869
 
870
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', 'instock' );
871
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', '' );
872
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_manage_stock')) update_post_meta( $pid, '_manage_stock', 'no' );
873
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_backorders')) update_post_meta( $pid, '_backorders', 'no' );
874
-
875
  } elseif ( ! empty( $product_manage_stock[$i] ) ) {
876
 
877
  // Manage stock
878
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', (int) $product_stock_qty[$i] );
879
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', stripslashes( $product_stock_status[$i] ) );
880
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_backorders')) update_post_meta( $pid, '_backorders', stripslashes( $product_allow_backorders[$i] ) );
881
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_manage_stock')) update_post_meta( $pid, '_manage_stock', 'yes' );
882
 
883
  // Check stock level
884
  if ( $product_type !== 'variable' && $product_allow_backorders[$i] == 'no' && (int) $product_stock_qty[$i] < 1 ){
885
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', 'outofstock' );
886
  }
887
 
888
  } else {
889
 
890
  // Don't manage stock
891
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', '' );
892
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', stripslashes( $product_stock_status[$i] ) );
893
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_backorders')) update_post_meta( $pid, '_backorders', stripslashes( $product_allow_backorders[$i] ) );
894
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_manage_stock')) update_post_meta( $pid, '_manage_stock', 'no' );
895
 
896
  }
897
 
898
  } else {
899
 
900
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', stripslashes( $product_stock_status[$i] ) );
901
 
902
  }
903
 
@@ -922,9 +900,10 @@ class PMWI_Import_Record extends PMWI_Model_Record {
922
  wp_reset_postdata();
923
  }
924
 
925
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_upsell_ids')) update_post_meta( $pid, '_upsell_ids', $upsells );
 
926
  } else {
927
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_upsell_ids')) delete_post_meta( $pid, '_upsell_ids' );
928
  }
929
 
930
  // Cross sells
@@ -947,10 +926,11 @@ class PMWI_Import_Record extends PMWI_Model_Record {
947
 
948
  wp_reset_postdata();
949
  }
 
 
950
 
951
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_crosssell_ids')) update_post_meta( $pid, '_crosssell_ids', $crosssells );
952
  } else {
953
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_crosssell_ids')) delete_post_meta( $pid, '_crosssell_ids' );
954
  }
955
 
956
  // Downloadable options
@@ -968,23 +948,196 @@ class PMWI_Import_Record extends PMWI_Model_Record {
968
  if ( !empty( $product_files[$i] ) ) {
969
  $_file_paths = array();
970
 
971
- $file_paths = explode( $import->options['product_files_delim'] , $product_files[$i] );
972
- $file_names = explode( $import->options['product_files_names_delim'] , $product_files_names[$i] );
973
 
974
  foreach ( $file_paths as $fn => $file_path ) {
975
  $file_path = trim( $file_path );
976
  $_file_paths[ md5( $file_path ) ] = array('name' => ((!empty($file_names[$fn])) ? $file_names[$fn] : basename($file_path)), 'file' => $file_path);
977
  }
978
 
979
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_downloadable_files')) update_post_meta( $pid, '_downloadable_files', $_file_paths );
 
980
  }
981
  if ( isset( $product_download_limit[$i] ) )
982
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_download_limit')) update_post_meta( $pid, '_download_limit', esc_attr( $_download_limit ) );
 
983
  if ( isset( $product_download_expiry[$i] ) )
984
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_download_expiry')) update_post_meta( $pid, '_download_expiry', esc_attr( $_download_expiry ) );
 
985
  if ( isset( $product_download_type[$i] ) )
986
- if (empty($articleData['ID']) or $this->is_update_custom_field($existing_meta_keys, $import->options, '_download_type')) update_post_meta( $pid, '_download_type', esc_attr( $product_download_type[$i] ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
987
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
988
 
989
  }
990
 
@@ -1012,7 +1165,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
1012
  );
1013
 
1014
  if ( in_array( $attribute_name, $reserved_terms ) ) {
1015
- $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Slug “%s” is not allowed because it is a reserved term. Change it, please.', 'pmxi_plugin'), wc_attribute_taxonomy_name( $attribute_name )));
1016
  }
1017
  else{
1018
  // Register the taxonomy now so that the import works!
@@ -1044,11 +1197,11 @@ class PMWI_Import_Record extends PMWI_Model_Record {
1044
  set_transient( 'wc_attribute_taxonomies', $attribute_taxonomies );
1045
  apply_filters( 'woocommerce_attribute_taxonomies', $attribute_taxonomies );
1046
 
1047
- $logger and call_user_func($logger, sprintf(__('<b>CREATED</b>: Taxonomy attribute “%s” have been successfully created.', 'pmxi_plugin'), wc_attribute_taxonomy_name( $attribute_name )));
1048
 
1049
  }
1050
  else{
1051
- $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Taxonomy “%s” name is more than 32 characters. Change it, please.', 'pmxi_plugin'), $attr_name));
1052
  }
1053
 
1054
  }
@@ -1157,87 +1310,64 @@ class PMWI_Import_Record extends PMWI_Model_Record {
1157
 
1158
  function array_cartesian( $input ) {
1159
 
1160
- $result = array();
1161
-
1162
- while ( list( $key, $values ) = each( $input ) ) {
1163
- // If a sub-array is empty, it doesn't affect the cartesian product
1164
- if ( empty( $values ) ) {
1165
- continue;
1166
- }
1167
-
1168
- // Special case: seeding the product array with the values from the first sub-array
1169
- if ( empty( $result ) ) {
1170
- foreach ( $values as $value ) {
1171
- $result[] = array( $key => $value );
1172
- }
1173
- }
1174
- else {
1175
- // Second and subsequent input sub-arrays work like this:
1176
- // 1. In each existing array inside $product, add an item with
1177
- // key == $key and value == first item in input sub-array
1178
- // 2. Then, for each remaining item in current input sub-array,
1179
- // add a copy of each existing array inside $product with
1180
- // key == $key and value == first item in current input sub-array
1181
-
1182
- // Store all items to be added to $product here; adding them on the spot
1183
- // inside the foreach will result in an infinite loop
1184
- $append = array();
1185
- foreach( $result as &$product ) {
1186
- // Do step 1 above. array_shift is not the most efficient, but it
1187
- // allows us to iterate over the rest of the items with a simple
1188
- // foreach, making the code short and familiar.
1189
- $product[ $key ] = array_shift( $values );
1190
-
1191
- // $product is by reference (that's why the key we added above
1192
- // will appear in the end result), so make a copy of it here
1193
- $copy = $product;
1194
-
1195
- // Do step 2 above.
1196
- foreach( $values as $item ) {
1197
- $copy[ $key ] = $item;
1198
- $append[] = $copy;
1199
- }
1200
-
1201
- // Undo the side effecst of array_shift
1202
- array_unshift( $values, $product[ $key ] );
1203
- }
1204
-
1205
- // Out of the foreach, we can add to $results now
1206
- $result = array_merge( $result, $append );
1207
- }
1208
- }
1209
-
1210
- return $result;
1211
- }
1212
 
1213
  public function _filter_has_cap_unfiltered_html($caps)
1214
  {
1215
  $caps['unfiltered_html'] = true;
1216
  return $caps;
1217
- }
1218
-
1219
- function duplicate_post_copy_post_meta_info($new_id, $post, $options = array(), $is_duplicate = false) {
1220
- $post_meta_keys = get_post_custom_keys($post->ID);
1221
- $meta_blacklist = array();
1222
- $meta_keys = array_diff($post_meta_keys, $meta_blacklist);
1223
-
1224
- foreach ($meta_keys as $meta_key) {
1225
- $meta_values = get_post_custom_values($meta_key, $post->ID);
1226
-
1227
- foreach ($meta_values as $meta_value) {
1228
- $meta_value = maybe_unserialize($meta_value);
1229
- if ( ! $is_duplicate or $this->is_update_custom_field($existing_meta_keys, $options, $meta_key)) update_post_meta($new_id, $meta_key, $meta_value);
1230
- }
1231
- }
1232
-
1233
- update_post_meta( $post->ID, '_stock_tmp', $tmp = get_post_meta( $post->ID, '_stock', true) );
1234
- update_post_meta( $post->ID, '_stock', '');
1235
- update_post_meta( $post->ID, '_regular_price_tmp', $tmp = get_post_meta( $post->ID, '_regular_price', true) );
1236
- update_post_meta( $post->ID, '_regular_price', '' );
1237
- update_post_meta( $post->ID, '_price_tmp', $tmp = get_post_meta( $post->ID, '_price', true) );
1238
- update_post_meta( $post->ID, '_price', '');
1239
-
1240
- }
1241
 
1242
  function auto_cloak_links($import, &$url){
1243
 
@@ -1304,8 +1434,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
1304
  ));
1305
  $dest->insert();
1306
  } else {
1307
- $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Unable to create cloaked link for %s', 'pmxi_plugin'), $url));
1308
- PMXI_Plugin::$session['pmxi_import']['warnings'] = PMXI_Plugin::$session->data['pmxi_import']['warnings']++;
1309
  $link = NULL;
1310
  }
1311
  }
@@ -1327,86 +1456,17 @@ class PMWI_Import_Record extends PMWI_Model_Record {
1327
  if ($options['update_custom_fields_logic'] == "all_except" and ( empty($options['custom_fields_list']) or ! in_array($meta_key, $options['custom_fields_list']) )) return true;
1328
 
1329
  return false;
1330
- }
1331
-
1332
- // process simple product meta
1333
- function process_product_meta( $post_id, $post = '' ) {
1334
-
1335
- $wholesale_price = get_post_meta($post_id, 'pmxi_wholesale_price', true);
1336
-
1337
- if ( '' !== $wholesale_price )
1338
- update_post_meta( $post_id, 'wholesale_price', stripslashes( $wholesale_price ) );
1339
- else
1340
- delete_post_meta( $post_id, 'pmxi_wholesale_price' );
1341
- }
1342
-
1343
- // process variable product meta
1344
- function process_product_meta_variable( $post_id ) {
1345
-
1346
- $product = get_post($post_id);
1347
-
1348
- if ( $product->post_type == 'product_variation' ) {
1349
-
1350
- $wholesale_price = get_post_meta($post_id, 'pmxi_wholesale_price', true);
1351
-
1352
- if ( '' !== $wholesale_price )
1353
- update_post_meta( $post_id, 'wholesale_price', stripslashes( $wholesale_price ) );
1354
- else
1355
- delete_post_meta( $post_id, 'pmxi_wholesale_price' );
1356
-
1357
- $post_parent = $product->post_parent;
1358
-
1359
- }
1360
- else $post_parent = $post_id;
1361
-
1362
- $children = get_posts( array(
1363
- 'post_parent' => $post_parent,
1364
- 'posts_per_page'=> -1,
1365
- 'post_type' => 'product_variation',
1366
- 'fields' => 'ids'
1367
- ) );
1368
-
1369
- $lowest_price = '';
1370
-
1371
- $highest_price = '';
1372
-
1373
- if ( $children ) {
1374
-
1375
- foreach ( $children as $child ) {
1376
-
1377
- $child_price = get_post_meta($child, 'pmxi_wholesale_price', true);
1378
-
1379
-
1380
- if ( !$child_price ) continue;
1381
 
1382
- // Low price
1383
- if ( !is_numeric( $lowest_price ) || $child_price < $lowest_price ) $lowest_price = $child_price;
1384
-
1385
-
1386
- // High price
1387
- if ( $child_price > $highest_price )
1388
- $highest_price = $child_price;
1389
-
1390
- }
1391
-
1392
-
1393
- }
1394
-
1395
- update_post_meta( $post_parent, 'wholesale_price', $lowest_price );
1396
- update_post_meta( $post_parent, 'min_variation_wholesale_price', $lowest_price );
1397
- update_post_meta( $post_parent, 'max_variation_wholesale_price', $highest_price );
1398
 
 
1399
 
1400
  }
1401
-
1402
- function prepare_price( $price ){
1403
 
1404
- if ($this->options['disable_prepare_price']) return apply_filters('pmxi_price', $price);
1405
 
1406
- $price = str_replace(",", ".", preg_replace("/[^0-9\.,]/","", $price));
1407
-
1408
- $price = str_replace(",", ".", str_replace(".", "", preg_replace("%\.([0-9]){1,2}?$%", ",$0", $price)));
1409
-
1410
- return ("" != $price) ? apply_filters('pmxi_price', number_format( (double) $price, 2, '.', '')) : "";
1411
  }
1412
  }
10
 
11
  public $options = array();
12
 
13
+ public $previousID;
14
+
15
+ public $post_meta_to_update;
16
+ public $post_meta_to_insert;
17
+ public $existing_meta_keys;
18
+ public $articleData;
19
+
20
  /**
21
  * Initialize model instance
22
  * @param array[optional] $data Array of record data to initialize object with
41
 
42
  add_filter('user_has_cap', array($this, '_filter_has_cap_unfiltered_html')); kses_init(); // do not perform special filtering for imported content
43
 
44
+ $this->options = $import->options;
45
 
46
  $cxpath = $xpath_prefix . $import->xpath;
47
 
121
  }
122
 
123
  if ("" != $import->options['single_product_regular_price']){
124
+ $this->data['product_regular_price'] = array_map(array($this, 'adjust_price'), array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $cxpath, $import->options['single_product_regular_price'], $file)->parse($records)), array_fill(0, $count, "regular_price")); $tmp_files[] = $file;
125
  }
126
  else{
127
  $count and $this->data['product_regular_price'] = array_fill(0, $count, "");
142
  }
143
 
144
  if ("" != $import->options['single_product_sale_price']){
145
+ $this->data['product_sale_price'] = array_map(array($this, 'adjust_price'), array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $cxpath, $import->options['single_product_sale_price'], $file)->parse($records)), array_fill(0, $count, "sale_price")); $tmp_files[] = $file;
146
  }
147
  else{
148
  $count and $this->data['product_sale_price'] = array_fill(0, $count, "");
225
  if ($import->options['product_stock_status'] == 'xpath' and "" != $import->options['single_product_stock_status']){
226
  $this->data['product_stock_status'] = XmlImportParser::factory($xml, $cxpath, $import->options['single_product_stock_status'], $file)->parse($records); $tmp_files[] = $file;
227
  }
228
+ elseif($import->options['product_stock_status'] == 'auto'){
229
+ $count and $this->data['product_stock_status'] = array_fill(0, $count, $import->options['product_stock_status']);
230
+ foreach ($this->data['product_stock_qty'] as $key => $value) {
231
+ $this->data['product_stock_status'][$key] = ($value === 0) ? 'outofstock' : 'instock';
232
+ }
233
+ }
234
  else{
235
  $count and $this->data['product_stock_status'] = array_fill(0, $count, $import->options['product_stock_status']);
236
  }
455
  return ("" == $var) ? false : true;
456
  }
457
 
458
+ public function import( $importData = array() ){
459
 
460
+ extract($importData);
461
 
462
+ if ($this->options['custom_type'] != 'product') return;
463
 
464
+ $cxpath = $xpath_prefix . $import->xpath;
465
 
466
  global $woocommerce;
467
 
468
  extract($this->data);
469
 
470
+ $is_new_product = empty($articleData['ID']);
 
471
 
472
  // Get types
473
+ $product_type = empty( $product_types[$i] ) ? 'simple' : sanitize_title( stripslashes( $product_types[$i] ) );
474
 
475
+ if ( ! $this->options['is_update_product_type'] and ! $is_new_product ){
476
+ $product = get_product($pid);
477
+ $product_type = $product->product_type;
478
+ }
479
 
480
+ $this->existing_meta_keys = array();
481
+ foreach (get_post_meta($pid, '') as $cur_meta_key => $cur_meta_val) $this->existing_meta_keys[] = $cur_meta_key;
 
 
482
 
483
+ $this->post_meta_to_update = array(); // for bulk UPDATE SQL query
484
+ $this->post_meta_to_insert = array(); // for bulk INSERT SQL query
485
+ $this->articleData = $articleData;
486
+ $this->pushmeta($pid, 'total_sales', '0');
487
 
488
  $is_downloadable = $product_downloadable[$i];
489
  $is_virtual = $product_virtual[$i];
490
  $is_featured = $product_featured[$i];
491
 
 
 
 
 
 
 
 
 
492
  // Product type + Downloadable/Virtual
493
+ if ($is_new_product or $this->options['is_update_product_type'])
494
+ wp_set_object_terms( $pid, $product_type, 'product_type' );
495
+
496
+ $this->pushmeta($pid, '_downloadable', ($is_downloadable == "yes") ? 'yes' : 'no' );
497
+ $this->pushmeta($pid, '_virtual', ($is_virtual == "yes") ? 'yes' : 'no' );
498
 
499
  // Update post meta
500
+ $this->pushmeta($pid, '_regular_price', stripslashes( $product_regular_price[$i] ) );
501
+ $this->pushmeta($pid, '_sale_price', stripslashes( $product_sale_price[$i] ) );
502
+ $this->pushmeta($pid, '_tax_status', stripslashes( $product_tax_status[$i] ) );
503
+ $this->pushmeta($pid, '_tax_class', stripslashes( $product_tax_class[$i] ) );
504
+ $this->pushmeta($pid, '_visibility', stripslashes( $product_visibility[$i] ) );
505
+ $this->pushmeta($pid, '_purchase_note', stripslashes( $product_purchase_note[$i] ) );
506
+ $this->pushmeta($pid, '_featured', ($is_featured == "yes") ? 'yes' : 'no' );
 
507
 
508
  // Dimensions
509
  if ( $is_virtual == 'no' ) {
510
+ $this->pushmeta($pid, '_weight', stripslashes( $product_weight[$i] ) );
511
+ $this->pushmeta($pid, '_length', stripslashes( $product_length[$i] ) );
512
+ $this->pushmeta($pid, '_width', stripslashes( $product_width[$i] ) );
513
+ $this->pushmeta($pid, '_height', stripslashes( $product_height[$i] ) );
514
  } else {
515
+ $this->pushmeta($pid, '_weight', '' );
516
+ $this->pushmeta($pid, '_length', '' );
517
+ $this->pushmeta($pid, '_width', '' );
518
+ $this->pushmeta($pid, '_height', '' );
519
+ }
520
 
521
  $this->wpdb->update( $this->wpdb->posts, array('comment_status' => ($product_enable_reviews[$i] == 'yes') ? 'open' : 'closed' ), array('ID' => $pid));
522
+
523
+ if ($this->options['update_all_data'] == 'yes' or $this->options['is_update_menu_order']) $this->wpdb->update( $this->wpdb->posts, array('menu_order' => ($product_menu_order[$i] != '') ? (int) $product_menu_order[$i] : 0 ), array('ID' => $pid));
524
 
525
  // Save shipping class
526
+ if ( pmwi_is_update_taxonomy($articleData, $this->options, 'product_shipping_class') ){
527
  $pshipping_class = is_numeric($product_shipping_class[$i]) && $product_shipping_class[$i] > 0 && $product_type != 'external' ? absint( $product_shipping_class[$i] ) : $product_shipping_class[$i];
528
  if ($pshipping_class == "-1")
529
  wp_set_object_terms( $pid, NULL, 'product_shipping_class');
530
  else
531
+ $this->associate_terms( $pid, array($pshipping_class), 'product_shipping_class' );
532
  }
533
 
534
  // Unique SKU
535
+ $sku = ($is_new_product) ? '' : get_post_meta($pid, '_sku', true);
536
  $new_sku = esc_html( trim( stripslashes( $product_sku[$i] ) ) );
537
 
538
+ if ( $new_sku == '' and $this->options['disable_auto_sku_generation'] ) {
539
+ $this->pushmeta($pid, '_sku', '' );
 
540
  }
541
+ elseif ( $new_sku == '' and ! $this->options['disable_auto_sku_generation'] ) {
542
+ if ($is_new_product or $this->is_update_cf('_sku')){
543
+ $unique_keys = XmlImportParser::factory($xml, $cxpath, $this->options['unique_key'], $file)->parse(); $tmp_files[] = $file;
544
  foreach ($tmp_files as $file) { // remove all temporary files created
545
+ @unlink($file);
546
  }
547
  $new_sku = substr(md5($unique_keys[$i]), 0, 12);
548
  }
549
  }
550
  if ( $new_sku != '' and $new_sku !== $sku ) {
551
  if ( ! empty( $new_sku ) ) {
552
+ if ( ! $this->options['disable_sku_matching'] and
553
  $this->wpdb->get_var( $this->wpdb->prepare("
554
  SELECT ".$this->wpdb->posts.".ID
555
  FROM ".$this->wpdb->posts."
560
  ", $new_sku ) )
561
  ) {
562
  $logger and call_user_func($logger, sprintf(__('<b>WARNING</b>: Product SKU must be unique.', 'pmxi_plugin')));
563
+
564
+ } else {
565
+ $this->pushmeta($pid, '_sku', $new_sku );
566
  }
567
  } else {
568
+ $this->pushmeta($pid, '_sku', '' );
569
  }
570
  }
571
 
572
  // Save Attributes
573
  $attributes = array();
574
 
575
+ $is_variation_attributes_defined = false;
576
+
577
+ if ( $this->options['update_all_data'] == "yes" or ( $this->options['update_all_data'] == "no" and $this->options['is_update_attributes']) or $is_new_product): // Update Product Attributes
578
 
579
  $is_update_attributes = true;
580
 
595
  $is_taxonomy = intval( $attr_data['in_taxonomy'][$i] );
596
 
597
  // Update only these Attributes, leave the rest alone
598
+ if ($this->options['update_all_data'] == "no" and $this->options['update_attributes_logic'] == 'only'){
599
+ if ( ! empty($this->options['attributes_list']) and is_array($this->options['attributes_list'])) {
600
+ if ( ! in_array( ( ($is_taxonomy) ? wc_attribute_taxonomy_name( $attr_name ) : $attr_name ) , array_filter($this->options['attributes_list'], 'trim'))){
601
  $attribute_position++;
602
  continue;
603
  }
609
  }
610
 
611
  // Leave these attributes alone, update all other Attributes
612
+ if ($this->options['update_all_data'] == "no" and $this->options['update_attributes_logic'] == 'all_except'){
613
+ if ( ! empty($this->options['attributes_list']) and is_array($this->options['attributes_list'])) {
614
+ if ( in_array( ( ($is_taxonomy) ? wc_attribute_taxonomy_name( $attr_name ) : $attr_name ) , array_filter($this->options['attributes_list'], 'trim'))){
615
  $attribute_position++;
616
  continue;
617
  }
631
 
632
  if ( ! empty($values) and taxonomy_exists( wc_attribute_taxonomy_name( $attr_name ) )){
633
 
634
+ $attr_values = array();
 
 
 
 
635
 
636
+ foreach ($values as $key => $value) {
637
+
638
+ $term = term_exists($value, wc_attribute_taxonomy_name( $attr_name ), 0);
639
+
640
+ if ( empty($term) and !is_wp_error($term) ){
641
+ $term = term_exists(htmlspecialchars($value), wc_attribute_taxonomy_name( $attr_name ), 0);
642
+ if ( empty($term) and !is_wp_error($term) and intval($attr_data['is_create_taxonomy_terms'][$i])){
643
+
644
+ $term = wp_insert_term(
 
 
 
 
645
  $value, // the term
646
+ wc_attribute_taxonomy_name( $attr_name ) // the taxonomy
647
+ );
648
+ }
649
+ }
650
+ if ( ! is_wp_error($term) )
651
+ $attr_values[] = (int) $term['term_taxonomy_id'];
652
+
653
+ }
 
 
 
 
 
654
 
655
  $values = $attr_values;
656
  $values = array_map( 'intval', $values );
662
 
663
  // Update post terms
664
  if ( taxonomy_exists( wc_attribute_taxonomy_name( $attr_name ) ))
665
+ $this->associate_terms( $pid, $values, wc_attribute_taxonomy_name( $attr_name ) );
666
 
667
  if ( !empty($values) ) {
668
  // Add attribute to array, but don't set values
698
 
699
  }
700
 
701
+ if ( $is_variation and $attr_data['value'][$i] != "" ) {
702
+ $is_variation_attributes_defined = true;
703
+ }
704
+
705
  $attribute_position++;
706
  }
707
  }
708
 
709
+ if ($is_new_product or $this->is_update_cf('_product_attributes') and $is_update_attributes) {
710
 
711
  $current_product_attributes = get_post_meta($pid, '_product_attributes', true);
712
 
713
+ $this->pushmeta($pid, '_product_attributes', ( ! empty($current_product_attributes)) ? array_merge($current_product_attributes, $attributes) : $attributes );
714
  }
715
 
716
  endif; // is update attributes
723
 
724
  // Dates
725
  if ( $date_from ){
726
+ $this->pushmeta($pid, '_sale_price_dates_from', strtotime( $date_from ));
727
  }
728
  else{
729
+ $this->pushmeta($pid, '_sale_price_dates_from', '');
730
  }
731
 
732
  if ( $date_to ){
733
+ $this->pushmeta($pid, '_sale_price_dates_to', strtotime( $date_to ));
734
  }
735
  else{
736
+ $this->pushmeta($pid, '_sale_price_dates_to', '');
737
  }
738
 
739
  if ( $date_to && ! $date_from ){
740
+ $this->pushmeta($pid, '_sale_price_dates_from', strtotime( 'NOW', current_time( 'timestamp' ) ) );
741
  }
742
 
743
  // Update price if on sale
744
  if ( $product_sale_price[$i] != '' && $date_to == '' && $date_from == '' ){
745
+ $this->pushmeta($pid, '_price', stripslashes( $product_sale_price[$i] ));
746
  }
747
  else{
748
+ $this->pushmeta($pid, '_price', stripslashes( $product_regular_price[$i] ));
749
  }
750
 
751
+ if ( $product_sale_price[$i] != '' && $date_from && strtotime( $date_from ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ){
752
+ $this->pushmeta($pid, '_price', stripslashes( $product_sale_price[$i] ));
753
  }
754
 
755
  if ( $date_to && strtotime( $date_to ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
756
+ $this->pushmeta($pid, '_price', stripslashes( $product_regular_price[$i] ));
757
+ $this->pushmeta($pid, '_sale_price_dates_from', '');
758
+ $this->pushmeta($pid, '_sale_price_dates_to', '');
759
  }
 
 
 
 
 
 
 
 
 
 
 
760
  }
 
 
 
 
 
 
 
 
 
761
 
762
  if (in_array( $product_type, array( 'simple', 'external' ) )) {
763
+
764
+ if ($this->options['is_multiple_grouping_product'] != 'yes'){
765
+ if ($this->options['grouping_indicator'] == 'xpath' and ! is_numeric($product_grouping_parent[$i])){
766
  $dpost = pmxi_findDuplicates(array(
767
  'post_type' => 'product',
768
  'ID' => $pid,
774
  else
775
  $product_grouping_parent[$i] = 0;
776
  }
777
+ elseif ($this->options['grouping_indicator'] != 'xpath'){
778
  $dpost = pmxi_findDuplicates($articleData, $custom_grouping_indicator_name[$i], $custom_grouping_indicator_value[$i], 'custom field');
779
  if (!empty($dpost))
780
  $product_grouping_parent[$i] = array_shift($dpost);
784
  }
785
 
786
  if ( "" != $product_grouping_parent[$i] and absint($product_grouping_parent[$i]) > 0){
787
+
788
+ $this->wpdb->update( $this->wpdb->posts, array('post_parent' => absint( $product_grouping_parent[$i] ) ), array('ID' => $pid));
789
+
 
790
  }
791
+ }
792
 
793
  // Update parent if grouped so price sorting works and stays in sync with the cheapest child
794
  if ( $product_type == 'grouped' || ( "" != $product_grouping_parent[$i] and absint($product_grouping_parent[$i]) > 0)) {
815
  ) );
816
  if ( $children_by_price ) {
817
  foreach ( $children_by_price as $child ) {
818
+ $child_price = get_post_meta( $child, '_price', true );
819
  update_post_meta( $clear_id, '_price', $child_price );
820
  }
821
  }
822
 
823
  // Clear cache/transients
824
+ //wc_delete_product_transients( $clear_id );
825
  }
826
  }
827
+ }
828
 
829
  // Sold Individuall
830
  if ( "yes" == $product_sold_individually[$i] ) {
831
+ $this->pushmeta($pid, '_sold_individually', 'yes');
832
  } else {
833
+ $this->pushmeta($pid, '_sold_individually', '');
834
  }
835
+
836
  // Stock Data
837
  if ( strtolower($product_manage_stock[$i]) == 'yes' ) {
838
 
839
  if ( $product_type == 'grouped' ) {
840
 
841
+ $this->pushmeta($pid, '_stock_status', stripslashes( $product_stock_status[$i] ));
842
+ $this->pushmeta($pid, '_stock', '');
843
+ $this->pushmeta($pid, '_manage_stock', 'no');
844
+ $this->pushmeta($pid, '_backorders', 'no');
845
+
846
  } elseif ( $product_type == 'external' ) {
847
 
848
+ $this->pushmeta($pid, '_stock_status', 'instock');
849
+ $this->pushmeta($pid, '_stock', '');
850
+ $this->pushmeta($pid, '_manage_stock', 'no');
851
+ $this->pushmeta($pid, '_backorders', 'no');
852
+
853
  } elseif ( ! empty( $product_manage_stock[$i] ) ) {
854
 
855
  // Manage stock
856
+ $this->pushmeta($pid, '_stock_status', stripslashes( $product_stock_status[$i] ));
857
+ $this->pushmeta($pid, '_stock', (int) $product_stock_qty[$i]);
858
+ $this->pushmeta($pid, '_manage_stock', 'yes');
859
+ $this->pushmeta($pid, '_backorders', stripslashes( $product_allow_backorders[$i] ));
860
 
861
  // Check stock level
862
  if ( $product_type !== 'variable' && $product_allow_backorders[$i] == 'no' && (int) $product_stock_qty[$i] < 1 ){
863
+ $this->pushmeta($pid, '_stock_status', 'outofstock');
864
  }
865
 
866
  } else {
867
 
868
  // Don't manage stock
869
+ $this->pushmeta($pid, '_stock_status', stripslashes( $product_stock_status[$i] ));
870
+ $this->pushmeta($pid, '_stock', '');
871
+ $this->pushmeta($pid, '_manage_stock', 'no');
872
+ $this->pushmeta($pid, '_backorders', stripslashes( $product_allow_backorders[$i] ));
873
 
874
  }
875
 
876
  } else {
877
 
878
+ $this->pushmeta($pid, '_stock_status', stripslashes( $product_stock_status[$i] ));
879
 
880
  }
881
 
900
  wp_reset_postdata();
901
  }
902
 
903
+ $this->pushmeta($pid, '_upsell_ids', $upsells);
904
+
905
  } else {
906
+ if ($is_new_product or $this->is_update_cf('_upsell_ids')) delete_post_meta( $pid, '_upsell_ids' );
907
  }
908
 
909
  // Cross sells
926
 
927
  wp_reset_postdata();
928
  }
929
+
930
+ $this->pushmeta($pid, '_crosssell_ids', $crosssells);
931
 
 
932
  } else {
933
+ if ($is_new_product or $this->is_update_cf('_crosssell_ids')) delete_post_meta( $pid, '_crosssell_ids' );
934
  }
935
 
936
  // Downloadable options
948
  if ( !empty( $product_files[$i] ) ) {
949
  $_file_paths = array();
950
 
951
+ $file_paths = explode( $this->options['product_files_delim'] , $product_files[$i] );
952
+ $file_names = explode( $this->options['product_files_names_delim'] , $product_files_names[$i] );
953
 
954
  foreach ( $file_paths as $fn => $file_path ) {
955
  $file_path = trim( $file_path );
956
  $_file_paths[ md5( $file_path ) ] = array('name' => ((!empty($file_names[$fn])) ? $file_names[$fn] : basename($file_path)), 'file' => $file_path);
957
  }
958
 
959
+ $this->pushmeta($pid, '_downloadable_files', $_file_paths);
960
+
961
  }
962
  if ( isset( $product_download_limit[$i] ) )
963
+ $this->pushmeta($pid, '_download_limit', esc_attr( $_download_limit ));
964
+
965
  if ( isset( $product_download_expiry[$i] ) )
966
+ $this->pushmeta($pid, '_download_expiry', esc_attr( $_download_expiry ));
967
+
968
  if ( isset( $product_download_type[$i] ) )
969
+ $this->pushmeta($pid, '_download_type', esc_attr( $product_download_type ));
970
+
971
+ }
972
+
973
+ // prepare bulk SQL query
974
+ //$this->executeSQL();
975
+
976
+ }
977
+
978
+ protected function executeSQL(){
979
+ // prepare bulk SQL query
980
+ $table = _get_meta_table('post');
981
+
982
+ if ( $this->post_meta_to_insert ){
983
+ $values = array();
984
+ $already_added = array();
985
+
986
+ foreach (array_reverse($this->post_meta_to_insert) as $key => $value) {
987
+ if ( ! empty($value['meta_key']) and ! in_array($value['pid'] . '-' . $value['meta_key'], $already_added) ){
988
+ $already_added[] = $value['pid'] . '-' . $value['meta_key'];
989
+ $values[] = '(' . $value['pid'] . ',"' . $value['meta_key'] . '",\'' . maybe_serialize($value['meta_value']) .'\')';
990
+ }
991
+ }
992
+
993
+ $this->wpdb->query("INSERT INTO $table (`post_id`, `meta_key`, `meta_value`) VALUES " . implode(',', $values));
994
+ $this->post_meta_to_insert = array();
995
+ }
996
+ }
997
+
998
+ protected function pushmeta($pid, $meta_key, $meta_value){
999
+
1000
+ if (empty($meta_key)) return;
1001
+
1002
+ //$table = _get_meta_table( 'post' );
1003
+
1004
+ if ( empty($this->articleData['ID']) or $this->is_update_cf($meta_key)){
1005
+
1006
+ update_post_meta($pid, $meta_key, $meta_value);
1007
+
1008
+ /*$this->wpdb->query($this->wpdb->prepare("DELETE FROM $table WHERE `post_id` = $pid AND `meta_key` = %s", $meta_key));
1009
+
1010
+ $this->post_meta_to_insert[] = array(
1011
+ 'meta_key' => $meta_key,
1012
+ 'meta_value' => $meta_value,
1013
+ 'pid' => $pid
1014
+ );*/
1015
  }
1016
+ /*elseif ($this->is_update_cf($meta_key)){
1017
+
1018
+ $this->wpdb->query($this->wpdb->prepare("DELETE FROM $table WHERE `post_id` = $pid AND `meta_key` = %s", $meta_key));
1019
+
1020
+ // previous meta field is not found
1021
+ $this->post_meta_to_insert[] = array(
1022
+ 'meta_key' => $meta_key,
1023
+ 'meta_value' => $meta_value,
1024
+ 'pid' => $pid
1025
+ );
1026
+
1027
+ }*/
1028
+
1029
+ }
1030
+
1031
+ /**
1032
+ *
1033
+ * Is update allowed according to import record matching setting
1034
+ *
1035
+ */
1036
+ protected function is_update_cf( $meta_key ){
1037
+
1038
+ if ($this->options['update_all_data'] == 'yes') return true;
1039
+
1040
+ if ( ! $this->options['is_update_custom_fields'] ) return false;
1041
+
1042
+ if ($this->options['update_custom_fields_logic'] == "full_update") return true;
1043
+ if ($this->options['update_custom_fields_logic'] == "only" and ! empty($this->options['custom_fields_list']) and is_array($this->options['custom_fields_list']) and in_array($meta_key, $this->options['custom_fields_list']) ) return true;
1044
+ if ($this->options['update_custom_fields_logic'] == "all_except" and ( empty($this->options['custom_fields_list']) or ! in_array($meta_key, $this->options['custom_fields_list']) )) return true;
1045
+
1046
+ return false;
1047
+
1048
+ }
1049
+
1050
+ protected function associate_terms($pid, $assign_taxes, $tx_name, $logger = false){
1051
+
1052
+ $terms = wp_get_object_terms( $pid, $tx_name );
1053
+ $term_ids = array();
1054
+
1055
+ if ( ! empty($terms) ){
1056
+ if ( ! is_wp_error( $terms ) ) {
1057
+ foreach ($terms as $term_info) {
1058
+ $term_ids[] = $term_info->term_taxonomy_id;
1059
+ $this->wpdb->query( $this->wpdb->prepare("UPDATE {$this->wpdb->term_taxonomy} SET count = count - 1 WHERE term_taxonomy_id = %d", $term_info->term_taxonomy_id) );
1060
+ }
1061
+ $in_tt_ids = "'" . implode( "', '", $term_ids ) . "'";
1062
+ $this->wpdb->query( $this->wpdb->prepare( "DELETE FROM {$this->wpdb->term_relationships} WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $pid ) );
1063
+ }
1064
+ }
1065
+
1066
+ if (empty($assign_taxes)) return;
1067
+
1068
+ foreach ($assign_taxes as $tt) {
1069
+ $this->wpdb->insert( $this->wpdb->term_relationships, array( 'object_id' => $pid, 'term_taxonomy_id' => $tt ) );
1070
+ $this->wpdb->query( "UPDATE {$this->wpdb->term_taxonomy} SET count = count + 1 WHERE term_taxonomy_id = $tt" );
1071
+ }
1072
+
1073
+ $values = array();
1074
+ $term_order = 0;
1075
+ foreach ( $assign_taxes as $tt )
1076
+ $values[] = $this->wpdb->prepare( "(%d, %d, %d)", $pid, $tt, ++$term_order);
1077
+
1078
+
1079
+ if ( $values ){
1080
+ if ( false === $this->wpdb->query( "INSERT INTO {$this->wpdb->term_relationships} (object_id, term_taxonomy_id, term_order) VALUES " . join( ',', $values ) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)" ) ){
1081
+ $logger and call_user_func($logger, __('<b>ERROR</b> Could not insert term relationship into the database', 'pmxi_plugin') . ': '. $this->wpdb->last_error);
1082
+ $logger and PMXI_Plugin::$session['pmxi_import']['errors'] = ++PMXI_Plugin::$session->data['pmxi_import']['errors'];
1083
+ }
1084
+ }
1085
+
1086
+ wp_cache_delete( $pid, $tx_name . '_relationships' );
1087
+ }
1088
+
1089
+ protected function duplicate_post_meta( $new_id, $id ) {
1090
+
1091
+ $table = _get_meta_table('post');
1092
+
1093
+ $post_meta_infos = $this->wpdb->get_results("SELECT meta_key, meta_value FROM $table WHERE post_id=$id");
1094
+
1095
+ if (count($post_meta_infos)!=0) {
1096
+ $sql_query_sel = array();
1097
+ $sql_query = "INSERT INTO $table (post_id, meta_key, meta_value) ";
1098
+ foreach ($post_meta_infos as $meta_info) {
1099
+ if ($this->is_update_cf($meta_info->meta_key)){
1100
+ $meta_key = $meta_info->meta_key;
1101
+ $this->wpdb->query($this->wpdb->prepare("DELETE FROM $table WHERE `post_id` = $new_id AND `meta_key` = %s", $meta_key));
1102
+ $meta_value = addslashes($meta_info->meta_value);
1103
+ $sql_query_sel[]= "SELECT $new_id, '$meta_key', '$meta_value'";
1104
+ }
1105
+ }
1106
+ $sql_query.= implode(" UNION ALL ", $sql_query_sel);
1107
+ $this->wpdb->query($sql_query);
1108
+ }
1109
+ }
1110
+
1111
+ function pmwi_buf_prices($pid){
1112
+
1113
+ $table = _get_meta_table('post');
1114
+
1115
+ $post_meta_infos = $this->wpdb->get_results("SELECT meta_key, meta_value FROM $table WHERE post_id=$pid");
1116
+
1117
+ foreach ($post_meta_infos as $meta_info) {
1118
+ if (in_array($meta_info->meta_key, array('_regular_price', '_sale_price', '_sale_price_dates_from', '_sale_price_dates_from', '_sale_price_dates_to', '_price'))){
1119
+ $this->pushmeta($pid, $meta_info->meta_key . '_tmp', $meta_info->meta_value);
1120
+ }
1121
+ }
1122
+
1123
+ //$this->executeSQL();
1124
+
1125
+ }
1126
+
1127
+ function pmwi_update_prices($pid){
1128
+
1129
+ $table = _get_meta_table('post');
1130
+
1131
+ $post_meta_infos = $this->wpdb->get_results("SELECT meta_key, meta_value FROM $table WHERE post_id=$pid");
1132
+
1133
+ foreach ($post_meta_infos as $meta_info) {
1134
+ if (in_array($meta_info->meta_key, array('_regular_price_tmp', '_sale_price_tmp', '_sale_price_dates_from_tmp', '_sale_price_dates_from_tmp', '_sale_price_dates_to_tmp', '_price_tmp'))){
1135
+ $this->pushmeta($pid, str_replace('_tmp', '', $meta_info->meta_key), $meta_info->meta_value);
1136
+ delete_post_meta( $pid, $meta_info->meta_key );
1137
+ }
1138
+ }
1139
+
1140
+ //$this->executeSQL();
1141
 
1142
  }
1143
 
1165
  );
1166
 
1167
  if ( in_array( $attribute_name, $reserved_terms ) ) {
1168
+ $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: Slug “%s” is not allowed because it is a reserved term. Change it, please.', 'pmxi_plugin'), wc_attribute_taxonomy_name( $attribute_name )));
1169
  }
1170
  else{
1171
  // Register the taxonomy now so that the import works!
1197
  set_transient( 'wc_attribute_taxonomies', $attribute_taxonomies );
1198
  apply_filters( 'woocommerce_attribute_taxonomies', $attribute_taxonomies );
1199
 
1200
+ $logger and call_user_func($logger, sprintf(__('- <b>CREATED</b>: Taxonomy attribute “%s” have been successfully created.', 'pmxi_plugin'), wc_attribute_taxonomy_name( $attribute_name )));
1201
 
1202
  }
1203
  else{
1204
+ $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: Taxonomy “%s” name is more than 32 characters. Change it, please.', 'pmxi_plugin'), $attr_name));
1205
  }
1206
 
1207
  }
1310
 
1311
  function array_cartesian( $input ) {
1312
 
1313
+ $result = array();
1314
+
1315
+ while ( list( $key, $values ) = each( $input ) ) {
1316
+ // If a sub-array is empty, it doesn't affect the cartesian product
1317
+ if ( empty( $values ) ) {
1318
+ continue;
1319
+ }
1320
+
1321
+ // Special case: seeding the product array with the values from the first sub-array
1322
+ if ( empty( $result ) ) {
1323
+ foreach ( $values as $value ) {
1324
+ $result[] = array( $key => $value );
1325
+ }
1326
+ }
1327
+ else {
1328
+ // Second and subsequent input sub-arrays work like this:
1329
+ // 1. In each existing array inside $product, add an item with
1330
+ // key == $key and value == first item in input sub-array
1331
+ // 2. Then, for each remaining item in current input sub-array,
1332
+ // add a copy of each existing array inside $product with
1333
+ // key == $key and value == first item in current input sub-array
1334
+
1335
+ // Store all items to be added to $product here; adding them on the spot
1336
+ // inside the foreach will result in an infinite loop
1337
+ $append = array();
1338
+ foreach( $result as &$product ) {
1339
+ // Do step 1 above. array_shift is not the most efficient, but it
1340
+ // allows us to iterate over the rest of the items with a simple
1341
+ // foreach, making the code short and familiar.
1342
+ $product[ $key ] = array_shift( $values );
1343
+
1344
+ // $product is by reference (that's why the key we added above
1345
+ // will appear in the end result), so make a copy of it here
1346
+ $copy = $product;
1347
+
1348
+ // Do step 2 above.
1349
+ foreach( $values as $item ) {
1350
+ $copy[ $key ] = $item;
1351
+ $append[] = $copy;
1352
+ }
1353
+
1354
+ // Undo the side effecst of array_shift
1355
+ array_unshift( $values, $product[ $key ] );
1356
+ }
1357
+
1358
+ // Out of the foreach, we can add to $results now
1359
+ $result = array_merge( $result, $append );
1360
+ }
1361
+ }
1362
+
1363
+ return $result;
1364
+ }
1365
 
1366
  public function _filter_has_cap_unfiltered_html($caps)
1367
  {
1368
  $caps['unfiltered_html'] = true;
1369
  return $caps;
1370
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1371
 
1372
  function auto_cloak_links($import, &$url){
1373
 
1434
  ));
1435
  $dest->insert();
1436
  } else {
1437
+ $logger and call_user_func($logger, sprintf(__('- <b>WARNING</b>: Unable to create cloaked link for %s', 'pmxi_plugin'), $url));
 
1438
  $link = NULL;
1439
  }
1440
  }
1456
  if ($options['update_custom_fields_logic'] == "all_except" and ( empty($options['custom_fields_list']) or ! in_array($meta_key, $options['custom_fields_list']) )) return true;
1457
 
1458
  return false;
1459
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1460
 
1461
+ function prepare_price( $price ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1462
 
1463
+ return pmwi_prepare_price( $price, $this->options['disable_prepare_price'], $this->options['prepare_price_to_woo_format'] );
1464
 
1465
  }
 
 
1466
 
1467
+ function adjust_price( $price, $field ){
1468
 
1469
+ return pmwi_adjust_price( $price, $field, $this->options);
1470
+
 
 
 
1471
  }
1472
  }
plugin.php CHANGED
@@ -3,19 +3,19 @@
3
  Plugin Name: WP All Import - WooCommerce Add-On
4
  Plugin URI: http://www.wpallimport.com/
5
  Description: An extremely easy, drag & drop importer to import WooCommerce simple products. A paid upgrade is available for premium support and support for Variable, Grouped, and External/Affiliate products
6
- Version: 1.1.6
7
  Author: Soflyy
8
  */
9
  /**
10
  * Plugin root dir with forward slashes as directory separator regardless of actuall DIRECTORY_SEPARATOR value
11
  * @var string
12
  */
13
- define('PMWI_FREE_ROOT_DIR', str_replace('\\', '/', dirname(__FILE__)));
14
  /**
15
  * Plugin root url for referencing static content
16
  * @var string
17
  */
18
- define('PMWI_FREE_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
19
  /**
20
  * Plugin prefix for making names unique (be aware that this variable is used in conjuction with naming convention,
21
  * i.e. in order to change it one must not only modify this constant but also rename all constants, classes and functions which
@@ -24,7 +24,7 @@ define('PMWI_FREE_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
24
  */
25
  define('PMWI_PREFIX', 'pmwi_');
26
 
27
- define('PMWI_FREE_VERSION', '1.1.6');
28
 
29
  define('PMWI_EDITION', 'free');
30
 
@@ -52,12 +52,12 @@ final class PMWI_Plugin {
52
  * Plugin root dir
53
  * @var string
54
  */
55
- const ROOT_DIR = PMWI_FREE_ROOT_DIR;
56
  /**
57
  * Plugin root URL
58
  * @var string
59
  */
60
- const ROOT_URL = PMWI_FREE_ROOT_URL;
61
  /**
62
  * Prefix used for names of shortcodes, action handlers, filter functions etc.
63
  * @var string
@@ -78,7 +78,7 @@ final class PMWI_Plugin {
78
  self::$instance = new self();
79
  }
80
  return self::$instance;
81
- }
82
 
83
  /**
84
  * Common logic for requestin plugin info fields
@@ -400,7 +400,7 @@ final class PMWI_Plugin {
400
  'multiple_product_type' => 'simple',
401
  'single_product_type' => '',
402
  'is_product_virtual' => 'no',
403
- 'single_product_virtual' => '',
404
  'is_product_downloadable' => 'no',
405
  'single_product_downloadable' => '',
406
  'is_product_enabled' => 'yes',
@@ -428,7 +428,7 @@ final class PMWI_Plugin {
428
  'is_product_manage_stock' => 'no',
429
  'single_product_manage_stock' => '',
430
  'single_product_stock_qty' => '',
431
- 'product_stock_status' => 'instock',
432
  'single_product_stock_status' => '',
433
  'product_allow_backorders' => 'no',
434
  'single_product_allow_backorders' => '',
@@ -493,12 +493,15 @@ final class PMWI_Plugin {
493
  'variable_download_limit' => '',
494
  'variable_download_expiry' => '',
495
  'is_variable_product_virtual' => 'no',
 
496
  'is_multiple_variable_product_shipping_class' => 'yes',
497
  'multiple_variable_product_shipping_class' => '',
498
  'single_variable_product_shipping_class' => '',
499
  'is_multiple_variable_product_tax_class' => 'yes',
500
  'multiple_variable_product_tax_class' => 'parent',
501
  'single_variable_product_tax_class' => '',
 
 
502
  'is_variable_product_downloadable' => 'no',
503
  'single_variable_product_downloadable' => '',
504
  'variable_attribute_name' => array(),
@@ -521,6 +524,8 @@ final class PMWI_Plugin {
521
  'variable_weight_use_parent' => 0,
522
  'single_variable_product_virtual' => '',
523
  'single_variable_product_virtual_use_parent' => 0,
 
 
524
  'variable_dimensions_use_parent' => 0,
525
  'variable_image_use_parent' => 0,
526
  'single_variable_product_shipping_class_use_parent' => 0,
@@ -533,15 +538,21 @@ final class PMWI_Plugin {
533
  'variable_whosale_price' => '',
534
  'variable_whosale_price_use_parent' => 0,
535
  'disable_auto_sku_generation' => 0,
536
- 'is_default_attributes' => 1,
537
  'disable_sku_matching' => 1,
538
- 'disable_prepare_price' => 0,
 
539
  'grouping_indicator' => 'xpath',
540
  'custom_grouping_indicator_name' => '',
541
  'custom_grouping_indicator_value' => '',
542
  'is_update_product_type' => 1,
543
- 'make_simple_product' => 0,
544
  'variable_sku_add_parent' => 0,
 
 
 
 
 
545
 
546
  'is_update_attributes' => 1,
547
  'update_attributes_logic' => 'full_update',
@@ -553,3 +564,4 @@ final class PMWI_Plugin {
553
  }
554
 
555
  PMWI_Plugin::getInstance();
 
3
  Plugin Name: WP All Import - WooCommerce Add-On
4
  Plugin URI: http://www.wpallimport.com/
5
  Description: An extremely easy, drag & drop importer to import WooCommerce simple products. A paid upgrade is available for premium support and support for Variable, Grouped, and External/Affiliate products
6
+ Version: 1.2.0
7
  Author: Soflyy
8
  */
9
  /**
10
  * Plugin root dir with forward slashes as directory separator regardless of actuall DIRECTORY_SEPARATOR value
11
  * @var string
12
  */
13
+ define('PMWI_ROOT_DIR', str_replace('\\', '/', dirname(__FILE__)));
14
  /**
15
  * Plugin root url for referencing static content
16
  * @var string
17
  */
18
+ define('PMWI_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
19
  /**
20
  * Plugin prefix for making names unique (be aware that this variable is used in conjuction with naming convention,
21
  * i.e. in order to change it one must not only modify this constant but also rename all constants, classes and functions which
24
  */
25
  define('PMWI_PREFIX', 'pmwi_');
26
 
27
+ define('PMWI_FREE_VERSION', '1.2.0');
28
 
29
  define('PMWI_EDITION', 'free');
30
 
52
  * Plugin root dir
53
  * @var string
54
  */
55
+ const ROOT_DIR = PMWI_ROOT_DIR;
56
  /**
57
  * Plugin root URL
58
  * @var string
59
  */
60
+ const ROOT_URL = PMWI_ROOT_URL;
61
  /**
62
  * Prefix used for names of shortcodes, action handlers, filter functions etc.
63
  * @var string
78
  self::$instance = new self();
79
  }
80
  return self::$instance;
81
+ }
82
 
83
  /**
84
  * Common logic for requestin plugin info fields
400
  'multiple_product_type' => 'simple',
401
  'single_product_type' => '',
402
  'is_product_virtual' => 'no',
403
+ 'single_product_virtual' => '',
404
  'is_product_downloadable' => 'no',
405
  'single_product_downloadable' => '',
406
  'is_product_enabled' => 'yes',
428
  'is_product_manage_stock' => 'no',
429
  'single_product_manage_stock' => '',
430
  'single_product_stock_qty' => '',
431
+ 'product_stock_status' => 'auto',
432
  'single_product_stock_status' => '',
433
  'product_allow_backorders' => 'no',
434
  'single_product_allow_backorders' => '',
493
  'variable_download_limit' => '',
494
  'variable_download_expiry' => '',
495
  'is_variable_product_virtual' => 'no',
496
+ 'is_variable_product_manage_stock' => 'no',
497
  'is_multiple_variable_product_shipping_class' => 'yes',
498
  'multiple_variable_product_shipping_class' => '',
499
  'single_variable_product_shipping_class' => '',
500
  'is_multiple_variable_product_tax_class' => 'yes',
501
  'multiple_variable_product_tax_class' => 'parent',
502
  'single_variable_product_tax_class' => '',
503
+ 'variable_stock_status' => 'instock',
504
+ 'single_variable_stock_status' => '',
505
  'is_variable_product_downloadable' => 'no',
506
  'single_variable_product_downloadable' => '',
507
  'variable_attribute_name' => array(),
524
  'variable_weight_use_parent' => 0,
525
  'single_variable_product_virtual' => '',
526
  'single_variable_product_virtual_use_parent' => 0,
527
+ 'single_variable_product_manage_stock' => '',
528
+ 'single_variable_product_manage_stock_use_parent' => 0,
529
  'variable_dimensions_use_parent' => 0,
530
  'variable_image_use_parent' => 0,
531
  'single_variable_product_shipping_class_use_parent' => 0,
538
  'variable_whosale_price' => '',
539
  'variable_whosale_price_use_parent' => 0,
540
  'disable_auto_sku_generation' => 0,
541
+ 'is_default_attributes' => 0,
542
  'disable_sku_matching' => 1,
543
+ 'disable_prepare_price' => 1,
544
+ 'prepare_price_to_woo_format' => 0,
545
  'grouping_indicator' => 'xpath',
546
  'custom_grouping_indicator_name' => '',
547
  'custom_grouping_indicator_value' => '',
548
  'is_update_product_type' => 1,
549
+ 'make_simple_product' => 1,
550
  'variable_sku_add_parent' => 0,
551
+ 'set_parent_stock' => 0,
552
+ 'single_product_regular_price_adjust' => '',
553
+ 'single_product_regular_price_adjust_type' => '%',
554
+ 'single_product_sale_price_adjust' => '',
555
+ 'single_product_sale_price_adjust_type' => '%',
556
 
557
  'is_update_attributes' => 1,
558
  'update_attributes_logic' => 'full_update',
564
  }
565
 
566
  PMWI_Plugin::getInstance();
567
+
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Import Products from any XML or CSV to WooCommerce ===
2
- Contributors: soflyy
3
  Requires at least: 3.5
4
- Tested up to: 4.0
5
- Stable tag: 1.1.6
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
- Tags: woocommerce xml import, woocommerce csv import, woocommerce, import, xml, csv, wp all import
9
 
10
  Easily import products from any XML or CSV file to WooCommerce with the WooCommerce add-on for WP All Import.
11
 
@@ -20,19 +20,21 @@ The left side of the plugin looks just like WooCommerce, and the right side disp
20
 
21
  **Drag & drop the data from your XML or CSV into the WooCommerce fields to import it.**
22
 
23
- It is so intuitive it is almost like manually adding a product in WooCommerce.
24
 
25
- Why use the WooCommerce add-on for WP All Import?
26
 
27
- - Supports files in any format and structure. There are no requirements that the data in your file be organized in a certain way.
 
 
28
  - Supports files of practically unlimited size by automatically splitting them into chunks. Import 200Mb+ product catalogs with ease, even on shared hosting.
29
 
30
  = WooCommerce Add-On Professional Edition =
31
- [youtube http://www.youtube.com/watch?v=7xL4RGT-JRc]
32
 
33
  The professional edition of *WP All Import + the WooCommerce add-on* is a paid upgrade that includes premium support and adds the following features:
34
 
35
- * [In-depth support for Variable products](http://www.wpallimport.com/documentation/woocommerce/variable-products/) - example CSV files, ability to import variations from properly formatted XML, and much more.
36
 
37
  * Import External/Affiliate products
38
 
@@ -46,7 +48,7 @@ The professional edition of *WP All Import + the WooCommerce add-on* is a paid u
46
 
47
  * Get access to our customer portal with documentation and tutorials, and e-mail technical support.
48
 
49
- [Upgrade to the professional edition of WP All Import + the WooCommerce add-on now.](http://www.wpallimport.com/woocommerce-product-import "WooCommerce XML & CSV Import")
50
 
51
  You need the WooCommerce add-on if you need to:
52
 
@@ -54,6 +56,14 @@ You need the WooCommerce add-on if you need to:
54
  * Import CSV to WooCommerce
55
  * Are frustrated with the limitations of the official WooThemes Product CSV Import Suite
56
 
 
 
 
 
 
 
 
 
57
  == Installation ==
58
 
59
  First, install [WP All Import](http://wordpress.org/plugins/wp-all-import "WordPress XML & CSV Import").
@@ -73,6 +83,14 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
73
 
74
  == Changelog ==
75
 
 
 
 
 
 
 
 
 
76
  = 1.1.6 =
77
  * fixed saving shipping class option
78
  * fixed import product attributes
@@ -122,4 +140,4 @@ We do try to handle support for our free version users at the following e-mail a
122
 
123
  E-mail: support@wpallimport.com
124
 
125
- Support for free version customers is not guaranteed and based on ability. For premium support, [purchase WP All Import and the WooCommerce add-on.](http://www.wpallimport.com/upgrade-to-pro)
1
  === Import Products from any XML or CSV to WooCommerce ===
2
+ Contributors: soflyy, wpallimport
3
  Requires at least: 3.5
4
+ Tested up to: 4.1
5
+ Stable tag: 1.2.0
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
+ Tags: woocommerce xml import, woocommerce csv import, woocommerce, import, xml, csv, wp all import, csv import, import csv, xml import, import xml, woocommerce csv importer, woocommerce xml importer, csv importer, csv import suite
9
 
10
  Easily import products from any XML or CSV file to WooCommerce with the WooCommerce add-on for WP All Import.
11
 
20
 
21
  **Drag & drop the data from your XML or CSV into the WooCommerce fields to import it.**
22
 
23
+ The importer is so intuitive it is almost like manually adding a product in WooCommerce.
24
 
25
+ WooCommerce CSV imports? WooCommerce XML imports? They are EASY with WP All Import.
26
 
27
+ Here's why you should use the WooCommerce add-on for WP All Import:
28
+
29
+ - Supports files in any format and structure. There are no requirements that the data in your file be organized in a certain way. WooCommerce CSV imports are easy, no matter the structure of your file. WooCommerce XML imports are flexible and work with any XML file.
30
  - Supports files of practically unlimited size by automatically splitting them into chunks. Import 200Mb+ product catalogs with ease, even on shared hosting.
31
 
32
  = WooCommerce Add-On Professional Edition =
33
+ [youtube http://www.youtube.com/watch?v=7kCmESmKGro]
34
 
35
  The professional edition of *WP All Import + the WooCommerce add-on* is a paid upgrade that includes premium support and adds the following features:
36
 
37
+ * [In-depth support for Variable products](http://www.wpallimport.com/documentation/woocommerce/variable-products/?utm_source=free-plugin&utm_medium=dot-org&utm_campaign=woocommerce) - example CSV files, ability to import variations from properly formatted XML, and much more.
38
 
39
  * Import External/Affiliate products
40
 
48
 
49
  * Get access to our customer portal with documentation and tutorials, and e-mail technical support.
50
 
51
+ [Upgrade to the professional edition of WP All Import + the WooCommerce add-on now.](http://www.wpallimport.com/woocommerce-product-import?utm_source=free-plugin&utm_medium=dot-org&utm_campaign=woocommerce "WooCommerce XML & CSV Import")
52
 
53
  You need the WooCommerce add-on if you need to:
54
 
56
  * Import CSV to WooCommerce
57
  * Are frustrated with the limitations of the official WooThemes Product CSV Import Suite
58
 
59
+ = WooCommerce CSV Imports =
60
+
61
+ Of course, XML files can have complex structures, but for CSV files, you can easily edit them and change the column names.
62
+
63
+ When importing CSV files, you should use UTF-8 encoding (which is very standard) if you are having any trouble with CSV imports containing special characters. But other than that, there are no special requirements.
64
+
65
+ This importer is the best option for WooCommerce CSV import tasks - our importer is extremely flexible when doing CSV imports because you don't need to edit your CSV files to import them to WooCommerce. WP All Import can import ANY CSV file to WooCommerce. You don't need to layout your data in a specific way, and you don't need your CSV to have specific column names. WP All Import's drag & drop interface provides you with a visual way to map the columns in your CSV file to the appropriate fields in WooCommerce.
66
+
67
  == Installation ==
68
 
69
  First, install [WP All Import](http://wordpress.org/plugins/wp-all-import "WordPress XML & CSV Import").
83
 
84
  == Changelog ==
85
 
86
+ = 1.2.0 =
87
+ * IMPORTANT: WP All Import v4 (3.2.0) is a MAJOR update. Read this post before upgrading: (http://www.wpallimport.com/2014/11/free-version-wordpress-org-update-information)
88
+ * speed up the import of taxonomies/categories
89
+ * updated design
90
+ * new option - adjust prices (mark up, mark down, convert currency)
91
+ * added preview prices feature
92
+ * fixed importing of menu order
93
+
94
  = 1.1.6 =
95
  * fixed saving shipping class option
96
  * fixed import product attributes
140
 
141
  E-mail: support@wpallimport.com
142
 
143
+ Support for free version customers is not guaranteed and based on ability. For premium support, [purchase WP All Import and the WooCommerce add-on.](http://www.wpallimport.com/upgrade-to-pro?utm_source=free-plugin&utm_medium=dot-org&utm_campaign=woocommerce)
screenshot-1.png CHANGED
Binary file
shortcodes/.gitkeep ADDED
File without changes
static/css/admin-wp-3.8.css CHANGED
@@ -1,20 +1,25 @@
1
- .pmxi_plugin .woocommerce_options_panel .options_group{
2
  overflow: hidden;
3
  }
4
- .pmxi_plugin .woocommerce_options_panel input{
5
- float: left !important;
6
  }
7
- .pmxi_plugin .form-table input.tog, .pmxi_plugin .form-table input[type="radio"]{
8
- margin-top: 0px !important;
 
9
  }
10
- .pmxi_plugin #woocommerce_attributes label{
11
  top:0px !important;
12
  margin-bottom: 10px !important;
13
- }
14
- .pmxi_plugin .form-table,.pmxi_plugin .form-table td,.pmxi_plugin .form-table th,.pmxi_plugin .form-table td p,.pmxi_plugin .form-wrap label{
 
 
 
 
15
  font-size: 12px !important ;
16
  }
17
- .pmxi_plugin #close_xml_tree{
18
  top:0px;
19
  right:0px;
20
  }
1
+ .wpallimport-plugin .woocommerce_options_panel .options_group{
2
  overflow: hidden;
3
  }
4
+ .wpallimport-plugin .woocommerce_options_panel input{
5
+ /*float: left !important;*/
6
  }
7
+ .wpallimport-plugin .form-table input.tog,
8
+ .wpallimport-plugin .form-table input[type="radio"]{
9
+ /*margin-top: 0px !important;*/
10
  }
11
+ /*.wpallimport-plugin #woocommerce_attributes label{
12
  top:0px !important;
13
  margin-bottom: 10px !important;
14
+ }*/
15
+ .wpallimport-plugin .form-table,
16
+ .wpallimport-plugin .form-table td,
17
+ .wpallimport-plugin .form-table th,
18
+ .wpallimport-plugin .form-table td p,
19
+ .wpallimport-plugin .form-wrap label{
20
  font-size: 12px !important ;
21
  }
22
+ .wpallimport-plugin #close_xml_tree{
23
  top:0px;
24
  right:0px;
25
  }
static/css/admin.css CHANGED
@@ -1,4 +1,5 @@
1
- .pmxi_plugin #existing_meta_keys, .pmxi_plugin #existing_attributes{
 
2
  margin-bottom: 10px;
3
  padding: 2px;
4
  width: 580px;
@@ -9,93 +10,98 @@
9
  top: -2px;
10
  width: 50px !important;
11
  }
12
- .pmxi_plugin .options_group{
13
  padding-bottom: 10px;
 
14
  /*overflow: hidden;*/
15
  }
16
- .pmxi_plugin .options_group .input{
17
  padding-left: 8px;
18
- margin-top: 10px;
19
  }
20
- .pmxi_plugin .options_group .input input{
21
  width:auto !important;
22
  }
23
- .pmxi_plugin .options_group .input label{
 
24
  padding-left: 7px;
25
  position: relative;
26
- top: -2px;
27
- width: auto;
28
- margin-left: 0;
29
  }
30
- .pmxi_plugin .woocommerce_options_panel label, .pmxi_plugin .woocommerce_options_panel legend{
31
  margin: 0;
32
  }
33
- .pmxi_plugin .woocommerce_options_panel p.form-field{
34
  padding-left: 20px !important;
35
  }
36
- .pmxi_plugin #woocommerce-product-data{
 
 
 
 
 
37
  overflow: hidden;
38
  }
39
- .pmxi_plugin #woocommerce-product-data .hndle{
40
  margin-bottom: 0px;
41
  cursor: default;
42
  padding: 10px;
43
  overflow: hidden;
44
  }
45
- .pmxi_plugin .main_choise{
46
- float: left;
47
- margin-right: 5px;
48
- padding: 5px 0;
49
  }
50
- .pmxi_plugin .set_with_xpath{
51
- /*padding-left:20px; */
52
- position:absolute;
53
- left:0px;
54
- top:-15px;
 
55
  }
56
- .pmxi_plugin .in_variations select, .pmxi_plugin .is_visible select, .pmxi_plugin .is_taxonomy select{
57
  float:none !important;
58
  }
59
- .pmxi_plugin .in_variations, .pmxi_plugin .is_visible, .pmxi_plugin .is_taxonomy, .pmxi_plugin .is_create_taxonomy{
60
  display: block;
61
  float: left;
62
  margin-top: 10px;
63
  margin-left: 5px;
64
  }
65
- .pmxi_plugin .in_variations label, .pmxi_plugin .is_visible label, .pmxi_plugin .is_taxonomy label{
66
  width: 80px;
67
  }
68
- .pmxi_plugin .is_create_taxonomy label{
69
  width: 115px;
70
  }
71
- .pmxi_plugin .panel{
72
  background: #fff;
73
  padding-bottom: 20px;
74
  min-height: 200px;
75
  }
76
- .pmxi_plugin .wc-tabs{
77
- width:152px !important;
78
  }
79
- .pmxi_plugin ul.wc-tabs li.active a{
80
  /*width:120px !important;*/
81
  background-color: #fff !important;
82
  }
83
- .pmxi_plugin .fleft{
84
  float: left;
85
  }
86
- .pmxi_plugin #woocommerce_attributes{
87
  padding-left: 2%;
88
  padding-top: 10px;
89
  width:98% !important;
90
  }
91
- .pmxi_plugin .variations_tree{
92
  font-family: sans-serif;
93
  /*position: absolute;
94
  width:100%;
95
  top:-155px;*/
96
  }
97
 
98
- .pmxi_plugin .variations_tag {
99
  background-color: #fff;
100
  /*position: fixed; */
101
  margin: 5px;
@@ -110,17 +116,27 @@
110
  -moz-box-shadow: 0px 0px 15px #ccc;
111
  box-shadow: 0px 0px 15px #ccc;
112
  }
113
- .pmxi_plugin .options .variations_tag{
114
  margin-top: 0px;
115
  }
116
- .pmxi_plugin .variations_tag .title {
117
  font-weight: bold;
118
  padding: 6px 8px;
119
  color: #464646;
120
- background: #DFDFDF;
121
  font-size: 12px;
 
 
 
 
 
 
 
 
 
 
122
  }
123
- .pmxi_plugin .variations_tag .xml {
124
  max-height: 300px;
125
  overflow: auto;
126
  border: 1px solid #DFDFDF;
@@ -132,69 +148,113 @@
132
  -webkit-border-bottom-left-radius: 4px;
133
  border-bottom-left-radius: 4px;
134
  }
135
- .pmxi_plugin .variations_tag .navigation {
136
- float: right;
137
- margin: -2px -12px 0 0;
138
- }
139
- .pmxi_plugin .variations_tag .navigation a,
140
- .pmxi_plugin .variations_tag .navigation span {
141
  font-weight: bold;
142
  padding: 0 12px;
143
  text-decoration: none;
 
 
 
 
 
144
  }
 
 
 
 
 
 
 
 
 
 
145
 
146
  @media screen and (max-height: 700px) {
147
- .pmxi_plugin .variations_tag {
148
  max-height:300px;
149
  }
150
- .pmxi_plugin .variations_tag .xml {
151
  max-height: 265px;
152
  }
153
  }
154
- .pmxi_plugin .use_parent{
155
  display: inline-block;
156
  position: relative;
157
  }
158
 
159
- .pmxi_plugin #woocommerce_attributes label{
160
  font-size: 12px;
161
- position: relative;
162
- top:-2px;
163
  left: 3px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  }
165
-
166
- .pmxi_plugin #variations_tag{
 
 
167
  clear: both;
168
  position: fixed;
169
- top:335px;
170
- right:30%;
171
- width:300px;
172
  display: none;
173
  z-index: 1;
174
  }
175
- .pmxi_plugin .variations_tag .title{
176
  cursor: move;
177
  }
178
- .pmxi_plugin .variations_tag{
179
  z-index: 999;
180
  }
181
- .pmxi_plugin .load_options{
 
 
 
182
  float: right;
183
  height: 0;
184
  position: relative;
185
  right: 10px;
186
  top: -35px;
187
  }
188
- .pmxi_plugin #dialog, .pmxi_plugin .ui-dialog{
189
  padding: 0px;
190
  }
191
- .pmxi_plugin #variations_console{
192
- margin: 0px 15px;
 
 
 
 
 
193
  }
194
- .pmxi_plugin #toggle_xml_tree{
195
- margin: 0px 5px;
 
 
 
 
 
196
  }
197
- .pmxi_plugin #close_xml_tree{
198
  display: block;
199
  position: absolute;
200
  top: -16px;
@@ -204,12 +264,50 @@
204
  height:16px;
205
 
206
  }
207
- .pmxi_plugin #variable_product_options img{
208
- margin: 4px;
209
  }
210
- .pmxi_plugin .highlight{
211
  background: none repeat scroll 0 0 #CAD2DF;
212
  padding: 5px;
213
  margin-right: 20px;
214
  text-align: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  }
1
+ .wpallimport-plugin #existing_meta_keys,
2
+ .wpallimport-plugin #existing_attributes{
3
  margin-bottom: 10px;
4
  padding: 2px;
5
  width: 580px;
10
  top: -2px;
11
  width: 50px !important;
12
  }
13
+ .wpallimport-plugin .options_group{
14
  padding-bottom: 10px;
15
+ padding-top: 10px;
16
  /*overflow: hidden;*/
17
  }
18
+ .wpallimport-plugin .options_group .input{
19
  padding-left: 8px;
20
+ margin-top: 10px;
21
  }
22
+ .wpallimport-plugin .options_group .input input{
23
  width:auto !important;
24
  }
25
+ .wpallimport-plugin .options_group .input label{
26
+ /*margin-left: 0;
27
  padding-left: 7px;
28
  position: relative;
29
+ top: -3px;
30
+ width: auto;*/
 
31
  }
32
+ .wpallimport-plugin .woocommerce_options_panel label, .wpallimport-plugin .woocommerce_options_panel legend{
33
  margin: 0;
34
  }
35
+ .wpallimport-plugin .woocommerce_options_panel p.form-field{
36
  padding-left: 20px !important;
37
  }
38
+ .wpallimport-plugin .woocommerce_options_panel p.form-field.wpallimport-radio-field{
39
+ padding-bottom: 0 !important;
40
+ padding-top: 0 !important;
41
+ margin-top: 0 !important;
42
+ }
43
+ .wpallimport-plugin #woocommerce-product-data{
44
  overflow: hidden;
45
  }
46
+ .wpallimport-plugin #woocommerce-product-data .hndle{
47
  margin-bottom: 0px;
48
  cursor: default;
49
  padding: 10px;
50
  overflow: hidden;
51
  }
52
+ .wpallimport-plugin .set_with_xpath{
53
+ clear: both;
 
 
54
  }
55
+ .wpallimport-plugin .set_with_xpath .wpallimport-slide-content{
56
+ padding-left: 20px;
57
+ /*padding-top: 10px;*/
58
+ display: block;
59
+ overflow: hidden;
60
+ margin: 5px 0;
61
  }
62
+ .wpallimport-plugin .in_variations select, .wpallimport-plugin .is_visible select, .wpallimport-plugin .is_taxonomy select{
63
  float:none !important;
64
  }
65
+ .wpallimport-plugin .in_variations, .wpallimport-plugin .is_visible, .wpallimport-plugin .is_taxonomy, .wpallimport-plugin .is_create_taxonomy{
66
  display: block;
67
  float: left;
68
  margin-top: 10px;
69
  margin-left: 5px;
70
  }
71
+ .wpallimport-plugin .in_variations label, .wpallimport-plugin .is_visible label, .wpallimport-plugin .is_taxonomy label{
72
  width: 80px;
73
  }
74
+ .wpallimport-plugin .is_create_taxonomy label{
75
  width: 115px;
76
  }
77
+ .wpallimport-plugin .panel{
78
  background: #fff;
79
  padding-bottom: 20px;
80
  min-height: 200px;
81
  }
82
+ .wpallimport-plugin .wc-tabs{
83
+ /*width:152px !important;*/
84
  }
85
+ .wpallimport-plugin ul.wc-tabs li.active a{
86
  /*width:120px !important;*/
87
  background-color: #fff !important;
88
  }
89
+ .wpallimport-plugin .fleft{
90
  float: left;
91
  }
92
+ .wpallimport-plugin #woocommerce_attributes{
93
  padding-left: 2%;
94
  padding-top: 10px;
95
  width:98% !important;
96
  }
97
+ .wpallimport-plugin .variations_tree{
98
  font-family: sans-serif;
99
  /*position: absolute;
100
  width:100%;
101
  top:-155px;*/
102
  }
103
 
104
+ .wpallimport-plugin .variations_tag {
105
  background-color: #fff;
106
  /*position: fixed; */
107
  margin: 5px;
116
  -moz-box-shadow: 0px 0px 15px #ccc;
117
  box-shadow: 0px 0px 15px #ccc;
118
  }
119
+ .wpallimport-plugin .options .variations_tag{
120
  margin-top: 0px;
121
  }
122
+ .wpallimport-plugin .variations_tag .title {
123
  font-weight: bold;
124
  padding: 6px 8px;
125
  color: #464646;
126
+ background: #fff;
127
  font-size: 12px;
128
+ text-align: center;
129
+ border: 1px solid #ddd;
130
+ border-bottom: 1px solid #ddd;
131
+ -moz-border-radius-topleft: 4px;
132
+ -webkit-border-top-left-radius: 4px;
133
+ border-top-left-radius: 4px;
134
+ -moz-border-radius-topright: 4px;
135
+ -webkit-border-top-right-radius: 4px;
136
+ border-top-right-radius: 4px;
137
+ overflow: hidden;
138
  }
139
+ .wpallimport-plugin .variations_tag .xml {
140
  max-height: 300px;
141
  overflow: auto;
142
  border: 1px solid #DFDFDF;
148
  -webkit-border-bottom-left-radius: 4px;
149
  border-bottom-left-radius: 4px;
150
  }
151
+ .wpallimport-plugin .variations_tag .navigation{
152
+ line-height: 30px;
153
+ }
154
+ .wpallimport-plugin .variations_tag .navigation a,
155
+ .wpallimport-plugin .variations_tag .navigation span{
 
156
  font-weight: bold;
157
  padding: 0 12px;
158
  text-decoration: none;
159
+ height: 25px;
160
+ }
161
+ .wpallimport-plugin .variations_tag .navigation span.out_of{
162
+ color:#777;
163
+ margin-left: 0;
164
  }
165
+ .wpallimport-plugin .variations_tag .navigation .previous_element{
166
+ float: left;
167
+ background: url('../img/left_btn.png') 5% 0 no-repeat;
168
+ margin-top: 4px;
169
+ }
170
+ .wpallimport-plugin .variations_tag .navigation .next_element{
171
+ float: right;
172
+ background: url('../img/right_btn.png') 95% 0 no-repeat;
173
+ margin-top: 4px;
174
+ }
175
 
176
  @media screen and (max-height: 700px) {
177
+ .wpallimport-plugin .variations_tag {
178
  max-height:300px;
179
  }
180
+ .wpallimport-plugin .variations_tag .xml {
181
  max-height: 265px;
182
  }
183
  }
184
+ .wpallimport-plugin .use_parent{
185
  display: inline-block;
186
  position: relative;
187
  }
188
 
189
+ .wpallimport-plugin table.custom-params label{
190
  font-size: 12px;
 
 
191
  left: 3px;
192
+ margin-left: 0 !important;
193
+ padding-left: 0 !important;
194
+ position: relative;
195
+ top: -4px !important;
196
+ }
197
+ .wpallimport-plugin table.custom-params input[type=text]{
198
+ font-size: 14px;
199
+ height: 40px;
200
+ border: 1px solid #ddd;
201
+ border-radius: 4px;
202
+ -moz-border-radius: 4px;
203
+ -khtml-border-radius: 4px;
204
+ -webkit-border-radius: 4px;
205
+ color: #000;
206
+ font-size: 15px;
207
+ position: relative;
208
+ top: 0;
209
  }
210
+ .wpallimport-plugin table.custom-params input[type=checkbox]{
211
+ margin: 0 !important;
212
+ }
213
+ .wpallimport-plugin #variations_tag{
214
  clear: both;
215
  position: fixed;
216
+ top: 335px;
217
+ right: 30%;
218
+ width: 300px;
219
  display: none;
220
  z-index: 1;
221
  }
222
+ .wpallimport-plugin .variations_tag .title{
223
  cursor: move;
224
  }
225
+ .wpallimport-plugin .variations_tag{
226
  z-index: 999;
227
  }
228
+ .wpallimport-plugin .variations_tag .xml{
229
+ padding-left: 20px;
230
+ }
231
+ .wpallimport-plugin .load_options{
232
  float: right;
233
  height: 0;
234
  position: relative;
235
  right: 10px;
236
  top: -35px;
237
  }
238
+ .wpallimport-plugin #dialog, .wpallimport-plugin .ui-dialog{
239
  padding: 0px;
240
  }
241
+ .wpallimport-plugin #variations_console{
242
+ clear: both;
243
+ display: block;
244
+ margin: 15px 0;
245
+ }
246
+ .wpallimport-plugin #variations_console .updated{
247
+ padding: 10px;
248
  }
249
+ .wpallimport-plugin #toggle_xml_tree{
250
+ display: block;
251
+ left: 10px;
252
+ margin: 5px 10px;
253
+ position: relative;
254
+ float: left;
255
+ width: 120px;
256
  }
257
+ .wpallimport-plugin #close_xml_tree{
258
  display: block;
259
  position: absolute;
260
  top: -16px;
264
  height:16px;
265
 
266
  }
267
+ .wpallimport-plugin #variable_product_options img{
268
+ margin: 10px 0;
269
  }
270
+ .wpallimport-plugin .highlight{
271
  background: none repeat scroll 0 0 #CAD2DF;
272
  padding: 5px;
273
  margin-right: 20px;
274
  text-align: center;
275
+ }
276
+ .wpallimport-plugin #regular_price_shedule{
277
+ line-height: 27px;
278
+ }
279
+ .wpallimport-plugin .options_group .form-field input[type=radio],
280
+ .wpallimport-plugin .options_group .form-field input[type=checkbox]{
281
+ display: block;
282
+ float: left;
283
+ margin: 3px 10px 0 0;
284
+ position: relative;
285
+ }
286
+ .wpallimport-plugin #add_on_options .form-field label{
287
+ width: 350px;
288
+ }
289
+ .wpallimport-plugin #woocommerce-product-data .wc-tabs-back{
290
+ height: 2200px;
291
+ }
292
+ .wpallimport-plugin #woocommerce-product-data .form-field{
293
+ padding-left: 20px;
294
+ }
295
+ .wpallimport-plugin .pmwi_percentage_prices_note,
296
+ .wpallimport-plugin .pmwi_reduce_prices_note{
297
+ display: none;
298
+ }
299
+ .wpallimport-plugin .pmwi_adjust_prices{
300
+ display: none;
301
+ }
302
+ .wpallimport-plugin .pmwi_trigger_adjust_prices{
303
+ cursor: pointer;
304
+ width: 330px;
305
+ }
306
+ .wpallimport-plugin .woo-add-on-free-edition-notice{
307
+ display: none;
308
+ margin: 10px;
309
+ padding: 20px;
310
+ background-color: #eee;
311
+ border: 1px solid #ddd;
312
+ text-align:center;
313
  }
static/img/left_btn.png ADDED
Binary file
static/img/right_btn.png ADDED
Binary file
static/js/admin.js CHANGED
@@ -2,7 +2,7 @@
2
  * plugin admin area javascript
3
  */
4
  (function($){$(function () {
5
- if ( ! $('body.pmxi_plugin').length) return; // do not execute any code if we are not on plugin page
6
 
7
  $('.product_data_tabs').find('a').click(function(){
8
  $('.product_data_tabs').find('li').removeClass('active');
@@ -74,11 +74,13 @@
74
  });
75
 
76
  if ($('input[name=is_product_manage_stock]:checked').val() == 'no') $('.stock_fields').hide(); else $('.stock_fields').show();
 
 
77
 
78
  if ($('#link_all_variations').is(':checked')) $('.variations_tab').hide(); else if (is_variable) $('.variations_tab').show();
79
 
80
  if ($('#xml_matching_parent').is(':checked') && is_variable) $('#variations_tag').show(); else $('#variations_tag').hide();
81
-
82
  if ( ! is_simple ) {
83
  $('.woocommerce_options_panel').find('input, select').attr('disabled','disabled');
84
  $('.upgrade_template').show();
@@ -101,7 +103,7 @@
101
  change_depencies();
102
  $('.wc-tabs').find('li:visible:first').find('a').click();
103
  });
104
- $('#_virtual, #_downloadable, input[name=is_product_manage_stock]').click(change_depencies);
105
  $('input[name=is_multiple_product_type]').click(function(){
106
  change_depencies();
107
  $('.wc-tabs').find('li:visible:first').find('a').click();
@@ -148,7 +150,7 @@
148
  });
149
 
150
  $('#_variable_downloadable').click(function(){
151
- if ($(this).is(':checked')) $('#variable_downloadable').show(); else $('#variable_downloadable').hide();
152
  });
153
 
154
  var variation_xpath = $('#variations_xpath').val();
@@ -176,34 +178,6 @@
176
  var $goto_element = $('#goto_variation_element');
177
  var $variation_tagno = 0;
178
 
179
- // tag preview
180
- /*$.fn.variation_tag = function () {
181
- this.each(function () {
182
- var $tag = $(this);
183
- $tag.xml('dragable');
184
- var tagno = parseInt($tag.find('input[name="tagno"]').val());
185
- var parent_tagno = parseInt($parent_tag.find('input[name="tagno"]').val());
186
- console.log(parent_tagno);
187
- $tag.find('.navigation a').click(function () {
188
- tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
189
- $tag.addClass('loading').css('opacity', 0.7);
190
-
191
- $('#variations_console').load('admin.php?page=pmxi-admin-import&action=evaluate_variations', {xpath: $input.val(), tagno: tagno, parent_tagno: parent_tagno}, function () {
192
- var $indicator = $('<span />').insertBefore($tag);
193
- $xml.variation_tag();
194
- });
195
-
196
- $.post('admin.php?page=pmxi-admin-import&action=evaluate_variations', {xpath: $input.val(), tagno: tagno, parent_tagno: parent_tagno}, function (data) {
197
- var $indicator = $('<span />').insertBefore($tag);
198
- $tag.replaceWith(data);
199
- $indicator.next().tag().prevObject.remove();
200
- }, 'html');
201
- return false;
202
- });
203
- });
204
- return this;
205
- }; */
206
-
207
  var variationsXPathChanged = function () {
208
 
209
  if ($input.val() == $input.data('checkedValue')) return;
@@ -212,8 +186,8 @@
212
  $input.attr('readonly', true).unbind('change', variationsXPathChanged).data('checkedValue', $input.val());
213
 
214
  var parent_tagno = parseInt($('.tag').find('input[name="tagno"]').val());
215
-
216
- $.post('admin.php?page=pmxi-admin-import&action=evaluate_variations', {xpath: $input.val(), tagno: $variation_tagno, parent_tagno: parent_tagno}, function (data) {
217
  $('#variations_console').html(data.html);
218
  $input.attr('readonly', false);
219
  $xml.xml('dragable');
@@ -221,7 +195,8 @@
221
  }, 'json');
222
  };
223
 
224
- $xml.find('.navigation a').live('click', function () {
 
225
  $variation_tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
226
  $input.data('checkedValue', '');
227
  variationsXPathChanged();
@@ -247,13 +222,15 @@
247
  $('.variation_attributes, #woocommerce_attributes').find('label').live({
248
  mouseenter:
249
  function()
250
- {
251
- if ( "" == $(this).attr('for')){
252
- var counter = $('.variation_attributes').find('.form-field').length;
253
- $(this).parents('span:first').find('input').attr('id', $(this).parents('span:first').find('input').attr('name') + '_' + counter);
254
- $(this).attr('for', $(this).parents('span:first').find('input').attr('id'));
255
- }
256
- },
 
 
257
  mouseleave:
258
  function()
259
  {
@@ -287,4 +264,39 @@
287
  alert('At first, you should add minimum one attribute on the "Attributes" tab.');
288
  });
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  });})(jQuery);
2
  * plugin admin area javascript
3
  */
4
  (function($){$(function () {
5
+ if ( ! $('body.wpallimport-plugin').length) return; // do not execute any code if we are not on plugin page
6
 
7
  $('.product_data_tabs').find('a').click(function(){
8
  $('.product_data_tabs').find('li').removeClass('active');
74
  });
75
 
76
  if ($('input[name=is_product_manage_stock]:checked').val() == 'no') $('.stock_fields').hide(); else $('.stock_fields').show();
77
+
78
+ if ($('input[name=is_variable_product_manage_stock]:checked').val() == 'no') $('.variable_stock_fields').hide(); else $('.variable_stock_fields').fadeIn();
79
 
80
  if ($('#link_all_variations').is(':checked')) $('.variations_tab').hide(); else if (is_variable) $('.variations_tab').show();
81
 
82
  if ($('#xml_matching_parent').is(':checked') && is_variable) $('#variations_tag').show(); else $('#variations_tag').hide();
83
+
84
  if ( ! is_simple ) {
85
  $('.woocommerce_options_panel').find('input, select').attr('disabled','disabled');
86
  $('.upgrade_template').show();
103
  change_depencies();
104
  $('.wc-tabs').find('li:visible:first').find('a').click();
105
  });
106
+ $('#_virtual, #_downloadable, input[name=is_product_manage_stock], input[name=is_variable_product_manage_stock]').click(change_depencies);
107
  $('input[name=is_multiple_product_type]').click(function(){
108
  change_depencies();
109
  $('.wc-tabs').find('li:visible:first').find('a').click();
150
  });
151
 
152
  $('#_variable_downloadable').click(function(){
153
+ if ($(this).is(':checked')) $('.variable_downloadable').show(); else $('.variable_downloadable').hide();
154
  });
155
 
156
  var variation_xpath = $('#variations_xpath').val();
178
  var $goto_element = $('#goto_variation_element');
179
  var $variation_tagno = 0;
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  var variationsXPathChanged = function () {
182
 
183
  if ($input.val() == $input.data('checkedValue')) return;
186
  $input.attr('readonly', true).unbind('change', variationsXPathChanged).data('checkedValue', $input.val());
187
 
188
  var parent_tagno = parseInt($('.tag').find('input[name="tagno"]').val());
189
+
190
+ $.post('admin.php?page=pmxi-admin-import&action=evaluate_variations' + ((typeof import_id != "undefined") ? '&id=' + import_id : '') , {xpath: $input.val(), tagno: $variation_tagno, parent_tagno: parent_tagno}, function (data) {
191
  $('#variations_console').html(data.html);
192
  $input.attr('readonly', false);
193
  $xml.xml('dragable');
195
  }, 'json');
196
  };
197
 
198
+ $xml.find('.navigation a').live('click', function (e) {
199
+ e.preventDefault();
200
  $variation_tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
201
  $input.data('checkedValue', '');
202
  variationsXPathChanged();
222
  $('.variation_attributes, #woocommerce_attributes').find('label').live({
223
  mouseenter:
224
  function()
225
+ {
226
+ if ( "" == $(this).attr('for') )
227
+ {
228
+ var counter = $(this).parents('table:first').find('tr.form-field:visible').length;
229
+
230
+ $(this).parents('span:first').find('input').attr('id', $(this).parents('span:first').find('input').attr('name').replace('[]','') + '_' + counter );
231
+ $(this).attr('for', $(this).parents('span:first').find('input').attr('id'));
232
+ }
233
+ },
234
  mouseleave:
235
  function()
236
  {
264
  alert('At first, you should add minimum one attribute on the "Attributes" tab.');
265
  });
266
 
267
+ $('.pmwi_adjust_type').change(function(){
268
+ if ($(this).val() == '%'){
269
+ $(this).parents('.form-field:first').find('.pmwi_reduce_prices_note').hide();
270
+ $(this).parents('.form-field:first').find('.pmwi_percentage_prices_note').show();
271
+ }
272
+ else{
273
+ $(this).parents('.form-field:first').find('.pmwi_reduce_prices_note').show();
274
+ $(this).parents('.form-field:first').find('.pmwi_percentage_prices_note').hide();
275
+ }
276
+ }).change();
277
+
278
+ if ($('input[name=matching_parent]:checked').val() == 'first_is_parent_id' || $('input[name=matching_parent]:checked').val() == 'first_is_variation'){
279
+ $('.set_parent_stock_option').slideDown();
280
+ }
281
+ else{
282
+ $('.set_parent_stock_option').slideUp();
283
+ }
284
+
285
+ $('input[name=matching_parent]').click(function(){
286
+ if ($(this).val() == 'first_is_parent_id' || $(this).val() == 'first_is_variation'){
287
+ $('.set_parent_stock_option').slideDown();
288
+ }
289
+ else{
290
+ $('.set_parent_stock_option').slideUp();
291
+ }
292
+ });
293
+
294
+ $('.pmwi_trigger_adjust_prices').click(function(){
295
+ if ($(this).find('span').html() == '-')
296
+ $(this).find('span').html('+');
297
+ else
298
+ $(this).find('span').html('-');
299
+ $('.pmwi_adjust_prices').slideToggle();
300
+ });
301
+
302
  });})(jQuery);
views/admin/import/_tabs/_advanced.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="advanced_product_data" style="display:none;">
2
+
3
+ <div class="woo-add-on-free-edition-notice upgrade_template">
4
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
5
+ </div>
6
+
7
+ <div class="options_group hide_if_external">
8
+ <p class="form-field">
9
+ <label><?php _e("Purchase Note", "pmxi_plugin"); ?></label>
10
+ <input type="text" class="short" placeholder="" name="single_product_purchase_note" style="" value="<?php echo esc_attr($post['single_product_purchase_note']) ?>"/>
11
+ </p>
12
+ </div>
13
+ <div class="options_group">
14
+ <p class="form-field">
15
+ <label><?php _e("Menu order", "pmxi_plugin"); ?></label>
16
+ <input type="text" class="short" placeholder="" name="single_product_menu_order" value="<?php echo esc_attr($post['single_product_menu_order']) ?>"/>
17
+ </p>
18
+ </div>
19
+
20
+ <div class="options_group reviews">
21
+
22
+ <p class="form-field"><?php _e('Enable reviews','pmxi_plugin');?></p>
23
+
24
+ <p class="form-field wpallimport-radio-field">
25
+ <input type="radio" id="product_enable_reviews_yes" class="switcher" name="is_product_enable_reviews" value="yes" <?php echo 'yes' == $post['is_product_enable_reviews'] ? 'checked="checked"': '' ?>/>
26
+ <label for="product_enable_reviews_yes"><?php _e("Yes"); ?></label>
27
+ </p>
28
+ <p class="form-field wpallimport-radio-field">
29
+ <input type="radio" id="product_enable_reviews_no" class="switcher" name="is_product_enable_reviews" value="no" <?php echo 'no' == $post['is_product_enable_reviews'] ? 'checked="checked"': '' ?>/>
30
+ <label for="product_enable_reviews_no"><?php _e("No"); ?></label>
31
+ </p>
32
+ <div class="form-field wpallimport-radio-field">
33
+ <input type="radio" id="product_enable_reviews_xpath" class="switcher" name="is_product_enable_reviews" value="xpath" <?php echo 'xpath' == $post['is_product_enable_reviews'] ? 'checked="checked"': '' ?>/>
34
+ <label for="product_enable_reviews_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
35
+ <span class="wpallimport-clear"></span>
36
+ <div class="switcher-target-product_enable_reviews_xpath set_with_xpath">
37
+ <span class="wpallimport-slide-content" style="padding-left:0px;">
38
+ <input type="text" class="smaller-text" name="single_product_enable_reviews" style="width:300px;" value="<?php echo esc_attr($post['single_product_enable_reviews']) ?>"/>
39
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
40
+ </span>
41
+ </div>
42
+ </div>
43
+
44
+ </div> <!-- End options group -->
45
+
46
+ <div class="options_group">
47
+
48
+ <p class="form-field"><?php _e('Featured','pmxi_plugin');?></p>
49
+
50
+ <p class="form-field wpallimport-radio-field">
51
+ <input type="radio" id="product_featured_yes" class="switcher" name="is_product_featured" value="yes" <?php echo 'yes' == $post['is_product_featured'] ? 'checked="checked"': '' ?>/>
52
+ <label for="product_featured_yes"><?php _e("Yes"); ?></label>
53
+ </p>
54
+ <p class="form-field wpallimport-radio-field">
55
+ <input type="radio" id="product_featured_no" class="switcher" name="is_product_featured" value="no" <?php echo 'no' == $post['is_product_featured'] ? 'checked="checked"': '' ?>/>
56
+ <label for="product_featured_no"><?php _e("No"); ?></label>
57
+ </p>
58
+ <div class="form-field wpallimport-radio-field">
59
+ <input type="radio" id="product_featured_xpath" class="switcher" name="is_product_featured" value="xpath" <?php echo 'xpath' == $post['is_product_featured'] ? 'checked="checked"': '' ?>/>
60
+ <label for="product_featured_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
61
+ <span class="wpallimport-clear"></span>
62
+ <div class="switcher-target-product_featured_xpath set_with_xpath">
63
+ <span class="wpallimport-slide-content" style="padding-left:0;">
64
+ <input type="text" class="smaller-text" name="single_product_featured" style="width:300px;" value="<?php echo esc_attr($post['single_product_featured']) ?>"/>
65
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
66
+ </span>
67
+ </div>
68
+ </div>
69
+
70
+ </div> <!-- End options group -->
71
+
72
+ <div class="options_group">
73
+
74
+ <p class="form-field"><?php _e('Catalog visibility','pmxi_plugin');?></p>
75
+
76
+ <p class="form-field wpallimport-radio-field">
77
+ <input type="radio" id="product_visibility_visible" class="switcher" name="is_product_visibility" value="visible" <?php echo 'visible' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
78
+ <label for="product_visibility_visible"><?php _e("Catalog/search"); ?></label>
79
+ </p>
80
+ <p class="form-field wpallimport-radio-field">
81
+ <input type="radio" id="product_visibility_catalog" class="switcher" name="is_product_visibility" value="catalog" <?php echo 'catalog' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
82
+ <label for="product_visibility_catalog"><?php _e("Catalog"); ?></label>
83
+ </p>
84
+ <p class="form-field wpallimport-radio-field">
85
+ <input type="radio" id="product_visibility_search" class="switcher" name="is_product_visibility" value="search" <?php echo 'search' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
86
+ <label for="product_visibility_search"><?php _e("Search"); ?></label>
87
+ </p>
88
+ <p class="form-field wpallimport-radio-field">
89
+ <input type="radio" id="product_visibility_hidden" class="switcher" name="is_product_visibility" value="hidden" <?php echo 'hidden' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
90
+ <label for="product_visibility_hidden"><?php _e("Hidden"); ?></label>
91
+ </p>
92
+ <div class="form-field wpallimport-radio-field">
93
+ <input type="radio" id="product_visibility_xpath" class="switcher" name="is_product_visibility" value="xpath" <?php echo 'xpath' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
94
+ <label for="product_visibility_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
95
+ <span class="wpallimport-clear"></span>
96
+ <div class="switcher-target-product_visibility_xpath set_with_xpath">
97
+ <span class="wpallimport-slide-content" style="padding-left:0;">
98
+ <input type="text" class="smaller-text" name="single_product_visibility" style="width:300px;" value="<?php echo esc_attr($post['single_product_visibility']) ?>"/>
99
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'visible\', \'catalog\', \'search\', \'hidden\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
100
+ </span>
101
+ </div>
102
+ </div>
103
+
104
+ </div> <!-- End options group -->
105
+ </div><!-- End Product Panel -->
views/admin/import/_tabs/_attributes.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="woocommerce_attributes" style="display:none;">
2
+ <div style="margin-left:-2%;">
3
+ <div class="woo-add-on-free-edition-notice upgrade_template" style="margin-top:0;">
4
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
5
+ </div>
6
+ </div>
7
+ <div class="input">
8
+ <table class="form-table custom-params" id="attributes_table" style="max-width:95%;">
9
+ <thead>
10
+ <tr>
11
+ <td><?php _e('Name', 'pmxi_plugin'); ?></td>
12
+ <td style="padding-bottom: 5px;">
13
+ <?php _e('Values', 'pmxi_plugin'); ?>
14
+ <a href="#help" class="wpallimport-help" title="<?php _e('Separate mutiple values with a |', 'pmxi_plugin') ?>" style="top:-1px;">?</a>
15
+ </td>
16
+ <td></td>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <?php if (!empty($post['attribute_name'][0])):?>
21
+ <?php foreach ($post['attribute_name'] as $i => $name): if ("" == $name) continue; ?>
22
+ <tr class="form-field">
23
+ <td style="width: 50%;">
24
+ <input type="text" class="widefat" name="attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:100%;"/>
25
+ </td>
26
+ <td style="width: 50%;">
27
+ <input type="text" class="widefat" name="attribute_value[]" value="<?php echo str_replace("&amp;","&", htmlentities(htmlentities($post['attribute_value'][$i]))); ?>" style="width:100%;"/>
28
+ <span class="wpallimport-clear"></span>
29
+ <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
30
+ <span class='in_variations'>
31
+ <input type="checkbox" name="in_variations[]" id="in_variations_<?php echo $i; ?>" <?php echo ($post['in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="float: left;" value="1"/>
32
+ <label for="in_variations_<?php echo $i; ?>"><?php _e('In Variations','pmxi_plugin');?></label>
33
+ </span>
34
+
35
+ <span class='is_visible'>
36
+ <input type="checkbox" name="is_visible[]" id="is_visible_<?php echo $i; ?>" <?php echo ($post['is_visible'][$i]) ? 'checked="checked"' : ''; ?> style="float: left;" value="1"/>
37
+ <label for="is_visible_<?php echo $i; ?>"><?php _e('Is Visible','pmxi_plugin');?></label>
38
+ </span>
39
+
40
+ <span class='is_taxonomy'>
41
+ <input type="checkbox" name="is_taxonomy[]" id="is_taxonomy_<?php echo $i; ?>" <?php echo ($post['is_taxonomy'][$i]) ? 'checked="checked"' : ''; ?> style="float: left;" value="1"/>
42
+ <label for="is_taxonomy_<?php echo $i; ?>"><?php _e('Taxonomy','pmxi_plugin');?></label>
43
+ </span>
44
+
45
+ <span class='is_create_taxonomy'>
46
+ <input type="checkbox" name="create_taxonomy_in_not_exists[]" id="create_taxonomy_in_not_exists_<?php echo $i; ?>" <?php echo ($post['create_taxonomy_in_not_exists'][$i]) ? 'checked="checked"' : ''; ?> style="float: left;" value="1"/>
47
+ <label for="create_taxonomy_in_not_exists_<?php echo $i; ?>"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
48
+ </span>
49
+ </p>
50
+ </td>
51
+ <td class="action remove"><a href="#remove" style="top:9px;"></a></td>
52
+ </tr>
53
+ <?php endforeach ?>
54
+ <?php else: ?>
55
+ <tr class="form-field">
56
+ <td style="width: 50%;">
57
+ <input type="text" name="attribute_name[]" value="" class="widefat" style="width:100%;"/>
58
+ </td>
59
+ <td style="width: 50%;">
60
+ <input type="text" name="attribute_value[]" class="widefat" vaalue="" style="width:100%;"/>
61
+ <span class="wpallimport-clear"></span>
62
+ <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
63
+ <span class='in_variations'>
64
+ <input type="checkbox" name="in_variations[]" id="in_variations_0" checked="checked" style="float: left;" value="1"/>
65
+ <label for="in_variations_0"><?php _e('In Variations','pmxi_plugin');?></label>
66
+ </span>
67
+ <span class='is_visible'>
68
+ <input type="checkbox" name="is_visible[]" id="is_visible_0" checked="checked" style="float: left;" value="1"/>
69
+ <label for="is_visible_0"><?php _e('Is Visible','pmxi_plugin');?></label>
70
+ </span>
71
+ <span class='is_taxonomy'>
72
+ <input type="checkbox" name="is_taxonomy[]" id="is_taxonomy_0" checked="checked" style="float: left;" value="1"/>
73
+ <label for="is_taxonomy_0"><?php _e('Taxonomy','pmxi_plugin');?></label>
74
+ </span>
75
+ <span class='is_create_taxonomy'>
76
+ <input type="checkbox" name="create_taxonomy_in_not_exists[]" id="create_taxonomy_in_not_exists_0" checked="checked" style="float: left;" value="1"/>
77
+ <label for="create_taxonomy_in_not_exists_0"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
78
+ </span>
79
+ </p>
80
+ </td>
81
+ <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
82
+ </tr>
83
+ <?php endif;?>
84
+ <tr class="form-field template">
85
+ <td style="width: 50%;">
86
+ <input type="text" name="attribute_name[]" value="" class="widefat" style="width:100%;"/>
87
+ </td>
88
+ <td style="width: 50%;">
89
+ <input type="text" name="attribute_value[]" class="widefat" value="" style="width:100%;"/>
90
+ <span class="wpallimport-clear"></span>
91
+ <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
92
+ <span class='in_variations'>
93
+ <input type="checkbox" name="in_variations[]" checked="checked" style="float: left;" value="1"/>
94
+ <label for=""><?php _e('In Variations','pmxi_plugin');?></label>
95
+ </span>
96
+ <span class='is_visible'>
97
+ <input type="checkbox" name="is_visible[]" checked="checked" style="float: left;" value="1"/>
98
+ <label for=""><?php _e('Is Visible','pmxi_plugin');?></label>
99
+ </span>
100
+ <span class='is_taxonomy'>
101
+ <input type="checkbox" name="is_taxonomy[]" checked="checked" style="float: left;" value="1"/>
102
+ <label for=""><?php _e('Taxonomy','pmxi_plugin');?></label>
103
+ </span>
104
+ <span class='is_create_taxonomy'>
105
+ <input type="checkbox" name="create_taxonomy_in_not_exists[]" checked="checked" style="float: left;" value="1"/>
106
+ <label for=""><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
107
+ </span>
108
+ </p>
109
+ </td>
110
+ <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
111
+ </tr>
112
+ <tr>
113
+ <td colspan="3"><a href="#add" title="<?php _e('add', 'pmxi_plugin')?>" class="action add-new-custom"><?php _e('Add more', 'pmxi_plugin') ?></a></td>
114
+ </tr>
115
+ </tbody>
116
+ </table>
117
+ </div>
118
+ <div class="options_group show_if_variable">
119
+ <p class="form-field wpallimport-radio-field" style="padding-left: 0 !important;">
120
+ <input type="hidden" name="link_all_variations" value="0" />
121
+ <input type="checkbox" id="link_all_variations" name="link_all_variations" value="1" <?php echo $post['link_all_variations'] ? 'checked="checked"' : '' ?>/>
122
+ <label style="width: 100px;" for="link_all_variations"><?php _e('Link all variations', 'pmxi_plugin') ?></label>
123
+ <a href="#help" class="wpallimport-help" title="<?php _e('This option will create all possible variations for the presented attributes. Works just like the Link All Variations option inside WooCommerce.', 'pmxi_plugin') ?>" style="top:3px;">?</a>
124
+ </p>
125
+ </div>
126
+ </div><!-- End Product Panel -->
views/admin/import/_tabs/_general.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="general_product_data">
2
+ <div class="woo-add-on-free-edition-notice upgrade_template">
3
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
4
+ </div>
5
+ <div class="options_group hide_if_grouped">
6
+ <p class="form-field">
7
+ <label><?php _e("SKU"); ?></label>
8
+ <input type="text" class="short" name="single_product_sku" style="" value="<?php echo esc_attr($post['single_product_sku']) ?>"/>
9
+ </p>
10
+ </div>
11
+ <div class="options_group show_if_external">
12
+ <p class="form-field">
13
+ <label><?php _e("Product URL"); ?></label>
14
+ <input type="text" class="short" name="single_product_url" value="<?php echo esc_attr($post['single_product_url']) ?>"/>
15
+ <a href="#help" class="wpallimport-help" title="<?php _e('The external/affiliate link URL to the product.', 'pmxi_plugin') ?>">?</a>
16
+ </p>
17
+ <p class="form-field">
18
+ <label><?php _e("Button text"); ?></label>
19
+ <input type="text" class="short" name="single_product_button_text" value="<?php echo esc_attr($post['single_product_button_text']) ?>"/>
20
+ <a href="#help" class="wpallimport-help" title="<?php _e('This text will be shown on the button linking to the external product.', 'pmxi_plugin') ?>">?</a>
21
+ </p>
22
+ </div>
23
+ <div class="options_group pricing show_if_simple show_if_external show_if_variable">
24
+
25
+ <p class="form-field"><i><?php _e('Prices should be presented as you would enter them manually in WooCommerce - with no currency symbol.', 'pmxi_plugin'); ?></i></p>
26
+
27
+ <p class="form-field">
28
+ <label><?php _e("Regular Price (".get_woocommerce_currency_symbol().")"); ?></label>
29
+ <input type="text" class="short" name="single_product_regular_price" value="<?php echo esc_attr($post['single_product_regular_price']) ?>"/> <strong class="options_group show_if_variable" style="position:relative; top:4px; left:4px;">(<?php _e('required', 'pmxi_plugin'); ?>)</strong>
30
+ </p>
31
+ <p class="form-field">
32
+ <label><?php _e("Sale Price (".get_woocommerce_currency_symbol().")"); ?></label>
33
+ <input type="text" class="short" name="single_product_sale_price" value="<?php echo esc_attr($post['single_product_sale_price']) ?>"/>&nbsp;<a id="regular_price_shedule" href="javascript:void(0);" <?php if ($post['is_regular_price_shedule']):?>style="display:none;"<?php endif; ?>><?php _e('schedule');?></a>
34
+ <input type="hidden" name="is_regular_price_shedule" value="<?php echo esc_attr($post['is_regular_price_shedule']) ?>"/>
35
+ </p>
36
+ <p class="form-field" <?php if ( ! $post['is_regular_price_shedule']):?>style="display:none;"<?php endif; ?> id="sale_price_range">
37
+ <span style="vertical-align:middle">
38
+ <label><?php _e("Sale Price Dates"); ?></label>
39
+ <input type="text" class="datepicker" name="single_sale_price_dates_from" value="<?php echo esc_attr($post['single_sale_price_dates_from']) ?>" style="float:none; width:110px;"/>
40
+ <span><?php _e('and', 'pmxi_plugin') ?></span>
41
+ <input type="text" class="datepicker" name="single_sale_price_dates_to" value="<?php echo esc_attr($post['single_sale_price_dates_to']) ?>" style="float:none !important; width:110px;"/>
42
+ &nbsp;<a id="cancel_regular_price_shedule" href="javascript:void(0);"><?php _e('cancel');?></a>
43
+ </span>
44
+ </p>
45
+
46
+ <!-- AUTOFIX PRICES -->
47
+
48
+ <p class="form-field pmwi_trigger_adjust_prices"> <strong><?php _e('Adjust Prices (mark up, mark down, convert currency)'); ?> <span><?php if (!empty($post['single_product_regular_price_adjust']) or !empty($post['single_product_sale_price_adjust'])):?>-<?php else: ?>+<?php endif; ?></span></strong></p>
49
+
50
+ <div class="pmwi_adjust_prices" <?php if (!empty($post['single_product_regular_price_adjust']) or !empty($post['single_product_sale_price_adjust'])):?>style="display:block;"<?php endif; ?>>
51
+ <p class="form-field">
52
+ <label><?php _e("Regular Price (".get_woocommerce_currency_symbol().")"); ?></label>
53
+ <input type="text" class="short" name="single_product_regular_price_adjust" value="<?php echo esc_attr($post['single_product_regular_price_adjust']) ?>"/>
54
+ <select name="single_product_regular_price_adjust_type" class="pmwi_adjust_type">
55
+ <option value="%" <?php echo ($post['single_product_regular_price_adjust_type'] == '%') ? 'selected="selected"' : ''; ?>>%</option>
56
+ <option value="$" <?php echo ($post['single_product_regular_price_adjust_type'] == '$') ? 'selected="selected"' : ''; ?>><?php echo get_woocommerce_currency_symbol(); ?></option>
57
+ </select>
58
+ <a href="#help" class="wpallimport-help pmwi_percentage_prices_note" title="<?php _e('Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.', 'pmxi_plugin') ?>">?</a>
59
+ <a href="#help" class="wpallimport-help pmwi_reduce_prices_note" title="<?php _e('Enter a negative number to reduce prices.', 'pmxi_plugin') ?>">?</a>
60
+ <span class="wpallimport-clear"></span>
61
+ </p>
62
+
63
+ <p class="form-field">
64
+ <label><?php _e("Sale Price (".get_woocommerce_currency_symbol().")"); ?></label>
65
+ <input type="text" class="short" name="single_product_sale_price_adjust" value="<?php echo esc_attr($post['single_product_sale_price_adjust']) ?>"/>
66
+ <select name="single_product_sale_price_adjust_type" class="pmwi_adjust_type">
67
+ <option value="%" <?php echo ($post['single_product_sale_price_adjust_type'] == '%') ? 'selected="selected"' : ''; ?>>%</option>
68
+ <option value="$" <?php echo ($post['single_product_sale_price_adjust_type'] == '$') ? 'selected="selected"' : ''; ?>><?php echo get_woocommerce_currency_symbol(); ?></option>
69
+ </select>
70
+ <a href="#help" class="wpallimport-help pmwi_percentage_prices_note" title="<?php _e('Leave blank or enter in 100% to keep the price as is. Enter in 110% to markup by 10%. Enter in 50% to cut prices in half.', 'pmxi_plugin') ?>">?</a>
71
+ <a href="#help" class="wpallimport-help pmwi_reduce_prices_note" title="<?php _e('Enter a negative number to reduce prices.', 'pmxi_plugin') ?>">?</a>
72
+ <span class="wpallimport-clear"></span>
73
+ </p>
74
+ </div>
75
+
76
+ <br>
77
+
78
+ <p class="form-field wpallimport-radio-field">
79
+ <input type="hidden" name="disable_prepare_price" value="0" />
80
+ <input type="checkbox" id="disable_prepare_price" name="disable_prepare_price" value="1" <?php echo $post['disable_prepare_price'] ? 'checked="checked"' : '' ?> />
81
+ <label for="disable_prepare_price" style="width:220px;"><?php _e('Remove currency symbols from price', 'pmxi_plugin') ?></label>
82
+ <a href="#help" class="wpallimport-help" title="<?php _e('WP All Import attempt to remove currency symbols from prices.', 'pmxi_plugin') ?>" style="position:relative; top:1px;">?</a>
83
+ </p>
84
+
85
+ <p class="form-field wpallimport-radio-field">
86
+ <input type="hidden" name="prepare_price_to_woo_format" value="0" />
87
+ <input type="checkbox" id="prepare_price_to_woo_format" name="prepare_price_to_woo_format" value="1" <?php echo $post['prepare_price_to_woo_format'] ? 'checked="checked"' : '' ?> />
88
+ <label for="prepare_price_to_woo_format" style="width:420px;"><?php _e('Attempt to convert incorrectly formatted prices to WooCommerce format', 'pmxi_plugin') ?></label>
89
+ <a href="#help" class="wpallimport-help" title="<?php _e('WP All Import will attempt to correct the formatting of prices presented incorrectly, but this doesn\'t always work. Try unchecking this option if your prices are not appearing correctly, or enter your prices in your import file using the same format you would when entering them in WooCommerce.', 'pmxi_plugin') ?>" style="position:relative; top:1px;">?</a>
90
+ </p>
91
+
92
+ <p class="form-field">
93
+ <a href="javascript:void(0);" class="preview_prices" rel="preview_prices" style="float:left;"><?php _e('Preview Prices', 'pmxi_plugin'); ?></a>
94
+ </p>
95
+
96
+ </div>
97
+ <div class="options_group show_if_virtual">
98
+
99
+ <p class="form-field wpallimport-radio-field">
100
+ <input type="radio" id="is_product_virtual_yes" class="switcher" name="is_product_virtual" value="yes" <?php echo 'yes' == $post['is_product_virtual'] ? 'checked="checked"': '' ?>/>
101
+ <label for="is_product_virtual_yes"><?php _e("Virtual"); ?></label>
102
+ </p>
103
+ <p class="form-field wpallimport-radio-field">
104
+ <input type="radio" id="is_product_virtual_no" class="switcher" name="is_product_virtual" value="no" <?php echo 'no' == $post['is_product_virtual'] ? 'checked="checked"': '' ?>/>
105
+ <label for="is_product_virtual_no"><?php _e("Not Virtual"); ?></label>
106
+ </p>
107
+ <div class="form-field wpallimport-radio-field">
108
+ <input type="radio" id="is_product_virtual_xpath" class="switcher" name="is_product_virtual" value="xpath" <?php echo 'xpath' == $post['is_product_virtual'] ? 'checked="checked"': '' ?>/>
109
+ <label for="is_product_virtual_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
110
+ <span class="wpallimport-clear"></span>
111
+ <div class="switcher-target-is_product_virtual_xpath set_with_xpath">
112
+ <span class="wpallimport-slide-content" style="padding-left:0;">
113
+ <input type="text" class="smaller-text" name="single_product_virtual" style="width:300px;" value="<?php echo esc_attr($post['single_product_virtual']) ?>"/>
114
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>">?</a>
115
+ </span>
116
+ </div>
117
+ </div>
118
+
119
+ </div>
120
+ <div class="options_group show_if_downloadable">
121
+
122
+ <p class="form-field wpallimport-radio-field">
123
+ <input type="radio" id="is_product_downloadable_yes" class="switcher" name="is_product_downloadable" value="yes" <?php echo 'yes' == $post['is_product_downloadable'] ? 'checked="checked"': '' ?>/>
124
+ <label for="is_product_downloadable_yes"><?php _e("Downloadable"); ?></label>
125
+ </p>
126
+ <p class="form-field wpallimport-radio-field">
127
+ <input type="radio" id="is_product_downloadable_no" class="switcher" name="is_product_downloadable" value="no" <?php echo 'no' == $post['is_product_downloadable'] ? 'checked="checked"': '' ?>/>
128
+ <label for="is_product_downloadable_no"><?php _e("Not Downloadable"); ?></label>
129
+ </p>
130
+ <div class="form-field wpallimport-radio-field">
131
+ <input type="radio" id="is_product_downloadable_xpath" class="switcher" name="is_product_downloadable" value="xpath" <?php echo 'xpath' == $post['is_product_downloadable'] ? 'checked="checked"': '' ?>/>
132
+ <label for="is_product_downloadable_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
133
+ <span class="wpallimport-clear"></span>
134
+ <div class="switcher-target-is_product_downloadable_xpath set_with_xpath">
135
+ <span class="wpallimport-slide-content" style="padding-left:0;">
136
+ <input type="text" class="smaller-text" name="single_product_downloadable" style="width:300px;" value="<?php echo esc_attr($post['single_product_downloadable']) ?>"/>
137
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
138
+ </span>
139
+ </div>
140
+ </div>
141
+ </div>
142
+
143
+ <div class="options_group show_if_downloadable">
144
+ <p class="form-field">
145
+ <label><?php _e("File paths"); ?></label>
146
+ <input type="text" class="short" name="single_product_files" value="<?php echo esc_attr($post['single_product_files']) ?>" style="margin-right:5px;"/>
147
+ <input type="text" class="small" name="product_files_delim" value="<?php echo esc_attr($post['product_files_delim']) ?>" style="width:5%; text-align:center;"/>
148
+ <a href="#help" class="wpallimport-help" title="<?php _e('File paths/URLs, comma separated. The delimiter is used when an XML element contains multiple URLs/paths - i.e. <code>http://files.com/1.doc, http://files.com/2.doc</code>.', 'pmxi_plugin') ?>">?</a>
149
+ </p>
150
+ <p class="form-field">
151
+ <label><?php _e("File names"); ?></label>
152
+ <input type="text" class="short" name="single_product_files_names" value="<?php echo esc_attr($post['single_product_files_names']) ?>" style="margin-right:5px;"/>
153
+ <input type="text" class="small" name="product_files_names_delim" value="<?php echo esc_attr($post['product_files_names_delim']) ?>" style="width:5%; text-align:center;"/>
154
+ <a href="#help" class="wpallimport-help" title="<?php _e('File names, comma separated. The delimiter is used when an XML element contains multiple names - i.e. <code>1.doc, 2.doc</code>.', 'pmxi_plugin') ?>">?</a>
155
+ </p>
156
+ <p class="form-field">
157
+ <label><?php _e("Download Limit"); ?></label>
158
+ <input type="text" class="short" placeholder="Unimited" name="single_product_download_limit" value="<?php echo esc_attr($post['single_product_download_limit']) ?>"/>&nbsp;
159
+ <a href="#help" class="wpallimport-help" title="<?php _e( 'Leave blank for unlimited re-downloads.', 'woocommerce' ) ?>">?</a>
160
+ </p>
161
+ <p class="form-field">
162
+ <label><?php _e("Download Expiry"); ?></label>
163
+ <input type="text" class="short" placeholder="Never" name="single_product_download_expiry" value="<?php echo esc_attr($post['single_product_download_expiry']) ?>"/>&nbsp;
164
+ <a href="#help" class="wpallimport-help" title="<?php _e( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ) ?>">?</a>
165
+ </p>
166
+ <p class="form-field">
167
+ <label><?php _e("Download Type"); ?></label>
168
+ <input type="text" class="short" placeholder="Standard Product" name="single_product_download_type" value="<?php echo esc_attr($post['single_product_download_type']) ?>"/>&nbsp;
169
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'application\', \'music\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
170
+ </p>
171
+ </div>
172
+
173
+ <div class="options_group show_if_simple show_if_external show_if_variable">
174
+
175
+ <div class="form-field wpallimport-radio-field">
176
+ <input type="radio" id="multiple_product_tax_status_yes" class="switcher" name="is_multiple_product_tax_status" value="yes" <?php echo 'no' != $post['is_multiple_product_tax_status'] ? 'checked="checked"': '' ?>/>
177
+ <label for="multiple_product_tax_status_yes"><?php _e("Tax Status", "pmxi_plugin"); ?></label>
178
+ <span class="wpallimport-clear"></span>
179
+ <div class="switcher-target-multiple_product_tax_status_yes set_with_xpath">
180
+ <span class="wpallimport-slide-content" style="padding-left:0;">
181
+ <select class="select short" name="multiple_product_tax_status">
182
+ <option value="taxable" <?php echo 'taxable' == $post['multiple_product_tax_status'] ? 'selected="selected"': '' ?>><?php _e('Taxable', 'woocommerce');?></option>
183
+ <option value="shipping" <?php echo 'shipping' == $post['multiple_product_tax_status'] ? 'selected="selected"': '' ?>><?php _e('Shipping only', 'woocommerce');?></option>
184
+ <option value="none" <?php echo 'none' == $post['multiple_product_tax_status'] ? 'selected="selected"': '' ?>><?php _e('None', 'woocommerce');?></option>
185
+ </select>
186
+ </span>
187
+ </div>
188
+ </div>
189
+
190
+ <div class="form-field wpallimport-radio-field">
191
+ <input type="radio" id="multiple_product_tax_status_no" class="switcher" name="is_multiple_product_tax_status" value="no" <?php echo 'no' == $post['is_multiple_product_tax_status'] ? 'checked="checked"': '' ?>/>
192
+ <label for="multiple_product_tax_status_no"><?php _e('Set tax status with XPath', 'pmxi_plugin' ); ?></label>
193
+ <span class="wpallimport-clear"></span>
194
+ <div class="switcher-target-multiple_product_tax_status_no set_with_xpath">
195
+ <span class="wpallimport-slide-content" style="padding-left:0;">
196
+ <input type="text" class="smaller-text" name="single_product_tax_status" style="width:300px;" value="<?php echo esc_attr($post['single_product_tax_status']) ?>"/>
197
+ <a href="#help" class="wpallimport-help" title="<?php _e('Value should be the slug for the tax status - \'taxable\', \'shipping\', and \'none\' are the default slugs.', 'pmxi_plugin') ?>">?</a>
198
+ </span>
199
+ </div>
200
+ </div>
201
+
202
+ </div>
203
+ <div class="options_group show_if_simple show_if_external show_if_variable">
204
+
205
+ <div class="form-field wpallimport-radio-field">
206
+ <input type="radio" id="multiple_product_tax_class_yes" class="switcher" name="is_multiple_product_tax_class" value="yes" <?php echo 'no' != $post['is_multiple_product_tax_class'] ? 'checked="checked"': '' ?>/>
207
+ <label for="multiple_product_tax_class_yes"><?php _e("Tax Class", "pmxi_plugin"); ?></label>
208
+
209
+ <span class="wpallimport-clear"></span>
210
+ <div class="switcher-target-multiple_product_tax_class_yes set_with_xpath">
211
+ <span class="wpallimport-slide-content" style="padding-left:0;">
212
+ <?php
213
+ $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
214
+ $classes_options = array();
215
+ $classes_options[''] = __( 'Standard', 'woocommerce' );
216
+ if ( $tax_classes )
217
+ foreach ( $tax_classes as $class )
218
+ $classes_options[ sanitize_title( $class ) ] = esc_html( $class );
219
+ ?>
220
+ <select class="select short" name="multiple_product_tax_class">
221
+ <?php foreach ($classes_options as $key => $value):?>
222
+ <option value="<?php echo $key; ?>" <?php echo $key == $post['multiple_product_tax_class'] ? 'selected="selected"': '' ?>><?php echo $value; ?></option>
223
+ <?php endforeach; ?>
224
+ </select>
225
+ </span>
226
+ </div>
227
+ </div>
228
+
229
+ <div class="form-field wpallimport-radio-field">
230
+ <input type="radio" id="multiple_product_tax_class_no" class="switcher" name="is_multiple_product_tax_class" value="no" <?php echo 'no' == $post['is_multiple_product_tax_class'] ? 'checked="checked"': '' ?>/>
231
+ <label for="multiple_product_tax_class_no"><?php _e('Set tax class with XPath', 'pmxi_plugin' )?></label>
232
+
233
+ <span class="wpallimport-clear"></span>
234
+ <div class="switcher-target-multiple_product_tax_class_no set_with_xpath">
235
+ <span class="wpallimport-slide-content" style="padding-left:0;">
236
+ <input type="text" class="smaller-text" name="single_product_tax_class" style="width:300px;" value="<?php echo esc_attr($post['single_product_tax_class']) ?>"/>
237
+ <a href="#help" class="wpallimport-help" title="<?php _e('Value should be the slug for the tax class - \'reduced-rate\' and \'zero-rate\', are the default slugs.', 'pmxi_plugin') ?>">?</a>
238
+ </span>
239
+ </div>
240
+ </div>
241
+
242
+ </div>
243
+
244
+ </div>
views/admin/import/_tabs/_inventory.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="inventory_product_data" style="display:none;">
2
+ <div class="woo-add-on-free-edition-notice upgrade_template">
3
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
4
+ </div>
5
+ <div class="options_group show_if_simple show_if_variable">
6
+
7
+ <p class="form-field"><?php _e("Manage stock?", "pmxi_plugin"); ?></p>
8
+
9
+ <p class="form-field wpallimport-radio-field">
10
+ <input type="radio" id="is_product_manage_stock_yes" class="switcher" name="is_product_manage_stock" value="yes" <?php echo 'yes' == $post['is_product_manage_stock'] ? 'checked="checked"': '' ?>/>
11
+ <label for="is_product_manage_stock_yes"><?php _e("Yes"); ?></label>
12
+ </p>
13
+ <p class="form-field wpallimport-radio-field">
14
+ <input type="radio" id="is_product_manage_stock_no" class="switcher" name="is_product_manage_stock" value="no" <?php echo 'no' == $post['is_product_manage_stock'] ? 'checked="checked"': '' ?>/>
15
+ <label for="is_product_manage_stock_no"><?php _e("No"); ?></label>
16
+ </p>
17
+ <div class="form-field wpallimport-radio-field">
18
+ <input type="radio" id="is_product_manage_stock_xpath" class="switcher" name="is_product_manage_stock" value="xpath" <?php echo 'xpath' == $post['is_product_manage_stock'] ? 'checked="checked"': '' ?>/>
19
+ <label for="is_product_manage_stock_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
20
+ <span class="wpallimport-clear"></span>
21
+ <div class="switcher-target-is_product_manage_stock_xpath set_with_xpath">
22
+ <span class="wpallimport-slide-content" style="padding-left:0;">
23
+ <input type="text" class="smaller-text" name="single_product_manage_stock" style="width:300px;" value="<?php echo esc_attr($post['single_product_manage_stock']) ?>"/>
24
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
25
+ </span>
26
+ </div>
27
+ </div>
28
+
29
+ </div>
30
+ <div class="options_group stock_fields show_if_simple show_if_variable">
31
+ <p class="form-field" style="margin-top:0;">
32
+ <label><?php _e("Stock Qty", "pmxi_plugin"); ?></label>
33
+ <input type="text" class="short" name="single_product_stock_qty" value="<?php echo esc_attr($post['single_product_stock_qty']) ?>"/>
34
+ </p>
35
+ </div>
36
+ <div class="options_group">
37
+
38
+ <p class="form-field"><?php _e('Stock status','pmxi_plugin');?></p>
39
+
40
+ <p class="form-field wpallimport-radio-field">
41
+ <input type="radio" id="product_stock_status_in_stock" class="switcher" name="product_stock_status" value="instock" <?php echo 'instock' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
42
+ <label for="product_stock_status_in_stock"><?php _e("In stock"); ?></label>
43
+ </p>
44
+ <p class="form-field wpallimport-radio-field">
45
+ <input type="radio" id="product_stock_status_out_of_stock" class="switcher" name="product_stock_status" value="outofstock" <?php echo 'outofstock' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
46
+ <label for="product_stock_status_out_of_stock"><?php _e("Out of stock"); ?></label>
47
+ </p>
48
+ <p class="form-field wpallimport-radio-field">
49
+ <input type="radio" id="product_stock_status_automatically" class="switcher" name="product_stock_status" value="auto" <?php echo 'auto' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
50
+ <label for="product_stock_status_automatically" style="width:105px;"><?php _e("Set automatically", "pmxi_plugin"); ?></label>
51
+ <a href="#help" class="wpallimport-help" title="<?php _e('Set the stock status to In Stock for positive or blank Stock Qty values, and Out Of Stock if Stock Qty is 0.', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
52
+ </p>
53
+ <div class="form-field wpallimport-radio-field">
54
+ <input type="radio" id="product_stock_status_xpath" class="switcher" name="product_stock_status" value="xpath" <?php echo 'xpath' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
55
+ <label for="product_stock_status_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
56
+ <span class="wpallimport-clear"></span>
57
+ <div class="switcher-target-product_stock_status_xpath set_with_xpath">
58
+ <span class="wpallimport-slide-content" style="padding-left:0;">
59
+ <input type="text" class="smaller-text" name="single_product_stock_status" style="width:300px;" value="<?php echo esc_attr($post['single_product_stock_status']) ?>"/>
60
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'instock\', \'outofstock\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
61
+ </span>
62
+ </div>
63
+ </div>
64
+
65
+ </div>
66
+ <div class="options_group show_if_simple show_if_variable">
67
+
68
+ <p class="form-field"><?php _e('Allow Backorders?','pmxi_plugin');?></p>
69
+
70
+ <p class="form-field wpallimport-radio-field">
71
+ <input type="radio" id="product_allow_backorders_no" class="switcher" name="product_allow_backorders" value="no" <?php echo 'no' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
72
+ <label for="product_allow_backorders_no"><?php _e("Do not allow"); ?></label>
73
+ </p>
74
+ <p class="form-field wpallimport-radio-field">
75
+ <input type="radio" id="product_allow_backorders_notify" class="switcher" name="product_allow_backorders" value="notify" <?php echo 'notify' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
76
+ <label for="product_allow_backorders_notify"><?php _e("Allow, but notify customer"); ?></label>
77
+ </p>
78
+ <p class="form-field wpallimport-radio-field">
79
+ <input type="radio" id="product_allow_backorders_yes" class="switcher" name="product_allow_backorders" value="yes" <?php echo 'yes' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
80
+ <label for="product_allow_backorders_yes"><?php _e("Allow"); ?></label>
81
+ </p>
82
+ <div class="form-field wpallimport-radio-field">
83
+ <input type="radio" id="product_allow_backorders_xpath" class="switcher" name="product_allow_backorders" value="xpath" <?php echo 'xpath' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
84
+ <label for="product_allow_backorders_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
85
+ <span class="wpallimport-clear"></span>
86
+ <div class="switcher-target-product_allow_backorders_xpath set_with_xpath">
87
+ <span class="wpallimport-slide-content" style="padding-left:0;">
88
+ <input type="text" class="smaller-text" name="single_product_allow_backorders" style="width:300px;" value="<?php echo esc_attr($post['single_product_allow_backorders']) ?>"/>
89
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'no\', \'notify\', \'yes\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
90
+ </span>
91
+ </div>
92
+ </div>
93
+
94
+ </div>
95
+ <div class="options_group show_if_simple show_if_variable">
96
+
97
+ <p class="form-field"><?php _e('Sold Individually?','pmxi_plugin');?></p>
98
+
99
+ <p class="form-field wpallimport-radio-field">
100
+ <input type="radio" id="product_sold_individually_yes" class="switcher" name="product_sold_individually" value="yes" <?php echo 'yes' == $post['product_sold_individually'] ? 'checked="checked"': '' ?>/>
101
+ <label for="product_sold_individually_yes"><?php _e("Yes"); ?></label>
102
+ </p>
103
+ <p class="form-field wpallimport-radio-field">
104
+ <input type="radio" id="product_sold_individually_no" class="switcher" name="product_sold_individually" value="no" <?php echo 'no' == $post['product_sold_individually'] ? 'checked="checked"': '' ?>/>
105
+ <label for="product_sold_individually_no"><?php _e("No"); ?></label>
106
+ </p>
107
+ <div class="form-field wpallimport-radio-field">
108
+ <input type="radio" id="product_sold_individually_xpath" class="switcher" name="product_sold_individually" value="xpath" <?php echo 'xpath' == $post['product_sold_individually'] ? 'checked="checked"': '' ?>/>
109
+ <label for="product_sold_individually_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
110
+ <span class="wpallimport-clear"></span>
111
+ <div class="switcher-target-product_sold_individually_xpath set_with_xpath">
112
+ <span class="wpallimport-slide-content" style="padding-left:0;">
113
+ <input type="text" class="smaller-text" name="single_product_sold_individually" style="width:300px;" value="<?php echo esc_attr($post['single_product_sold_individually']) ?>"/>
114
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
115
+ </span>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
views/admin/import/_tabs/_linked_product.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="linked_product_data" style="display:none;">
2
+ <div class="woo-add-on-free-edition-notice upgrade_template">
3
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
4
+ </div>
5
+ <div class="options_group">
6
+ <p class="form-field">
7
+ <label><?php _e("Up-Sells"); ?></label>
8
+ <input type="text" class="" placeholder="Product SKUs, comma separated" name="single_product_up_sells" style="" value="<?php echo esc_attr($post['single_product_up_sells']) ?>"/>
9
+ </p>
10
+ <p class="form-field">
11
+ <label><?php _e("Cross-Sells"); ?></label>
12
+ <input type="text" class="" placeholder="Product SKUs, comma separated" name="single_product_cross_sells" value="<?php echo esc_attr($post['single_product_cross_sells']) ?>"/>
13
+ </p>
14
+ </div> <!-- End options group -->
15
+ <div class="options_group grouping show_if_simple show_if_external">
16
+ <?php
17
+ $post_parents = array();
18
+ $post_parents[''] = __( 'Choose a grouped product&hellip;', 'woocommerce' );
19
+
20
+ $posts_in = array_unique( (array) get_objects_in_term( get_term_by( 'slug', 'grouped', 'product_type' )->term_id, 'product_type' ) );
21
+ if ( sizeof( $posts_in ) > 0 ) {
22
+ $args = array(
23
+ 'post_type' => 'product',
24
+ 'post_status' => 'any',
25
+ 'numberposts' => -1,
26
+ 'orderby' => 'title',
27
+ 'order' => 'asc',
28
+ 'post_parent' => 0,
29
+ 'include' => $posts_in,
30
+ );
31
+ $grouped_products = get_posts( $args );
32
+
33
+ if ( $grouped_products ) {
34
+ foreach ( $grouped_products as $product ) {
35
+
36
+ if ( $product->ID == $post->ID )
37
+ continue;
38
+
39
+ $post_parents[ $product->ID ] = $product->post_title;
40
+ }
41
+ }
42
+ }
43
+ ?>
44
+
45
+ <div class="form-field wpallimport-radio-field">
46
+ <input type="radio" id="multiple_grouping_product_yes" class="switcher" name="is_multiple_grouping_product" value="yes" <?php echo 'no' != $post['is_multiple_grouping_product'] ? 'checked="checked"': '' ?>/>
47
+ <label for="multiple_grouping_product_yes"><?php _e("Grouping", "pmxi_plugin"); ?></label>
48
+ <span class="wpallimport-clear"></span>
49
+ <div class="switcher-target-multiple_grouping_product_yes set_with_xpath">
50
+ <span class="wpallimport-slide-content" style="padding-left:0;">
51
+ <select name="multiple_grouping_product">
52
+ <?php
53
+ foreach ($post_parents as $parent_id => $parent_title) {
54
+ ?>
55
+ <option value="<?php echo $parent_id; ?>" <?php if ($parent_id == $post['multiple_grouping_product']):?>selected="selected"<?php endif;?>><?php echo $parent_title;?></option>
56
+ <?php
57
+ }
58
+ ?>
59
+ </select>
60
+ <a href="#help" class="wpallimport-help" title="<?php _e('Set this option to make this product part of a grouped product.', 'woocommerce'); ?>">?</a>
61
+ </span>
62
+ </div>
63
+ </div>
64
+
65
+ <p class="form-field wpallimport-radio-field">
66
+ <input type="radio" id="multiple_grouping_product_no" class="switcher" name="is_multiple_grouping_product" value="no" <?php echo 'no' == $post['is_multiple_grouping_product'] ? 'checked="checked"': '' ?>/>
67
+ <label for="multiple_grouping_product_no" style="width: 200px;"><?php _e('Manual Grouped Product Matching', 'pmxi_plugin' )?></label>
68
+ <a href="#help" class="wpallimport-help" sstyle="top:2px;" title="<?php _e('Product will be assigned as the child of an already created product matching the specified criteria.', 'woocommerce'); ?>">?</a>
69
+ </p>
70
+
71
+ <div class="switcher-target-multiple_grouping_product_no set_with_xpath" style="padding-left: 20px;">
72
+
73
+ <div class="form-field wpallimport-radio-field">
74
+ <input type="radio" id="duplicate_indicator_xpath_grouping" class="switcher" name="grouping_indicator" value="xpath" <?php echo 'xpath' == $post['grouping_indicator'] ? 'checked="checked"': '' ?>/>
75
+ <label for="duplicate_indicator_xpath_grouping"><?php _e('Match by Post Title', 'pmxi_plugin' )?></label>
76
+ <span class="wpallimport-clear"></span>
77
+ <div class="switcher-target-duplicate_indicator_xpath_grouping set_with_xpath" style="vertical-align:middle">
78
+ <span class="wpallimport-slide-content" style="padding-left:0;">
79
+ <input type="text" name="single_grouping_product" value="<?php echo esc_attr($post['single_grouping_product']); ?>" style="float:none; margin:1px; " />
80
+ </span>
81
+ </div>
82
+ </div>
83
+
84
+ <div class="form-field wpallimport-radio-field">
85
+ <input type="radio" id="duplicate_indicator_custom_field_grouping" class="switcher" name="grouping_indicator" value="custom field" <?php echo 'custom field' == $post['grouping_indicator'] ? 'checked="checked"': '' ?>/>
86
+ <label for="duplicate_indicator_custom_field_grouping"><?php _e('Match by Custom Field', 'pmxi_plugin' )?></label><br>
87
+ <span class="wpallimport-clear"></span>
88
+ <div class="switcher-target-duplicate_indicator_custom_field_grouping set_with_xpath" style="padding-left:40px;">
89
+ <span class="wpallimport-slide-content" style="padding-left:0;">
90
+ <label style="width: 80px;"><?php _e('Name', 'pmxi_plugin') ?></label>
91
+ <input type="text" name="custom_grouping_indicator_name" value="<?php echo esc_attr($post['custom_grouping_indicator_name']) ?>" style="float:none; margin:1px;" />
92
+
93
+ <span class="wpallimport-clear"></span>
94
+
95
+ <label style="width: 80px;"><?php _e('Value', 'pmxi_plugin') ?></label>
96
+ <input type="text" name="custom_grouping_indicator_value" value="<?php echo esc_attr($post['custom_grouping_indicator_value']) ?>" style="float:none; margin:1px;" />
97
+ </span>
98
+ </div>
99
+ </div>
100
+ </div>
101
+
102
+ </div>
103
+ </div><!-- End Product Panel -->
views/admin/import/_tabs/_options.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="add_on_options" style="display:none;">
2
+ <div class="woo-add-on-free-edition-notice upgrade_template">
3
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
4
+ </div>
5
+ <div class="options_group">
6
+
7
+ <p class="form-field"><?php _e('Import options','pmxi_plugin');?></p>
8
+
9
+ <p class="form-field wpallimport-radio-field">
10
+ <input type="hidden" name="missing_records_stock_status" value="0" />
11
+ <input type="checkbox" id="missing_records_stock_status" name="missing_records_stock_status" value="1" <?php echo $post['missing_records_stock_status'] ? 'checked="checked"' : '' ?> />
12
+ <label for="missing_records_stock_status"><?php _e('Set out of stock status for missing records', 'pmxi_plugin') ?></label>
13
+ <a href="#help" class="wpallimport-help" title="<?php _e('Option to set the stock status to out of stock instead of deleting the product entirely. This option doesn\'t work when \'Delete missing records\' option is enabled.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
14
+ </p>
15
+ <p class="form-field wpallimport-radio-field">
16
+ <input type="hidden" name="disable_auto_sku_generation" value="0" />
17
+ <input type="checkbox" id="disable_auto_sku_generation" name="disable_auto_sku_generation" value="1" <?php echo $post['disable_auto_sku_generation'] ? 'checked="checked"' : '' ?> />
18
+ <label for="disable_auto_sku_generation"><?php _e('Disable auto SKU generation', 'pmxi_plugin') ?></label>
19
+ <a href="#help" class="wpallimport-help" title="<?php _e('Plugin will NOT automaticaly generate the SKU for each product based on md5 algorithm, if SKU option is empty.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
20
+ </p>
21
+ <p class="form-field wpallimport-radio-field">
22
+ <input type="hidden" name="disable_sku_matching" value="0" />
23
+ <input type="checkbox" id="disable_sku_matching" name="disable_sku_matching" value="1" <?php echo $post['disable_sku_matching'] ? 'checked="checked"' : '' ?> />
24
+ <label for="disable_sku_matching"><?php _e('Don\'t check for duplicate SKUs', 'pmxi_plugin') ?></label>
25
+ <a href="#help" class="wpallimport-help" title="<?php _e('Each product should have a unique SKU. If this box is checked, WP All Import won\'t check for duplicate SKUs, which speeds up the import process. Make sure the SKU for each of your products is unique. If this box is unchecked, WP All Import will import products with duplicate SKUs with a blank SKU.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
26
+ </p>
27
+
28
+ </div>
29
+ </div>
views/admin/import/_tabs/_shipping.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="shipping_product_data" style="display:none;">
2
+ <div class="woo-add-on-free-edition-notice upgrade_template">
3
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
4
+ </div>
5
+ <div class="options_group">
6
+ <p class="form-field">
7
+ <label><?php _e("Weight (" . get_option('woocommerce_weight_unit') . ")"); ?></label>
8
+ <input type="text" class="short" placeholder="0.00" name="single_product_weight" style="" value="<?php echo esc_attr($post['single_product_weight']) ?>"/>
9
+ </p>
10
+ <p class="form-field">
11
+ <label><?php _e("Dimensions (" . get_option( 'woocommerce_dimension_unit' ) . ")"); ?></label>
12
+ <input type="text" class="short" placeholder="Length" name="single_product_length" style="margin-right:5px;" value="<?php echo esc_attr($post['single_product_length']) ?>"/>
13
+ <input type="text" class="short" placeholder="Width" name="single_product_width" style="margin-right:5px;" value="<?php echo esc_attr($post['single_product_width']) ?>"/>
14
+ <input type="text" class="short" placeholder="Height" name="single_product_height" style="" value="<?php echo esc_attr($post['single_product_height']) ?>"/>
15
+ </p>
16
+ </div> <!-- End options group -->
17
+
18
+ <div class="options_group">
19
+
20
+ <div class="form-field wpallimport-radio-field">
21
+ <input type="radio" id="multiple_product_shipping_class_yes" class="switcher" name="is_multiple_product_shipping_class" value="yes" <?php echo 'no' != $post['is_multiple_product_shipping_class'] ? 'checked="checked"': '' ?>/>
22
+ <label for="multiple_product_shipping_class_yes"><?php _e("Shipping Class"); ?></label>
23
+ <span class="wpallimport-clear"></span>
24
+ <div class="switcher-target-multiple_product_shipping_class_yes set_with_xpath">
25
+ <span class="wpallimport-slide-content" style="padding-left:0;">
26
+ <?php
27
+ $classes = get_the_terms( 0, 'product_shipping_class' );
28
+
29
+ $args = array(
30
+ 'taxonomy' => 'product_shipping_class',
31
+ 'hide_empty' => 0,
32
+ 'show_option_none' => __( 'No shipping class', 'woocommerce' ),
33
+ 'name' => 'multiple_product_shipping_class',
34
+ 'id' => 'multiple_product_shipping_class',
35
+ 'selected' => ( ! empty($post['multiple_product_shipping_class']) ) ? $post['multiple_product_shipping_class'] : '',
36
+ 'class' => 'select short'
37
+ );
38
+
39
+ wp_dropdown_categories( $args );
40
+ ?>
41
+ </span>
42
+ </div>
43
+ </div>
44
+
45
+ <div class="form-field wpallimport-radio-field">
46
+ <input type="radio" id="multiple_product_shipping_class_no" class="switcher" name="is_multiple_product_shipping_class" value="no" <?php echo 'no' == $post['is_multiple_product_shipping_class'] ? 'checked="checked"': '' ?>/>
47
+ <label for="multiple_product_shipping_class_no" style="width: 350px;"><?php _e('Set product shipping class with XPath', 'pmxi_plugin' )?></label>
48
+ <span class="wpallimport-clear"></span>
49
+ <div class="switcher-target-multiple_product_shipping_class_no set_with_xpath">
50
+ <span class="wpallimport-slide-content" style="padding-left:0;">
51
+ <input type="text" class="smaller-text" name="single_product_shipping_class" style="width:300px;" value="<?php echo esc_attr($post['single_product_shipping_class']) ?>"/>
52
+ <a href="#help" class="wpallimport-help" title="<?php _e('Value should be the slug for the shipping class - \'taxable\', \'shipping\' and \'none\' are the default slugs.', 'pmxi_plugin') ?>">?</a>
53
+ </span>
54
+ </div>
55
+ </div>
56
+
57
+ </div> <!-- End options group -->
58
+ </div> <!-- End Product Panel -->
views/admin/import/_tabs/_variations.php ADDED
@@ -0,0 +1,691 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel woocommerce_options_panel" id="variable_product_options" style="display:none;">
2
+ <div class="woo-add-on-free-edition-notice upgrade_template">
3
+ <a href="http://www.wpallimport.com/upgrade-to-pro/?utm_source=free-plugin&utm_medium=in-plugin&utm_campaign=woocommerce" target="_blank" class="upgrade_link"><?php _e('Upgrade to the professional edition of WP All Import and the WooCommerce add-on to import to Variable, Affiliate, and Grouped products.', 'pmxi_plugin');?></a>
4
+ </div>
5
+ <div class="options_group" style="padding-bottom:0px;">
6
+
7
+ <p class="form-field wpallimport-radio-field">
8
+ <input type="radio" id="auto_matching_parent" class="switcher" name="matching_parent" value="auto" <?php echo 'auto' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
9
+ <label for="auto_matching_parent" style="width:95%"><?php _e('All my variable products have SKUs or some other unique identifier. Each variation is linked to its parent with its parent\'s SKU or other unique identifier.', 'pmxi_plugin' )?></label>
10
+ </p>
11
+ <div class="switcher-target-auto_matching_parent" style="padding-left:25px;">
12
+ <p class="form-field">
13
+ <label style="width:195px; padding-top:3px;"><?php _e("SKU element for parent", "pmxi_plugin"); ?></label>
14
+ <input type="text" class="short" placeholder="" name="single_product_id" value="<?php echo esc_attr($post['single_product_id']) ?>"/>
15
+ <a href="#help" class="wpallimport-help" title="<?php _e('SKU column in the below example.', 'pmxi_plugin') ?>" style="position:relative;">?</a>
16
+ </p>
17
+ <p class="form-field">
18
+ <label style="width:195px; padding-top:3px;"><?php _e("Parent SKU element for variation", "pmxi_plugin"); ?></label>
19
+ <input type="text" class="short" placeholder="" name="single_product_parent_id" value="<?php echo esc_attr($post['single_product_parent_id']) ?>"/>
20
+ <a href="#help" class="wpallimport-help" title="<?php _e('Parent SKU column in the below example.', 'pmxi_plugin') ?>" style="position:relative;">?</a>
21
+ </p>
22
+ <p class="form-field">
23
+ <strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-1.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a>
24
+ <span class="wpallimport-clear"></span>
25
+ <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-1.png"/>
26
+ </p>
27
+ </div>
28
+
29
+ <div class="wpallimport-clear" style="margin-top:5px;"></div>
30
+
31
+ <p class="form-field wpallimport-radio-field">
32
+ <input type="radio" id="auto_matching_parent_first_is_parent_id" class="switcher" name="matching_parent" value="first_is_parent_id" <?php echo 'first_is_parent_id' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
33
+ <label for="auto_matching_parent_first_is_parent_id" style="width:95%"><?php _e('All products with variations are grouped with a unique identifier that is the same for each variation and unique for each product.', 'pmxi_plugin' )?></label>
34
+ </p>
35
+
36
+ <div class="switcher-target-auto_matching_parent_first_is_parent_id" style="padding-left:25px;">
37
+ <p class="form-field">
38
+ <label style="width:105px; padding-top: 3px;"><?php _e("Unique Identifier", "pmxi_plugin"); ?></label>
39
+ <input type="text" class="short" placeholder="" name="single_product_id_first_is_parent_id" value="<?php echo esc_attr($post['single_product_id_first_is_parent_id']) ?>"/>
40
+ <a href="#help" class="wpallimport-help" title="<?php _e('Group ID column in the below example.', 'pmxi_plugin') ?>" style="position:relative;">?</a>
41
+ </p>
42
+ <p class="form-field">
43
+ <strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-2.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a>
44
+ <span class="wpallimport-clear"></span>
45
+ <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-2.png"/>
46
+ </p>
47
+ </div>
48
+
49
+ <div class="wpallimport-clear" style="margin-top:5px;"></div>
50
+
51
+ <p class="form-field wpallimport-radio-field">
52
+ <input type="radio" id="auto_matching_parent_first_is_parent_title" class="switcher" name="matching_parent" value="first_is_parent_title" <?php echo 'first_is_parent_title' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
53
+ <label for="auto_matching_parent_first_is_parent_title" style="width:95%"><?php _e('All variations for a particular product have the same title as the parent product.', 'pmxi_plugin' )?></label>
54
+ </p>
55
+
56
+ <div class="switcher-target-auto_matching_parent_first_is_parent_title" style="padding-left:25px;">
57
+ <p class="form-field">
58
+ <label style="width:85px; padding-top: 3px;"><?php _e("Product Title", "pmxi_plugin"); ?></label>
59
+ <input type="text" class="short" placeholder="" name="single_product_id_first_is_parent_title" value="<?php echo ($post['single_product_id_first_is_parent_title']) ? esc_attr($post['single_product_id_first_is_parent_title']) : ((!empty(PMXI_Plugin::$session->options['title'])) ? esc_attr(PMXI_Plugin::$session->options['title']) : ''); ?>"/>
60
+ </p>
61
+ <p class="form-field">
62
+ <strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-3.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a>
63
+ <span class="wpallimport-clear"></span>
64
+ <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-3.png"/>
65
+ </p>
66
+ </div>
67
+
68
+ <div class="wpallimport-clear" style="margin-top:5px;"></div>
69
+
70
+ <p class="form-field wpallimport-radio-field">
71
+ <input type="radio" id="auto_matching_parent_first_is_variation" class="switcher" name="matching_parent" value="first_is_variation" <?php echo 'first_is_variation' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
72
+ <label for="auto_matching_parent_first_is_variation" style="width:95%"><?php _e('All variations for a particular product have the same title. There are no parent products.', 'pmxi_plugin' )?></label>
73
+ </p>
74
+ <div class="switcher-target-auto_matching_parent_first_is_variation" style="padding-left:25px;">
75
+ <p class="form-field">
76
+ <label style="width:85px; padding-top: 3px;"><?php _e("Product Title"); ?></label>
77
+ <input type="text" class="short" placeholder="" name="single_product_id_first_is_variation" value="<?php echo ($post['single_product_id_first_is_variation']) ? esc_attr($post['single_product_id_first_is_variation']) : ((!empty(PMXI_Plugin::$session->options['title'])) ? esc_attr(PMXI_Plugin::$session->options['title']) : ''); ?>"/>
78
+ </p>
79
+ <p class="form-field">
80
+ <strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-4.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a>
81
+ <span class="wpallimport-clear"></span>
82
+ <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-4.png"/>
83
+ </p>
84
+ </div>
85
+
86
+ <div class="wpallimport-clear" style="margin-top:5px;"></div>
87
+
88
+ <p class="form-field wpallimport-radio-field">
89
+ <input type="radio" id="xml_matching_parent" class="switcher" name="matching_parent" value="xml" <?php echo 'xml' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
90
+ <label for="xml_matching_parent" style="width:350px;"><?php _e('I\'m importing XML and my variations are child XML elements', 'pmxi_plugin' )?> </label>
91
+ </p>
92
+
93
+ <div class="switcher-target-xml_matching_parent" style="padding-left:25px; position:relative;">
94
+
95
+ <div class="input">
96
+
97
+ <p class="form-field"><a href="http://youtu.be/F1NX4po0dsc" target="_blank"><?php _e("Video Example", "pmxi_plugin");?></a></p>
98
+
99
+ <p class="form-field">
100
+ <label style="width:150px;"><?php _e("Variations XPath", "pmxi_plugin"); ?></label>
101
+ <input type="text" class="short" placeholder="" id="variations_xpath" name="variations_xpath" value="<?php echo esc_attr($post['variations_xpath']) ?>" style="width:370px !important;"/> <a href="javascript:void(0);" id="toggle_xml_tree"><?php _e("Open XML Tree","pmxi_plugin"); ?></a>
102
+ <div class="wpallimport-clear"></div>
103
+ <span id="variations_console"></span>
104
+ </p>
105
+
106
+ <div style="margin-right:2%;">
107
+
108
+ <div class="options_group">
109
+ <p class="form-field wpallimport-radio-field">
110
+ <label style="border-right:none;" for="_variable_virtual"><?php _e('Virtual', 'woocommerce');?> </label>
111
+ <input type="checkbox" name="_variable_virtual" id="_variable_virtual" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['_variable_virtual']) ? 'checked="checked"' : ''; ?>>
112
+ </p>
113
+ <p class="form-field wpallimport-radio-field">
114
+ <label for="_variable_downloadable" class="show_if_simple"><?php _e('Downloadable','woocommerce');?></label>
115
+ <input type="checkbox" name="_variable_downloadable" id="_variable_downloadable" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['_variable_downloadable']) ? 'checked="checked"' : ''; ?>>
116
+ </p>
117
+ </div>
118
+
119
+ <div class="options_group">
120
+ <p class="form-field">
121
+ <label style="width:150px;"><?php _e('SKU','woocommerce');?></label>
122
+ <input type="text" value="<?php echo esc_attr($post['variable_sku']) ?>" style="" name="variable_sku" class="short">
123
+ <span class="use_parent">
124
+ <input type="hidden" name="variable_sku_add_parent" value="0"/>
125
+ <input type="checkbox" name="variable_sku_add_parent" id="variable_sku_add_parent" style="margin-left:5px; margin-right:5px;" <?php echo ($post['variable_sku_add_parent']) ? 'checked="checked"' : ''; ?>>
126
+ <label style="width: 160px;" for="variable_sku_add_parent"><?php _e("Add value to the parent SKU","pmxi_plugin"); ?></label>
127
+ <a href="#help" class="wpallimport-help" title="<?php _e('Enable this checkbox to combine SKU from parent and variation products.', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
128
+ </span>
129
+ </p>
130
+ <p class="form-field">
131
+ <label style="width:150px;"><?php _e('Image','woocommerce');?></label>
132
+ <input type="text" value="<?php echo esc_attr($post['variable_image']) ?>" style="" name="variable_image" class="short">
133
+ <span class="use_parent">
134
+ <input type="hidden" name="variable_image_use_parent" value="0"/>
135
+ <input type="checkbox" name="variable_image_use_parent" id="variable_image_use_parent" style="position:relative; top:1px; margin-left:5px; margin-right:5px;" <?php echo ($post['variable_image_use_parent']) ? 'checked="checked"' : ''; ?>>
136
+ <label for="variable_image_use_parent" style="top:0px;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
137
+ </span>
138
+ </p>
139
+ </div>
140
+
141
+ <div class="options_group">
142
+ <p class="form-field wpallimport-radio-field">
143
+ <label><?php _e("Manage stock?"); ?></label>
144
+ </p>
145
+ <p class="form-field wpallimport-radio-field">
146
+ <input type="radio" id="is_variable_product_manage_stock_yes" class="switcher" name="is_variable_product_manage_stock" value="yes" <?php echo 'yes' == $post['is_variable_product_manage_stock'] ? 'checked="checked"': '' ?>/>
147
+ <label for="is_variable_product_manage_stock_yes"><?php _e("Yes"); ?></label>
148
+ </p>
149
+ <p class="form-field wpallimport-radio-field">
150
+ <input type="radio" id="is_variable_product_manage_stock_no" class="switcher" name="is_variable_product_manage_stock" value="no" <?php echo 'no' == $post['is_variable_product_manage_stock'] ? 'checked="checked"': '' ?>/>
151
+ <label for="is_variable_product_manage_stock_no"><?php _e("No"); ?></label>
152
+ </p>
153
+ <div class="form-field wpallimport-radio-field">
154
+ <input type="radio" id="is_variable_product_manage_stock_xpath" class="switcher" name="is_variable_product_manage_stock" value="xpath" <?php echo 'xpath' == $post['is_variable_product_manage_stock'] ? 'checked="checked"': '' ?>/>
155
+ <label for="is_variable_product_manage_stock_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
156
+ <span class="wpallimport-clear"></span>
157
+ <div class="switcher-target-is_variable_product_manage_stock_xpath set_with_xpath" style="width:390px;">
158
+ <span class="wpallimport-slide-content" style="padding-left:0;">
159
+ <input type="text" class="smaller-text" name="single_variable_product_manage_stock" style="width:345px;" value="<?php echo esc_attr($post['single_variable_product_manage_stock']) ?>"/>
160
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
161
+ <span class="use_parent" style="float:right; top: 2px;">
162
+ <input type="hidden" name="single_variable_product_manage_stock_use_parent" value="0"/>
163
+ <input type="checkbox" name="single_variable_product_manage_stock_use_parent" id="single_variable_product_manage_stock_use_parent" style="position:relative; top:1px; margin-right:5px; float: left;" <?php echo ($post['single_variable_product_manage_stock_use_parent']) ? 'checked="checked"' : ''; ?>>
164
+ <label for="single_variable_product_manage_stock_use_parent" style="top:3px;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
165
+ </span>
166
+ </span>
167
+ </div>
168
+ </div>
169
+ </div>
170
+
171
+ <div class="options_group variable_stock_fields">
172
+ <p class="form-field">
173
+ <label style="width:150px;"><?php _e('Stock Qty', 'woocommerce');?></label>
174
+ <input type="text" value="<?php echo esc_attr($post['variable_stock']) ?>" style="" name="variable_stock" class="short">
175
+ <span class="use_parent">
176
+ <input type="hidden" name="variable_stock_use_parent" value="0"/>
177
+ <input type="checkbox" name="variable_stock_use_parent" id="variable_stock_use_parent" style="margin-left:5px; margin-right: 5px;" <?php echo ($post['variable_stock_use_parent']) ? 'checked="checked"' : ''; ?>>
178
+ <label for="variable_stock_use_parent" style="width:120px;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
179
+ <a href="#help" class="wpallimport-help" title="<?php _e('Enable this checkbox to determine XPath from parent element.', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
180
+ </span>
181
+ </p>
182
+ </div>
183
+
184
+ <div class="options_group">
185
+ <p class="form-field wpallimport-radio-field">
186
+ <label><?php _e("Stock status"); ?></label>
187
+ </p>
188
+ <p class="form-field wpallimport-radio-field">
189
+ <input type="radio" id="variable_stock_status_in_stock" class="switcher" name="variable_stock_status" value="instock" <?php echo 'instock' == $post['variable_stock_status'] ? 'checked="checked"': '' ?>/>
190
+ <label for="variable_stock_status_in_stock"><?php _e("In stock"); ?></label>
191
+ </p>
192
+ <p class="form-field wpallimport-radio-field">
193
+ <input type="radio" id="variable_stock_status_out_of_stock" class="switcher" name="variable_stock_status" value="outofstock" <?php echo 'outofstock' == $post['variable_stock_status'] ? 'checked="checked"': '' ?>/>
194
+ <label for="variable_stock_status_out_of_stock"><?php _e("Out of stock"); ?></label>
195
+ </p>
196
+ <p class="form-field wpallimport-radio-field">
197
+ <input type="radio" id="variable_stock_status_auto" class="switcher" name="variable_stock_status" value="auto" <?php echo 'auto' == $post['variable_stock_status'] ? 'checked="checked"': '' ?>/>
198
+ <label for="variable_stock_status_auto" style="width:100px;"><?php _e("Set automatically"); ?></label>
199
+ <a href="#help" class="wpallimport-help" title="<?php _e('Set the stock status to In Stock for positive or blank Stock Qty values, and Out Of Stock if Stock Qty is 0.', 'pmxi_plugin') ?>" style="position:relative; top:3px;">?</a>
200
+ </p>
201
+ <div class="form-field wpallimport-radio-field">
202
+ <input type="radio" id="variable_stock_status_xpath" class="switcher" name="variable_stock_status" value="xpath" <?php echo 'xpath' == $post['variable_stock_status'] ? 'checked="checked"': '' ?>/>
203
+ <label for="variable_stock_status_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
204
+ <span class="wpallimport-clear"></span>
205
+ <div class="switcher-target-variable_stock_status_xpath set_with_xpath" style="width:390px;">
206
+ <span class="wpallimport-slide-content" style="padding-left:0;">
207
+ <input type="text" class="smaller-text" name="single_variable_stock_status" style="width:345px;" value="<?php echo esc_attr($post['single_variable_stock_status']) ?>"/>
208
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'instock\', \'outofstock\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
209
+ </span>
210
+ </div>
211
+ </div>
212
+ </div>
213
+
214
+ <div class="options_group">
215
+ <p class="form-field">
216
+ <label style="width:150px;"><?php _e('Regular Price','woocommerce');?> (<?php echo get_woocommerce_currency_symbol(); ?>)</label>
217
+ <input type="text" value="<?php echo esc_attr($post['variable_regular_price']) ?>" style="" name="variable_regular_price" class="short">
218
+ <span class="use_parent">
219
+ <input type="hidden" name="variable_regular_price_use_parent" value="0"/>
220
+ <input type="checkbox" name="variable_regular_price_use_parent" id="variable_regular_price_use_parent" style="position:relative; top:1px; margin-left:5px; margin-right:5px;" <?php echo ($post['variable_regular_price_use_parent']) ? 'checked="checked"' : ''; ?>>
221
+ <label for="variable_regular_price_use_parent" style="top:1px; position: relative;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
222
+ </span>
223
+ </p>
224
+ <p class="form-field">
225
+ <label style="width:150px;"><?php _e('Sale Price','woocommerce');?> (<?php echo get_woocommerce_currency_symbol(); ?>)</label>&nbsp;
226
+ <a id="variable_sale_price_shedule" href="javascript:void(0);" style="<?php if ($post['is_variable_sale_price_shedule']):?>display:none;<?php endif; ?>position:relative; top:-10px;"><?php _e('schedule');?></a>
227
+ <input type="text" value="<?php echo esc_attr($post['variable_sale_price']) ?>" style="" name="variable_sale_price" class="short">
228
+ <input type="hidden" name="is_variable_sale_price_shedule" value="<?php echo esc_attr($post['is_variable_sale_price_shedule']) ?>"/>
229
+ <span class="use_parent">
230
+ <input type="hidden" name="variable_sale_price_use_parent" value="0"/>
231
+ <input type="checkbox" name="variable_sale_price_use_parent" id="variable_sale_price_use_parent" style="position:relative; top:1px; margin-right:5px;" <?php echo ($post['variable_sale_price_use_parent']) ? 'checked="checked"' : ''; ?>>
232
+ <label for="variable_sale_price_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
233
+ </span>
234
+ </p>
235
+ <?php if ( class_exists('woocommerce_wholesale_pricing') ):?>
236
+ <p class="form-field">
237
+ <label style="width:150px;"><?php _e("Wholesale Price (".get_woocommerce_currency_symbol().")"); ?></label>
238
+ <input type="text" class="short" name="variable_whosale_price" value="<?php echo esc_attr($post['variable_whosale_price']) ?>"/>
239
+ <span class="use_parent">
240
+ <input type="hidden" name="variable_whosale_price_use_parent" value="0"/>
241
+ <input type="checkbox" name="variable_whosale_price_use_parent" id="variable_whosale_price_use_parent" style="position:relative; top:1px; margin-left:5px; margin-right:5px;" <?php echo ($post['variable_whosale_price_use_parent']) ? 'checked="checked"' : ''; ?>>
242
+ <label for="variable_whosale_price_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
243
+ </span>
244
+ </p>
245
+ <?php endif; ?>
246
+ </div>
247
+
248
+ <div class="options_group" <?php if ( ! $post['is_variable_sale_price_shedule']):?>style="display:none;"<?php endif; ?> id="variable_sale_price_range">
249
+ <p class="form-field">
250
+ <span style="vertical-align:middle">
251
+ <label style="width:150px;"><?php _e("Variable Sale Price Dates", "woocommerce"); ?></label>
252
+ <span class="use_parent">
253
+ <input type="hidden" name="variable_sale_dates_use_parent" value="0"/>
254
+ <input type="checkbox" name="variable_sale_dates_use_parent" id="variable_sale_dates_use_parent" style="position:relative; top:1px; margin-left:5px; margin-right:5px;" <?php echo ($post['variable_sale_dates_use_parent']) ? 'checked="checked"' : ''; ?>>
255
+ <label for="variable_sale_dates_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
256
+ </span>
257
+ <br>
258
+ <input type="text" class="datepicker" name="variable_sale_price_dates_from" value="<?php echo esc_attr($post['variable_sale_price_dates_from']) ?>" style="float:none;"/>
259
+ <?php _e('and', 'pmxi_plugin') ?>
260
+ <input type="text" class="datepicker" name="variable_sale_price_dates_to" value="<?php echo esc_attr($post['variable_sale_price_dates_to']) ?>" style="float:none;"/>
261
+ &nbsp;<a id="cancel_variable_regular_price_shedule" href="javascript:void(0);"><?php _e('cancel');?></a>
262
+ </span>
263
+ </p>
264
+ </div>
265
+
266
+ <div class="options_group" <?php echo ( ! $post['_variable_virtual']) ? 'style="display:none;"' : ''; ?> id="variable_virtual">
267
+
268
+ <p class="form-field wpallimport-radio-field">
269
+ <input type="radio" id="is_variable_product_virtual_yes" class="switcher" name="is_variable_product_virtual" value="yes" <?php echo 'yes' == $post['is_variable_product_virtual'] ? 'checked="checked"': '' ?>/>
270
+ <label for="is_variable_product_virtual_yes"><?php _e("Virtual"); ?></label>
271
+ </p>
272
+ <p class="form-field wpallimport-radio-field">
273
+ <input type="radio" id="is_variable_product_virtual_no" class="switcher" name="is_variable_product_virtual" value="no" <?php echo 'no' == $post['is_variable_product_virtual'] ? 'checked="checked"': '' ?>/>
274
+ <label for="is_variable_product_virtual_no"><?php _e("Not Virtual"); ?></label>
275
+ </p>
276
+ <div class="form-field wpallimport-radio-field">
277
+ <input type="radio" id="is_variable_product_virtual_xpath" class="switcher" name="is_variable_product_virtual" value="xpath" <?php echo 'xpath' == $post['is_variable_product_virtual'] ? 'checked="checked"': '' ?>/>
278
+ <label for="is_variable_product_virtual_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
279
+ <span class="wpallimport-clear"></span>
280
+ <div class="switcher-target-is_variable_product_virtual_xpath set_with_xpath" style="width:390px;">
281
+ <span class="wpallimport-slide-content" style="padding-left:0;">
282
+ <input type="text" class="smaller-text" name="single_variable_product_virtual" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_virtual']) ?>"/>
283
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
284
+ <span class="use_parent" style="float:right; top: 2px;">
285
+ <input type="hidden" name="single_variable_product_virtual_use_parent" value="0"/>
286
+ <input type="checkbox" name="single_variable_product_virtual_use_parent" id="single_variable_product_virtual_use_parent" style="position:relative; top:1px; margin-right:5px; float: left;" <?php echo ($post['single_variable_product_virtual_use_parent']) ? 'checked="checked"' : ''; ?>>
287
+ <label for="single_variable_product_virtual_use_parent" style="top:3px;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
288
+ </span>
289
+ </span>
290
+ </div>
291
+ </div>
292
+ </div>
293
+
294
+ <div class="options_group" <?php echo ($post['_variable_virtual']) ? 'style="display:none;"' : ''; ?> id="variable_dimensions">
295
+ <p class="form-field">
296
+ <label style="width:150px;"><?php _e('Weight','woocommerce');?></label>
297
+ <input type="text" placeholder="0.00" value="<?php echo esc_attr($post['variable_weight']) ?>" style="" name="variable_weight" class="short">
298
+ <span class="use_parent">
299
+ <input type="hidden" name="variable_weight_use_parent" value="0"/>
300
+ <input type="checkbox" name="variable_weight_use_parent" id="variable_weight_use_parent" style="position:relative; top:1px; margin-left:5px; margin-right:5px;" <?php echo ($post['variable_weight_use_parent']) ? 'checked="checked"' : ''; ?>>
301
+ <label for="variable_weight_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
302
+ </span>
303
+ </p>
304
+ <p class="form-field">
305
+ <label for"product_length"=""><?php _e('Dimensions (L×W×H)','woocommerce');?></label>
306
+ <span class="use_parent">
307
+ <input type="hidden" name="variable_dimensions_use_parent" value="0"/>
308
+ <input type="checkbox" name="variable_dimensions_use_parent" id="variable_dimensions_use_parent" style="position:relative; top:1px; margin-left:5px; margin-right:5px;" <?php echo ($post['variable_dimensions_use_parent']) ? 'checked="checked"' : ''; ?>>
309
+ <label for="variable_dimensions_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
310
+ </span>
311
+ <br>
312
+ <input type="text" placeholder="0" value="<?php echo esc_attr($post['variable_length']) ?>" name="variable_length" class="short" style="margin-right:5px;">
313
+ <input type="text" placeholder="0" value="<?php echo esc_attr($post['variable_width']) ?>" name="variable_width" class="short" style="margin-right:5px;">
314
+ <input type="text" placeholder="0" value="<?php echo esc_attr($post['variable_height']) ?>" style="" name="variable_height" class="short">
315
+ </p>
316
+ </div>
317
+
318
+ <div class="options_group">
319
+
320
+ <!-- Shipping class -->
321
+ <div class="form-field wpallimport-radio-field">
322
+ <input type="radio" id="multiple_variable_product_shipping_class_yes" class="switcher" name="is_multiple_variable_product_shipping_class" value="yes" <?php echo 'no' != $post['is_multiple_variable_product_shipping_class'] ? 'checked="checked"': '' ?>/>
323
+ <label for="multiple_variable_product_shipping_class_yes" style="width:150px;"><?php _e("Shipping Class"); ?></label>
324
+ <span class="wpallimport-clear"></span>
325
+ <div class="switcher-target-multiple_variable_product_shipping_class_yes set_with_xpath">
326
+ <span class="wpallimport-slide-content" style="padding-left:0;">
327
+ <?php
328
+ $classes = get_the_terms( 0, 'product_shipping_class' );
329
+ if ( $classes && ! is_wp_error( $classes ) ) $current_shipping_class = current($classes)->term_id; else $current_shipping_class = '';
330
+
331
+ $args = array(
332
+ 'taxonomy' => 'product_shipping_class',
333
+ 'hide_empty' => 0,
334
+ 'show_option_none' => __( 'No shipping class', 'woocommerce' ),
335
+ 'name' => 'multiple_variable_product_shipping_class',
336
+ 'id' => 'multiple_variable_product_shipping_class',
337
+ 'selected' => (!empty($post['multiple_variable_product_shipping_class'])) ? $post['multiple_variable_product_shipping_class'] : $current_shipping_class,
338
+ 'class' => 'select short'
339
+ );
340
+
341
+ wp_dropdown_categories( $args );
342
+ ?>
343
+ </span>
344
+ </div>
345
+ </div>
346
+ <!-- Shipping class -->
347
+ <div class="form-field wpallimport-radio-field">
348
+ <input type="radio" id="multiple_variable_product_shipping_class_no" class="switcher" name="is_multiple_variable_product_shipping_class" value="no" <?php echo 'no' == $post['is_multiple_variable_product_shipping_class'] ? 'checked="checked"': '' ?>/>
349
+ <label for="multiple_variable_product_shipping_class_no" style="width:300px;"><?php _e('Set product shipping class with XPath', 'pmxi_plugin' )?></label>
350
+ <span class="wpallimport-clear"></span>
351
+ <div class="switcher-target-multiple_variable_product_shipping_class_no set_with_xpath">
352
+ <span class="wpallimport-slide-content" style="padding-left:0;">
353
+ <input type="text" class="smaller-text" name="single_variable_product_shipping_class" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_shipping_class']) ?>"/>
354
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'taxable\', \'shipping\', \'none\').', 'pmxi_plugin') ?>" style="position: relative; top: -10px;">?</a>
355
+ <span class="use_parent">
356
+ <input type="hidden" name="single_variable_product_shipping_class_use_parent" value="0"/>
357
+ <input type="checkbox" name="single_variable_product_shipping_class_use_parent" id="single_variable_product_shipping_class_use_parent" style="position:relative; top:2px; margin-left:5px; margin-right:5px;" <?php echo ($post['single_variable_product_shipping_class_use_parent']) ? 'checked="checked"' : ''; ?>>
358
+ <label for="single_variable_product_shipping_class_use_parent" style="top:2px; position: relative;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
359
+ </span>
360
+ </span>
361
+ </div>
362
+ </div>
363
+ </div>
364
+
365
+ <div class="options_group">
366
+ <!-- Tax class -->
367
+ <div class="form-field wpallimport-radio-field">
368
+ <input type="radio" id="multiple_variable_product_tax_class_yes" class="switcher" name="is_multiple_variable_product_tax_class" value="yes" <?php echo 'no' != $post['is_multiple_variable_product_tax_class'] ? 'checked="checked"': '' ?>/>
369
+ <label for="multiple_variable_product_tax_class_yes" style="width:150px;"><?php _e("Tax Class", "woocommerce"); ?></label>
370
+ <span class="wpallimport-clear"></span>
371
+ <div class="switcher-target-multiple_variable_product_tax_class_yes set_with_xpath">
372
+ <span class="wpallimport-slide-content" style="padding-left:0;">
373
+ <?php
374
+ $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
375
+ $classes_options = array();
376
+ $classes_options[''] = __( 'Standard', 'woocommerce' );
377
+ if ( $tax_classes )
378
+ foreach ( $tax_classes as $class )
379
+ $classes_options[ sanitize_title( $class ) ] = esc_html( $class );
380
+ ?>
381
+ <select class="select short" name="multiple_variable_product_tax_class">
382
+ <option value="parent" <?php echo 'parent' == $post['multiple_variable_product_tax_class'] ? 'selected="selected"': '' ?>><?php _e('Same as parent', 'woocommerce');?></option>
383
+ <?php foreach ($classes_options as $key => $value):?>
384
+ <option value="<?php echo $key; ?>" <?php echo $key == $post['multiple_variable_product_tax_class'] ? 'selected="selected"': '' ?>><?php echo $value; ?></option>
385
+ <?php endforeach; ?>
386
+ </select>
387
+ </span>
388
+ </div>
389
+ </div>
390
+ <!-- Tax class -->
391
+ <div class="form-field wpallimport-radio-field">
392
+ <input type="radio" id="multiple_variable_product_tax_class_no" class="switcher" name="is_multiple_variable_product_tax_class" value="no" <?php echo 'no' == $post['is_multiple_variable_product_tax_class'] ? 'checked="checked"': '' ?>/>
393
+ <label for="multiple_variable_product_tax_class_no" style="width: 300px;"><?php _e('Set product tax class with XPath', 'pmxi_plugin' )?></label>
394
+ <span class="wpallimport-clear"></span>
395
+ <div class="switcher-target-multiple_variable_product_tax_class_no set_with_xpath">
396
+ <span class="wpallimport-slide-content" style="padding-left:0;">
397
+ <input type="text" class="smaller-text" name="single_variable_product_tax_class" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_tax_class']) ?>"/>
398
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'reduced-rate\', \'zero-rate\').', 'pmxi_plugin') ?>" style="position: relative; top:-10px;">?</a>
399
+ <span class="use_parent">
400
+ <input type="hidden" name="single_variable_product_tax_class_use_parent" value="0"/>
401
+ <input type="checkbox" name="single_variable_product_tax_class_use_parent" id="single_variable_product_tax_class_use_parent" style="position:relative; top:2px; margin-left:5px; margin-right:5px;" <?php echo ($post['single_variable_product_tax_class_use_parent']) ? 'checked="checked"' : ''; ?>>
402
+ <label for="single_variable_product_tax_class_use_parent" style="top:1px; position: relative;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
403
+ </span>
404
+ </span>
405
+ </div>
406
+ </div>
407
+
408
+ </div>
409
+
410
+ <!-- Downloadable -->
411
+ <div class="options_group variable_downloadable" <?php echo ( ! $post['_variable_downloadable']) ? 'style="display:none;"' : ''; ?>>
412
+ <p class="form-field wpallimport-radio-field">
413
+ <input type="radio" id="is_variable_product_downloadable_yes" class="switcher" name="is_variable_product_downloadable" value="yes" <?php echo 'yes' == $post['is_variable_product_downloadable'] ? 'checked="checked"': '' ?>/>
414
+ <label for="is_variable_product_downloadable_yes"><?php _e("Downloadable"); ?></label>
415
+ </p>
416
+ <p class="form-field wpallimport-radio-field">
417
+ <input type="radio" id="is_variable_product_downloadable_no" class="switcher" name="is_variable_product_downloadable" value="no" <?php echo 'no' == $post['is_variable_product_downloadable'] ? 'checked="checked"': '' ?>/>
418
+ <label for="is_variable_product_downloadable_no"><?php _e("Not Downloadable"); ?></label>
419
+ </p>
420
+ <div class="form-field wpallimport-radio-field">
421
+ <input type="radio" id="is_variable_product_downloadable_xpath" class="switcher" name="is_variable_product_downloadable" value="xpath" <?php echo 'xpath' == $post['is_variable_product_downloadable'] ? 'checked="checked"': '' ?>/>
422
+ <label for="is_variable_product_downloadable_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
423
+ <span class="wpallimport-clear"></span>
424
+ <div class="switcher-target-is_variable_product_downloadable_xpath set_with_xpath" style="width:390px;">
425
+ <span class="wpallimport-slide-content" style="padding-left:0;">
426
+ <input type="text" class="smaller-text" name="single_variable_product_downloadable" style="width:345px;" value="<?php echo esc_attr($post['single_variable_product_downloadable']) ?>"/>
427
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
428
+ <span class="use_parent" style="float:right; top: 2px;">
429
+ <input type="hidden" name="single_variable_product_downloadable_use_parent" value="0"/>
430
+ <input type="checkbox" name="single_variable_product_downloadable_use_parent" id="single_variable_product_downloadable_use_parent" style="position:relative; top:1px; margin-right:5px; float: left;" <?php echo ($post['single_variable_product_downloadable_use_parent']) ? 'checked="checked"' : ''; ?>>
431
+ <label for="single_variable_product_downloadable_use_parent" style="top:3px;"><?php _e("XPath Is From Parent","pmxi_plugin"); ?></label>
432
+ </span>
433
+ </span>
434
+ </div>
435
+ </div>
436
+ </div>
437
+
438
+ <div class="options_group variable_downloadable" <?php echo ( ! $post['_variable_downloadable']) ? 'style="display:none;"' : ''; ?>>
439
+ <p class="form-field">
440
+ <label style="width:150px;"><?php _e('File paths','woocommerce');?></label>
441
+ <input type="text" value="<?php echo esc_attr($post['variable_file_paths']) ?>" name="variable_file_paths" class="short" style="width:60% !important;">
442
+ <input type="text" class="small" name="variable_product_files_delim" value="<?php echo esc_attr($post['variable_product_files_delim']) ?>" style="width:5% !important;text-align:center; margin-left:5px;"/>
443
+ <a href="#help" class="wpallimport-help" title="<?php _e('File paths/URLs, comma separated. The delimiter option uses when xml element contains few paths/URLs (http://files.com/1.doc, http://files.com/2.doc).', 'pmxi_plugin') ?>">?</a>
444
+ </p>
445
+ <p class="form-field">
446
+ <label style="width:150px;"><?php _e("File names"); ?></label>
447
+ <input type="text" class="short" name="variable_file_names" value="<?php echo esc_attr($post['variable_file_names']) ?>" style="width:60% !important;"/>
448
+ <input type="text" class="small" name="variable_product_files_names_delim" value="<?php echo esc_attr($post['variable_product_files_names_delim']) ?>" style="width:5% !important;text-align:center; margin-left:5px;"/>
449
+ <a href="#help" class="wpallimport-help" title="<?php _e('File names, comma separated. The delimiter is used when an XML element contains multiple names - i.e. <code>1.doc, 2.doc</code>.', 'pmxi_plugin') ?>">?</a>
450
+ </p>
451
+ <p class="form-field">
452
+ <label style="width:150px;"><?php _e('Download Limit','woocommerce');?></label>
453
+ <input type="text" value="<?php echo esc_attr($post['variable_download_limit']) ?>" style="" name="variable_download_limit" class="short">
454
+ <span class="use_parent">
455
+ <input type="hidden" name="variable_download_limit_use_parent" value="0"/>
456
+ <input type="checkbox" name="variable_download_limit_use_parent" id="variable_download_limit_use_parent" style="margin-left:5px; margin-right:5px;" <?php echo ($post['variable_download_limit_use_parent']) ? 'checked="checked"' : ''; ?>>
457
+ <label for="variable_download_limit_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin");?></label>
458
+ </span>
459
+ </p>
460
+ <p class="form-field">
461
+ <label style="width:150px;"><?php _e('Download Expiry','woocommerce');?></label>
462
+ <input type="text" value="<?php echo esc_attr($post['variable_download_expiry']) ?>" style="" name="variable_download_expiry" class="short">
463
+ <span class="use_parent">
464
+ <input type="hidden" name="variable_download_expiry_use_parent" value="0"/>
465
+ <input type="checkbox" name="variable_download_expiry_use_parent" id="variable_download_expiry_use_parent" style="margin-left:5px; margin-right:5px;" <?php echo ($post['variable_download_expiry_use_parent']) ? 'checked="checked"' : ''; ?>>
466
+ <label for="variable_download_expiry_use_parent"><?php _e("XPath Is From Parent","pmxi_plugin");?></label>
467
+ </span>
468
+ </p>
469
+ </div>
470
+
471
+ <div class="options_group">
472
+
473
+ <label style="width:150px; padding-left:0px;"><?php _e('Variation Enabled','pmxi_plugin'); ?></label>
474
+
475
+ <span class="wpallimport-clear"></span>
476
+
477
+ <p class="form-field wpallimport-radio-field">
478
+ <input type="radio" id="variable_product_enabled_yes" class="switcher" name="is_variable_product_enabled" value="yes" <?php echo 'yes' == $post['is_variable_product_enabled'] ? 'checked="checked"': '' ?>/>
479
+ <label for="variable_product_enabled_yes"><?php _e("Yes"); ?></label>
480
+ </p>
481
+ <p class="form-field wpallimport-radio-field">
482
+ <input type="radio" id="variable_product_enabled_no" class="switcher" name="is_variable_product_enabled" value="no" <?php echo 'no' == $post['is_variable_product_enabled'] ? 'checked="checked"': '' ?>/>
483
+ <label for="variable_product_enabled_no"><?php _e("No"); ?></label>
484
+ </p>
485
+ <div class="form-field wpallimport-radio-field">
486
+ <input type="radio" id="variable_product_enabled_xpath" class="switcher" name="is_variable_product_enabled" value="xpath" <?php echo 'xpath' == $post['is_variable_product_enabled'] ? 'checked="checked"': '' ?>/>
487
+ <label for="variable_product_enabled_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
488
+ <span class="wpallimport-clear"></span>
489
+ <div class="switcher-target-variable_product_enabled_xpath set_with_xpath">
490
+ <span class="wpallimport-slide-content" style="padding-left:0;">
491
+ <input type="text" class="smaller-text" name="single_variable_product_enabled" style="width:300px; " value="<?php echo esc_attr($post['single_variable_product_enabled']) ?>"/>
492
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
493
+ </span>
494
+ </div>
495
+ </div>
496
+
497
+ </div>
498
+
499
+ <div class="options_group variation_attributes">
500
+
501
+ <label style="width:150px; padding-left:0px;"><?php _e('Variation Attributes','pmxi_plugin');?></label>
502
+
503
+ <span class="wpallimport-clear"></span>
504
+
505
+ <div class="input">
506
+ <table class="form-table custom-params" style="max-width:95%;">
507
+ <thead>
508
+ <tr>
509
+ <td><?php _e('Name', 'pmxi_plugin') ?></td>
510
+ <td><?php _e('Values', 'pmxi_plugin') ?></td>
511
+ <td></td>
512
+ </tr>
513
+ </thead>
514
+ <tbody>
515
+ <?php if ( ! empty($post['variable_attribute_name'][0])):?>
516
+ <?php foreach ($post['variable_attribute_name'] as $i => $name): if ("" == $name) continue; ?>
517
+ <tr class="form-field">
518
+ <td style="width: 50%;">
519
+ <input type="text" class="widefat" name="variable_attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:95% !important;"/>
520
+ </td>
521
+ <td style="width: 50%;">
522
+ <input type="text" class="widefat" name="variable_attribute_value[]" value="<?php echo esc_attr($post['variable_attribute_value'][$i]); ?>" style="width: 100% !important;"/>
523
+
524
+ <span class="wpallimport-clear"></span>
525
+ <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
526
+ <span class='in_variations' style="margin-left:0px;">
527
+ <input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_<?php echo $i; ?>" <?php echo ($post['variable_in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="float:left;" value="1"/>
528
+ <label for="variable_in_variations_<?php echo $i; ?>"><?php _e('In Variations','pmxi_plugin');?></label>
529
+ </span>
530
+
531
+ <span class='is_visible'>
532
+ <input type="checkbox" name="variable_is_visible[]" id="variable_is_visible_<?php echo $i; ?>" <?php echo ($post['variable_is_visible'][$i]) ? 'checked="checked"' : ''; ?> style="float: left;" value="1"/>
533
+ <label for="variable_is_visible_<?php echo $i; ?>"><?php _e('Is Visible','pmxi_plugin');?></label>
534
+ </span>
535
+
536
+ <span class='is_taxonomy'>
537
+ <input type="checkbox" name="variable_is_taxonomy[]" id="variable_is_taxonomy_<?php echo $i; ?>" <?php echo ($post['variable_is_taxonomy'][$i]) ? 'checked="checked"' : ''; ?> style="float: left;" value="1"/>
538
+ <label for="variable_is_taxonomy_<?php echo $i; ?>"><?php _e('Taxonomy','pmxi_plugin');?></label>
539
+ </span>
540
+
541
+ <span class='is_create_taxonomy'>
542
+ <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" id="variable_create_taxonomy_in_not_exists_<?php echo $i;?>" <?php echo ($post['variable_create_taxonomy_in_not_exists'][$i]) ? 'checked="checked"' : ''; ?> style="float:left;" value="1"/>
543
+ <label for="variable_create_taxonomy_in_not_exists_<?php echo $i; ?>"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
544
+ </span>
545
+ </p>
546
+ </td>
547
+ <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
548
+ </tr>
549
+ <?php endforeach ?>
550
+ <?php else: ?>
551
+ <tr class="form-field">
552
+ <td style="width: 50%;">
553
+ <input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/>
554
+ </td>
555
+ <td style="width: 50%;">
556
+ <input type="text" class="widefat" name="variable_attribute_value[]" value="" style="width: 100% !important;"/>
557
+
558
+ <span class="wpallimport-clear"></span>
559
+ <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
560
+ <span class='in_variations' style="margin-left:0px;">
561
+ <input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_0" checked="checked" style="float: left;" value="1"/>
562
+ <label for="variable_in_variations_0"><?php _e('In Variations','pmxi_plugin');?></label>
563
+ </span>
564
+ <span class='is_visible'>
565
+ <input type="checkbox" name="variable_is_visible[]" id="variable_is_visible_0" checked="checked" style="float:left;" value="1"/>
566
+ <label for="variable_is_visible_0"><?php _e('Is Visible','pmxi_plugin');?></label>
567
+ </span>
568
+ <span class='is_taxonomy'>
569
+ <input type="checkbox" name="variable_is_taxonomy[]" id="variable_is_taxonomy_0" checked="checked" style="float:left;" value="1"/>
570
+ <label for="variable_is_taxonomy_0"><?php _e('Taxonomy','pmxi_plugin');?></label>
571
+ </span>
572
+ <span class='is_create_taxonomy'>
573
+ <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" id="variable_create_taxonomy_in_not_exists_0" checked="checked" style="float:left;" value="1"/>
574
+ <label for="variable_create_taxonomy_in_not_exists_0"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
575
+ </span>
576
+ </p>
577
+ </td>
578
+ <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
579
+ </tr>
580
+ <?php endif;?>
581
+ <tr class="form-field template">
582
+ <td style="width: 50%;">
583
+ <input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/>
584
+ </td>
585
+ <td style="width: 50%;">
586
+ <input type="text" class="widefat" name="variable_attribute_value[]" value="" style="width: 100% !important;"/>
587
+
588
+ <span class="wpallimport-clear"></span>
589
+ <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
590
+ <span class='in_variations' style="margin-left:0px;">
591
+ <input type="checkbox" name="variable_in_variations[]" checked="checked" style="float: left;" value="1"/>
592
+ <label for=""><?php _e('In Variations','pmxi_plugin');?></label>
593
+ </span>
594
+ <span class='is_visible'>
595
+ <input type="checkbox" name="variable_is_visible[]" checked="checked" style="float: left;" value="1"/>
596
+ <label for=""><?php _e('Is Visible','pmxi_plugin');?></label>
597
+ </span>
598
+ <span class='is_taxonomy'>
599
+ <input type="checkbox" name="variable_is_taxonomy[]" checked="checked" style="float: left;" value="1"/>
600
+ <label for=""><?php _e('Taxonomy','pmxi_plugin');?></label>
601
+ </span>
602
+ <span class='is_create_taxonomy'>
603
+ <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" checked="checked" style="float: left;" value="1"/>
604
+ <label for=""><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
605
+ </span>
606
+ </p>
607
+ </td>
608
+ <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
609
+ </tr>
610
+ <tr>
611
+ <td colspan="3"><a href="#add" title="<?php _e('add', 'pmxi_plugin')?>" class="action add-new-custom"><?php _e('Add more', 'pmxi_plugin') ?></a></td>
612
+ </tr>
613
+ </tbody>
614
+ </table>
615
+ </div>
616
+ </div>
617
+ </div>
618
+ <div id="variations_tag" class="options_group show_if_variable">
619
+ <a href="javascript:void(0)" id="close_xml_tree"></a>
620
+ <div class="variations_tree">
621
+ <div id="variations_xml">
622
+ <div class="variations_tag">
623
+ <input type="hidden" name="variations_tagno" value="<?php echo (!empty($tagno)) ? $tagno : 0; ?>" />
624
+ <div class="title">
625
+ <?php printf(__('No matching elements found for XPath expression specified', 'pmxi_plugin'), (!empty($tagno)) ? $tagno : 0, (!empty($variation_list_count)) ? $variation_list_count : 0); ?>
626
+ </div>
627
+ <div class="clear"></div>
628
+ <div class="xml resetable"></div>
629
+ </div>
630
+ </div>
631
+ </div>
632
+ </div>
633
+ </div>
634
+ </div>
635
+
636
+ <div class="clear" style="margin-top:5px;"></div>
637
+
638
+ </div>
639
+
640
+ <div class="options_group">
641
+
642
+ <p class="form-field"><?php _e('Variation Enabled','pmxi_plugin');?><a href="#help" class="wpallimport-help" title="<?php _e('This option is the same as the Enabled checkbox when editing an individual variation in WooCommerce.', 'pmxi_plugin') ?>" style="position:relative; top:0px;">?</a></p>
643
+
644
+ <p class="form-field wpallimport-radio-field">
645
+ <input type="radio" id="product_enabled_yes" class="switcher" name="is_product_enabled" value="yes" <?php echo 'yes' == $post['is_product_enabled'] ? 'checked="checked"': '' ?>/>
646
+ <label for="product_enabled_yes"><?php _e("Yes"); ?></label>
647
+ </p>
648
+ <p class="form-field wpallimport-radio-field">
649
+ <input type="radio" id="product_enabled_no" class="switcher" name="is_product_enabled" value="no" <?php echo 'no' == $post['is_product_enabled'] ? 'checked="checked"': '' ?>/>
650
+ <label for="product_enabled_no"><?php _e("No"); ?></label>
651
+ </p>
652
+ <div class="form-field wpallimport-radio-field">
653
+ <input type="radio" id="product_enabled_xpath" class="switcher" name="is_product_enabled" value="xpath" <?php echo 'xpath' == $post['is_product_enabled'] ? 'checked="checked"': '' ?>/>
654
+ <label for="product_enabled_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label>
655
+ <span class="wpallimport-clear"></span>
656
+ <div class="switcher-target-product_enabled_xpath set_with_xpath">
657
+ <span class="wpallimport-slide-content" style="padding-left:0;">
658
+ <input type="text" class="smaller-text" name="single_product_enabled" style="width:300px;" value="<?php echo esc_attr($post['single_product_enabled']) ?>"/>
659
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
660
+ </span>
661
+ </div>
662
+ </div>
663
+
664
+ <div class="clear"></div>
665
+
666
+ <hr style="margin-top:10px;"/>
667
+
668
+ <p class="form-field wpallimport-radio-field">
669
+ <input type="radio" id="set_default_yes" name="is_default_attributes" value="1" <?php echo $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
670
+ <label for="set_default_yes" style="width: 400px;"><?php _e("Set first variation as the default selection in the attributes dropdowns.", 'pmxi_plugin'); ?></label>
671
+ <a href="#help" class="wpallimport-help" title="<?php _e('The attributes for the first variation will be automatically selected on the frontend.', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
672
+ </p>
673
+ <p class="form-field wpallimport-radio-field">
674
+ <input type="radio" id="set_default_no" name="is_default_attributes" value="0" <?php echo ! $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
675
+ <label for="set_default_no" style="width: 90%;"><?php _e("Do not set default selections for the dropdowns.", "pmxi_plugin"); ?></label>
676
+ </p>
677
+ <p class="form-field wpallimport-radio-field">
678
+ <input type="hidden" name="make_simple_product" value="0" />
679
+ <input type="checkbox" id="make_simple_product" name="make_simple_product" value="1" <?php echo $post['make_simple_product'] ? 'checked="checked"' : '' ?> />
680
+ <label for="make_simple_product" style="width:340px;"><?php _e('Create products with no variations as simple products.', 'pmxi_plugin') ?></label>
681
+ </p>
682
+ <p class="form-field wpallimport-radio-field set_parent_stock_option" style="display:none;">
683
+ <input type="hidden" name="set_parent_stock" value="0" />
684
+ <input type="checkbox" id="set_parent_stock" name="set_parent_stock" value="1" <?php echo $post['set_parent_stock'] ? 'checked="checked"' : '' ?> />
685
+ <label for="set_parent_stock" style="width: 435px;"><?php _e('Set _stock value for parent product to the _stock value for the first variation.', 'pmxi_plugin') ?></label>
686
+ <a href="#help" class="wpallimport-help" title="<?php _e('This option works when there are no parent products in your feed ( cases 2 and 4 on Variations tab).', 'pmxi_plugin') ?>" style="position:relative; top:1px;">?</a>
687
+ </p>
688
+
689
+ </div>
690
+
691
+ </div><!-- End Product Panel -->
views/admin/import/index.php CHANGED
@@ -1,1397 +1,128 @@
1
- <tr>
2
- <td colspan="3">
3
- <div class="postbox " id="woocommerce-product-data">
4
- <h3 class="hndle">
5
- <span>
6
- <div class="main_choise" style="padding:0px; margin-right:0px;">
7
- <input type="radio" id="multiple_product_type_yes" class="switcher" name="is_multiple_product_type" value="yes" <?php echo 'no' != $post['is_multiple_product_type'] ? 'checked="checked"': '' ?>/>
8
- <label for="multiple_product_type_yes"><?php _e('Product Type', 'pmxi_plugin' )?></label>
9
- </div>
10
- <div class="switcher-target-multiple_product_type_yes" style="float:left;">
11
- <div class="input">
12
- <select name="multiple_product_type" id="product-type" style="vertical-align:middle; height:23px; width:220px;">
13
- <optgroup label="Product Type">
14
- <option value="simple" <?php echo 'simple' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('Simple product', 'woocommerce');?></option>
15
- <option value="grouped" <?php echo 'grouped' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('Grouped product','woocommerce');?></option>
16
- <option value="external" <?php echo 'external' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('External/Affiliate product','woocommerce');?></option>
17
- <option value="variable" <?php echo 'variable' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('Variable product','woocommerce');?></option>
18
- </optgroup>
19
- </select>
20
- </div>
21
- </div>
22
- <div class="main_choise" style="padding:0px; margin-left:40px;">
23
- <input type="radio" id="multiple_product_type_no" class="switcher" name="is_multiple_product_type" value="no" <?php echo 'no' == $post['is_multiple_product_type'] ? 'checked="checked"': '' ?> disabled="disabled"/>
24
- <label for="multiple_product_type_no"><?php _e('Set Product Type With XPath', 'pmxi_plugin' )?></label>
25
- </div>
26
- <div class="switcher-target-multiple_product_type_no" style="float:left;">
27
- <div class="input">
28
- <input type="text" class="smaller-text" name="single_product_type" style="width:300px;" value="<?php echo esc_attr($post['single_product_type']) ?>"/>
29
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'simple\', \'grouped\', \'external\', \'variable\').', 'pmxi_plugin') ?>">?</a>
30
- </div>
31
- </div>
32
- <div style="float:right;">
33
- <label class="show_if_simple" for="_virtual" style="border-right:none;">
34
- <input type="hidden" name="_virtual" value="0"/>
35
- <?php _e('Virtual','woocommerce');?>: <input type="checkbox" id="_virtual" name="_virtual" <?php echo ($post['_virtual']) ? 'checked="checked"' : ''; ?>>
36
- </label>
37
- <label class="show_if_simple" for="_downloadable">
38
- <input type="hidden" name="_downloadable" value="0"/>
39
- <?php _e('Downloadable','woocommerce');?>: <input type="checkbox" id="_downloadable" name="_downloadable" <?php echo ($post['_downloadable']) ? 'checked="checked"' : ''; ?>>
40
- </label>
41
- </div>
42
- </span>
43
- </h3>
44
- <div class="clear"></div>
45
- <div class="inside">
46
- <div class="panel-wrap product_data">
47
-
48
- <div class="wc-tabs-back"></div>
49
-
50
- <ul style="" class="product_data_tabs wc-tabs">
51
-
52
- <li class="general_options hide_if_grouped active"><a href="javascript:void(0);" rel="general_product_data"><?php _e('General','woocommerce');?></a></li>
53
-
54
- <li class="inventory_tab show_if_simple show_if_variable show_if_grouped inventory_options" style="display: block;"><a href="javascript:void(0);" rel="inventory_product_data"><?php _e('Inventory', 'woocommerce');?></a></li>
55
-
56
- <li class="shipping_tab hide_if_virtual shipping_options hide_if_grouped hide_if_external"><a href="javascript:void(0);" rel="shipping_product_data"><?php _e('Shipping', 'woocommerce');?></a></li>
57
-
58
- <li class="linked_product_tab linked_product_options"><a href="javascript:void(0);" rel="linked_product_data"><?php _e('Linked Products', 'woocommerce');?></a></li>
59
-
60
- <li class="attributes_tab attribute_options"><a href="javascript:void(0);" rel="woocommerce_attributes"><?php _e('Attributes','woocommerce');?></a></li>
61
-
62
- <li class="advanced_tab advanced_options"><a href="javascript:void(0);" rel="advanced_product_data"><?php _e('Advanced','woocommerce');?></a></li>
63
-
64
- <li class="variations_tab show_if_variable variation_options"><a title="Variations for variable products are defined here." href="javascript:void(0);" rel="variable_product_options"><?php _e('Variations','woocommerce');?></a></li>
65
-
66
- <li class="options_tab advanced_options"><a title="Variations for variable products are defined here." href="javascript:void(0);" rel="add_on_options"><?php _e('Add-On Options', 'pmxi_plugin');?></a></li>
67
-
68
- <?php do_action('pmwi_tab_header'); ?>
69
-
70
- </ul>
71
-
72
- <div class="panel woocommerce_options_panel" id="general_product_data">
73
-
74
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
75
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
76
- </p>
77
-
78
- <div class="options_group hide_if_grouped">
79
- <p class="form-field">
80
- <label><?php _e("SKU"); ?></label>
81
- <input type="text" class="short" name="single_product_sku" style="" value="<?php echo esc_attr($post['single_product_sku']) ?>"/>
82
- <a href="#help" class="help" title="<?php _e('SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce') ?>">?</a>
83
- </p>
84
- </div>
85
- <div class="options_group show_if_external">
86
- <p class="form-field">
87
- <label><?php _e("Product URL"); ?></label>
88
- <input type="text" class="short" name="single_product_url" value="<?php echo esc_attr($post['single_product_url']) ?>"/>
89
- <a href="#help" class="help" title="<?php _e('The external/affiliate link URL to the product.', 'pmxi_plugin') ?>">?</a>
90
- </p>
91
- <p class="form-field">
92
- <label><?php _e("Button text"); ?></label>
93
- <input type="text" class="short" name="single_product_button_text" value="<?php echo esc_attr($post['single_product_button_text']) ?>"/>
94
- <a href="#help" class="help" title="<?php _e('This text will be shown on the button linking to the external product.', 'pmxi_plugin') ?>">?</a>
95
- </p>
96
- </div>
97
- <div class="options_group pricing show_if_simple show_if_external show_if_variable">
98
- <p class="form-field">
99
- <label><?php _e("Regular Price (".get_woocommerce_currency_symbol().")"); ?></label>
100
- <input type="text" class="short" name="single_product_regular_price" value="<?php echo esc_attr($post['single_product_regular_price']) ?>"/>
101
- </p>
102
- <p class="form-field">
103
- <label><?php _e("Sale Price (".get_woocommerce_currency_symbol().")"); ?></label>
104
- <input type="text" class="short" name="single_product_sale_price" value="<?php echo esc_attr($post['single_product_sale_price']) ?>"/>&nbsp;<a id="regular_price_shedule" href="javascript:void(0);" <?php if ($post['is_regular_price_shedule']):?>style="display:none;"<?php endif; ?>><?php _e('schedule');?></a>
105
- <input type="hidden" name="is_regular_price_shedule" value="<?php echo esc_attr($post['is_regular_price_shedule']) ?>"/>
106
- </p>
107
- <p class="form-field" <?php if ( ! $post['is_regular_price_shedule']):?>style="display:none;"<?php endif; ?> id="sale_price_range">
108
- <span style="vertical-align:middle">
109
- <label><?php _e("Sale Price Dates"); ?></label>
110
- <input type="text" class="datepicker" name="single_sale_price_dates_from" value="<?php echo esc_attr($post['single_sale_price_dates_from']) ?>" style="float:none;"/>
111
- <?php _e('and', 'pmxi_plugin') ?>
112
- <input type="text" class="datepicker" name="single_sale_price_dates_to" value="<?php echo esc_attr($post['single_sale_price_dates_to']) ?>" style="float:none;"/>
113
- &nbsp;<a id="cancel_regular_price_shedule" href="javascript:void(0);"><?php _e('cancel');?></a>
114
- </span>
115
- </p>
116
- <?php if ( class_exists('woocommerce_wholesale_pricing') ):?>
117
- <p class="form-field">
118
- <label><?php _e("Wholesale Price (".get_woocommerce_currency_symbol().")"); ?></label>
119
- <input type="text" class="short" name="single_product_whosale_price" value="<?php echo esc_attr($post['single_product_whosale_price']) ?>"/>
120
- </p>
121
- <?php endif; ?>
122
- </div>
123
- <div class="options_group show_if_virtual">
124
- <div class="input" style="padding-left:0px;">
125
- <div class="input fleft">
126
- <input type="radio" id="is_product_virtual_yes" class="switcher" name="is_product_virtual" value="yes" <?php echo 'yes' == $post['is_product_virtual'] ? 'checked="checked"': '' ?>/>
127
- <label for="is_product_virtual_yes"><?php _e("Virtual"); ?></label>
128
- </div>
129
- <div class="input fleft">
130
- <input type="radio" id="is_product_virtual_no" class="switcher" name="is_product_virtual" value="no" <?php echo 'no' == $post['is_product_virtual'] ? 'checked="checked"': '' ?>/>
131
- <label for="is_product_virtual_no"><?php _e("Not Virtual"); ?></label>
132
- </div>
133
- <div class="input fleft" style="position:relative;width:220px;">
134
- <input type="radio" id="is_product_virtual_xpath" class="switcher" name="is_product_virtual" value="xpath" <?php echo 'xpath' == $post['is_product_virtual'] ? 'checked="checked"': '' ?>/>
135
- <label for="is_product_virtual_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label> <br>
136
- <div class="switcher-target-is_product_virtual_xpath set_with_xpath">
137
- <div class="input">
138
- &nbsp;<input type="text" class="smaller-text" name="single_product_virtual" style="width:300px;" value="<?php echo esc_attr($post['single_product_virtual']) ?>"/>
139
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
140
- </div>
141
- </div>
142
- </div>
143
- </div>
144
- </div>
145
- <div class="options_group show_if_downloadable">
146
- <div class="input" style="padding-left:0px;">
147
- <div class="input fleft">
148
- <input type="radio" id="is_product_downloadable_yes" class="switcher" name="is_product_downloadable" value="yes" <?php echo 'yes' == $post['is_product_downloadable'] ? 'checked="checked"': '' ?>/>
149
- <label for="is_product_downloadable_yes"><?php _e("Downloadable"); ?></label>
150
- </div>
151
- <div class="input fleft">
152
- <input type="radio" id="is_product_downloadable_no" class="switcher" name="is_product_downloadable" value="no" <?php echo 'no' == $post['is_product_downloadable'] ? 'checked="checked"': '' ?>/>
153
- <label for="is_product_downloadable_no"><?php _e("Not Downloadable"); ?></label>
154
- </div>
155
- <div class="input fleft" style="position:relative; width:220px;">
156
- <input type="radio" id="is_product_downloadable_xpath" class="switcher" name="is_product_downloadable" value="xpath" <?php echo 'xpath' == $post['is_product_downloadable'] ? 'checked="checked"': '' ?>/>
157
- <label for="is_product_downloadable_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label> <br>
158
- <div class="switcher-target-is_product_downloadable_xpath set_with_xpath">
159
- <div class="input">
160
- <input type="text" class="smaller-text" name="single_product_downloadable" style="width:300px;" value="<?php echo esc_attr($post['single_product_downloadable']) ?>"/>
161
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
162
  </div>
163
- </div>
164
- </div>
165
- </div>
166
- <br>
167
- <div class="clear"></div>
168
- <p class="form-field">
169
- <label><?php _e("File paths"); ?></label>
170
- <input type="text" class="short" name="single_product_files" value="<?php echo esc_attr($post['single_product_files']) ?>" style="margin-right:5px;"/>
171
- <input type="text" class="small" name="product_files_delim" value="<?php echo esc_attr($post['product_files_delim']) ?>" style="width:5%; text-align:center;"/>
172
- <a href="#help" class="help" title="<?php _e('File paths/URLs, comma separated. The delimiter is used when an XML element contains multiple URLs/paths - i.e. <code>http://files.com/1.doc, http://files.com/2.doc</code>.', 'pmxi_plugin') ?>">?</a>
173
- </p>
174
- <p class="form-field">
175
- <label><?php _e("File names"); ?></label>
176
- <input type="text" class="short" name="single_product_files_names" value="<?php echo esc_attr($post['single_product_files_names']) ?>" style="margin-right:5px;"/>
177
- <input type="text" class="small" name="product_files_names_delim" value="<?php echo esc_attr($post['product_files_names_delim']) ?>" style="width:5%; text-align:center;"/>
178
- <a href="#help" class="help" title="<?php _e('File names, comma separated. The delimiter is used when an XML element contains multiple names - i.e. <code>1.doc, 2.doc</code>.', 'pmxi_plugin') ?>">?</a>
179
- </p>
180
- <p class="form-field">
181
- <label><?php _e("Download Limit"); ?></label>
182
- <input type="text" class="short" placeholder="Unimited" name="single_product_download_limit" value="<?php echo esc_attr($post['single_product_download_limit']) ?>"/>&nbsp;
183
- <?php _e( 'Leave blank for unlimited re-downloads.', 'woocommerce' ) ?>
184
- </p>
185
- <p class="form-field">
186
- <label><?php _e("Download Expiry"); ?></label>
187
- <input type="text" class="short" placeholder="Never" name="single_product_download_expiry" value="<?php echo esc_attr($post['single_product_download_expiry']) ?>"/>&nbsp;
188
- <?php _e( 'Enter the number of days before a download link expires, or leave blank.', 'woocommerce' ) ?>
189
- </p>
190
- <p class="form-field">
191
- <label><?php _e("Download Type"); ?></label>
192
- <input type="text" class="short" placeholder="Standard Product" name="single_product_download_type" value="<?php echo esc_attr($post['single_product_download_type']) ?>"/>&nbsp;
193
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'application\', \'music\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
194
- </p>
195
- </div>
196
- <div class="options_group show_if_simple show_if_external show_if_variable">
197
- <div class="input">
198
- <div class="main_choise">
199
- <input type="radio" id="multiple_product_tax_status_yes" class="switcher" name="is_multiple_product_tax_status" value="yes" <?php echo 'no' != $post['is_multiple_product_tax_status'] ? 'checked="checked"': '' ?>/>
200
- <label for="multiple_product_tax_status_yes"><?php _e("Tax Status"); ?></label>
201
- </div>
202
- <div class="switcher-target-multiple_product_tax_status_yes" style="padding-left:17px;">
203
- <div class="input">
204
- <select class="select short" name="multiple_product_tax_status">
205
- <option value="taxable" <?php echo 'taxable' == $post['multiple_product_tax_status'] ? 'selected="selected"': '' ?>><?php _e('Taxable', 'woocommerce');?></option>
206
- <option value="shipping" <?php echo 'shipping' == $post['multiple_product_tax_status'] ? 'selected="selected"': '' ?>><?php _e('Shipping only', 'woocommerce');?></option>
207
- <option value="none" <?php echo 'none' == $post['multiple_product_tax_status'] ? 'selected="selected"': '' ?>><?php _e('None', 'woocommerce');?></option>
208
- </select>
209
- </div>
210
- </div>
211
- </div>
212
- <div class="input">
213
- <div class="main_choise">
214
- <input type="radio" id="multiple_product_tax_status_no" class="switcher" name="is_multiple_product_tax_status" value="no" <?php echo 'no' == $post['is_multiple_product_tax_status'] ? 'checked="checked"': '' ?>/>
215
- <label for="multiple_product_tax_status_no"><?php _e('Set product tax status with XPath', 'pmxi_plugin' )?></label>
216
- </div>
217
- <div class="switcher-target-multiple_product_tax_status_no" style="padding-left:17px;">
218
- <div class="input">
219
- <input type="text" class="smaller-text" name="single_product_tax_status" style="width:300px;" value="<?php echo esc_attr($post['single_product_tax_status']) ?>"/>
220
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'taxable\', \'shipping\', \'none\').', 'pmxi_plugin') ?>">?</a>
221
- </div>
222
- </div>
223
- </div>
224
- </div>
225
- <div class="options_group show_if_simple show_if_external show_if_variable">
226
- <div class="input">
227
- <div class="main_choise">
228
- <input type="radio" id="multiple_product_tax_class_yes" class="switcher" name="is_multiple_product_tax_class" value="yes" <?php echo 'no' != $post['is_multiple_product_tax_class'] ? 'checked="checked"': '' ?>/>
229
- <label for="multiple_product_tax_class_yes"><?php _e("Tax Class"); ?></label>
230
- </div>
231
- <div class="switcher-target-multiple_product_tax_class_yes" style="padding-left:17px;">
232
- <div class="input">
233
- <?php
234
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
235
- $classes_options = array();
236
- $classes_options[''] = __( 'Standard', 'woocommerce' );
237
- if ( $tax_classes )
238
- foreach ( $tax_classes as $class )
239
- $classes_options[ sanitize_title( $class ) ] = esc_html( $class );
240
- ?>
241
- <select class="select short" name="multiple_product_tax_class">
242
- <?php foreach ($classes_options as $key => $value):?>
243
- <option value="<?php echo $key; ?>" <?php echo $key == $post['multiple_product_tax_class'] ? 'selected="selected"': '' ?>><?php echo $value; ?></option>
244
- <?php endforeach; ?>
245
- </select>
246
- </div>
247
- </div>
248
- </div>
249
- <div class="input">
250
- <div class="main_choise">
251
- <input type="radio" id="multiple_product_tax_class_no" class="switcher" name="is_multiple_product_tax_class" value="no" <?php echo 'no' == $post['is_multiple_product_tax_class'] ? 'checked="checked"': '' ?>/>
252
- <label for="multiple_product_tax_class_no"><?php _e('Set product tax class with XPath', 'pmxi_plugin' )?></label>
253
- </div>
254
- <div class="switcher-target-multiple_product_tax_class_no" style="padding-left:17px;">
255
- <div class="input">
256
- <input type="text" class="smaller-text" name="single_product_tax_class" style="width:300px;" value="<?php echo esc_attr($post['single_product_tax_class']) ?>"/>
257
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'reduced-rate\', \'zero-rate\').', 'pmxi_plugin') ?>">?</a>
258
- </div>
259
- </div>
260
- </div>
261
- </div>
262
- </div>
263
-
264
- <!-- INVENTORY -->
265
-
266
- <div class="panel woocommerce_options_panel" id="inventory_product_data" style="display:none;">
267
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
268
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
269
- </p>
270
- <div class="options_group show_if_simple show_if_variable">
271
- <p class="form-field">Manage stock?</p>
272
- <div class="input" style="margin-top:-10px;">
273
- <div class="input fleft">
274
- <input type="radio" id="is_product_manage_stock_yes" class="switcher" name="is_product_manage_stock" value="yes" <?php echo 'yes' == $post['is_product_manage_stock'] ? 'checked="checked"': '' ?>/>
275
- <label for="is_product_manage_stock_yes"><?php _e("Yes"); ?></label>
276
- </div>
277
- <div class="input fleft">
278
- <input type="radio" id="is_product_manage_stock_no" class="switcher" name="is_product_manage_stock" value="no" <?php echo 'no' == $post['is_product_manage_stock'] ? 'checked="checked"': '' ?>/>
279
- <label for="is_product_manage_stock_no"><?php _e("No"); ?></label>
280
- </div>
281
- <div class="input fleft" style="position:relative; width:220px;">
282
- <input type="radio" id="is_product_manage_stock_xpath" class="switcher" name="is_product_manage_stock" value="xpath" <?php echo 'xpath' == $post['is_product_manage_stock'] ? 'checked="checked"': '' ?>/>
283
- <label for="is_product_manage_stock_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label> <br>
284
- <div class="switcher-target-is_product_manage_stock_xpath set_with_xpath">
285
- <div class="input">
286
- <input type="text" class="smaller-text" name="single_product_manage_stock" style="width:300px;" value="<?php echo esc_attr($post['single_product_manage_stock']) ?>"/>
287
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
288
  </div>
289
- </div>
290
- </div>
291
- </div>
292
- </div>
293
- <div class="options_group stock_fields show_if_simple show_if_variable" style="padding-bottom:0px;">
294
- <p class="form-field">
295
- <label><?php _e("Stock Qty"); ?></label>
296
- <input type="text" class="short" name="single_product_stock_qty" value="<?php echo esc_attr($post['single_product_stock_qty']) ?>"/>
297
- <a href="#help" class="help" title="<?php _e('Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce'); ?>">?</a>
298
- </p>
299
- </div>
300
- <div class="options_group">
301
- <p class="form-field"><?php _e('Stock status','pmxi_plugin');?></p>
302
- <div class="input" style="margin-top:-10px;">
303
- <div class="input fleft">
304
- <input type="radio" id="product_stock_status_in_stock" class="switcher" name="product_stock_status" value="instock" <?php echo 'instock' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
305
- <label for="product_stock_status_in_stock"><?php _e("In stock"); ?></label>
306
- </div>
307
- <div class="input fleft">
308
- <input type="radio" id="product_stock_status_out_of_stock" class="switcher" name="product_stock_status" value="outofstock" <?php echo 'outofstock' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
309
- <label for="product_stock_status_out_of_stock"><?php _e("Out of stock"); ?></label>
310
- </div>
311
- <div class="input fleft" style="position:relative; width:220px;">
312
- <input type="radio" id="product_stock_status_xpath" class="switcher" name="product_stock_status" value="xpath" <?php echo 'xpath' == $post['product_stock_status'] ? 'checked="checked"': '' ?>/>
313
- <label for="product_stock_status_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
314
- <div class="switcher-target-product_stock_status_xpath set_with_xpath">
315
- <div class="input">
316
- <input type="text" class="smaller-text" name="single_product_stock_status" style="width:300px;" value="<?php echo esc_attr($post['single_product_stock_status']) ?>"/>
317
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'instock\', \'outofstock\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
318
  </div>
319
- </div>
320
- </div>
321
- </div>
322
- </div>
323
- <div class="options_group show_if_simple show_if_variable">
324
- <p class="form-field"><?php _e('Allow Backorders?','pmxi_plugin');?><a href="#help" class="help" title="<?php _e('If managing stock, this controls whether or not backorders are allowed for this product and variations. If enabled, stock quantity can go below 0.', 'woocommerce'); ?>">?</a></p>
325
- <div class="input" style="margin-top:-10px;">
326
- <div class="input fleft">
327
- <input type="radio" id="product_allow_backorders_no" class="switcher" name="product_allow_backorders" value="no" <?php echo 'no' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
328
- <label for="product_allow_backorders_no"><?php _e("Do not allow"); ?></label>
329
- </div>
330
- <div class="input fleft">
331
- <input type="radio" id="product_allow_backorders_notify" class="switcher" name="product_allow_backorders" value="notify" <?php echo 'notify' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
332
- <label for="product_allow_backorders_notify"><?php _e("Allow, but notify customer"); ?></label>
333
- </div>
334
- <div class="input fleft">
335
- <input type="radio" id="product_allow_backorders_yes" class="switcher" name="product_allow_backorders" value="yes" <?php echo 'yes' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
336
- <label for="product_allow_backorders_yes"><?php _e("Allow"); ?></label>
337
- </div>
338
- <div class="input fleft" style="position:relative; width:220px;">
339
- <input type="radio" id="product_allow_backorders_xpath" class="switcher" name="product_allow_backorders" value="xpath" <?php echo 'xpath' == $post['product_allow_backorders'] ? 'checked="checked"': '' ?>/>
340
- <label for="product_allow_backorders_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
341
- <div class="switcher-target-product_allow_backorders_xpath set_with_xpath">
342
- <div class="input">
343
- <input type="text" class="smaller-text" name="single_product_allow_backorders" style="width:300px;" value="<?php echo esc_attr($post['single_product_allow_backorders']) ?>"/>
344
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'no\', \'notify\', \'yes\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
345
  </div>
346
- </div>
347
- </div>
348
- </div>
349
- </div>
350
- <div class="options_group show_if_simple show_if_variable">
351
- <p class="form-field"><?php _e('Sold Individually?','pmxi_plugin');?></p>
352
- <div class="input" style="margin-top:-10px;">
353
- <div class="input fleft">
354
- <input type="radio" id="product_sold_individually_yes" class="switcher" name="product_sold_individually" value="yes" <?php echo 'yes' == $post['product_sold_individually'] ? 'checked="checked"': '' ?>/>
355
- <label for="product_sold_individually_yes"><?php _e("Yes"); ?></label>
356
- </div>
357
- <div class="input fleft">
358
- <input type="radio" id="product_sold_individually_no" class="switcher" name="product_sold_individually" value="no" <?php echo 'no' == $post['product_sold_individually'] ? 'checked="checked"': '' ?>/>
359
- <label for="product_sold_individually_no"><?php _e("No"); ?></label>
360
- </div>
361
- <div class="input fleft" style="position:relative; width:220px;">
362
- <input type="radio" id="product_sold_individually_xpath" class="switcher" name="product_sold_individually" value="xpath" <?php echo 'xpath' == $post['product_sold_individually'] ? 'checked="checked"': '' ?>/>
363
- <label for="product_sold_individually_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
364
- <div class="switcher-target-product_sold_individually_xpath set_with_xpath">
365
- <div class="input">
366
- <input type="text" class="smaller-text" name="single_product_sold_individually" style="width:300px;" value="<?php echo esc_attr($post['single_product_sold_individually']) ?>"/>
367
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
368
  </div>
369
- </div>
370
- </div>
371
- </div>
372
- </div>
373
- </div>
374
 
375
- <!-- SHIPPING -->
376
 
377
- <div class="panel woocommerce_options_panel" id="shipping_product_data" style="display:none;">
378
-
379
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
380
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
381
- </p>
382
 
383
- <div class="options_group">
384
- <p class="form-field">
385
- <label><?php _e("Weight (" . get_option('woocommerce_weight_unit') . ")"); ?></label>
386
- <input type="text" class="short" placeholder="0.00" name="single_product_weight" style="" value="<?php echo esc_attr($post['single_product_weight']) ?>"/>
387
- </p>
388
- <p class="form-field">
389
- <label><?php _e("Dimensions (" . get_option( 'woocommerce_dimension_unit' ) . ")"); ?></label>
390
- <input type="text" class="short" placeholder="Length" name="single_product_length" style="margin-right:5px;" value="<?php echo esc_attr($post['single_product_length']) ?>"/>
391
- <input type="text" class="short" placeholder="Width" name="single_product_width" style="margin-right:5px;" value="<?php echo esc_attr($post['single_product_width']) ?>"/>
392
- <input type="text" class="short" placeholder="Height" name="single_product_height" style="" value="<?php echo esc_attr($post['single_product_height']) ?>"/>
393
- </p>
394
- </div> <!-- End options group -->
395
 
396
- <div class="options_group">
397
- <div class="input">
398
- <div class="main_choise">
399
- <input type="radio" id="multiple_product_shipping_class_yes" class="switcher" name="is_multiple_product_shipping_class" value="yes" <?php echo 'no' != $post['is_multiple_product_shipping_class'] ? 'checked="checked"': '' ?>/>
400
- <label for="multiple_product_shipping_class_yes"><?php _e("Shipping Class"); ?></label>
401
- </div>
402
- <div class="switcher-target-multiple_product_shipping_class_yes" style="padding-left:17px;">
403
- <div class="input">
404
- <?php
405
- $classes = get_the_terms( 0, 'product_shipping_class' );
406
 
407
- $args = array(
408
- 'taxonomy' => 'product_shipping_class',
409
- 'hide_empty' => 0,
410
- 'show_option_none' => __( 'No shipping class', 'woocommerce' ),
411
- 'name' => 'multiple_product_shipping_class',
412
- 'id' => 'multiple_product_shipping_class',
413
- 'selected' => $post['multiple_product_shipping_class'],
414
- 'class' => 'select short'
415
- );
416
 
417
- wp_dropdown_categories( $args );
418
- ?>
419
- </div>
420
- </div>
421
- </div>
422
- <div class="input">
423
- <div class="main_choise">
424
- <input type="radio" id="multiple_product_shipping_class_no" class="switcher" name="is_multiple_product_shipping_class" value="no" <?php echo 'no' == $post['is_multiple_product_shipping_class'] ? 'checked="checked"': '' ?>/>
425
- <label for="multiple_product_shipping_class_no"><?php _e('Set product shipping class with XPath', 'pmxi_plugin' )?></label>
426
- </div>
427
- <div class="switcher-target-multiple_product_shipping_class_no" style="padding-left:17px;">
428
- <div class="input">
429
- <input type="text" class="smaller-text" name="single_product_shipping_class" style="width:300px;" value="<?php echo esc_attr($post['single_product_shipping_class']) ?>"/>
430
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'taxable\', \'shipping\', \'none\').', 'pmxi_plugin') ?>">?</a>
431
- </div>
432
- </div>
433
- </div>
434
- </div> <!-- End options group -->
435
- </div> <!-- End Product Panel -->
436
 
437
- <!-- LINKED PRODUCT -->
438
 
439
- <div class="panel woocommerce_options_panel" id="linked_product_data" style="display:none;">
440
-
441
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
442
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
443
- </p>
444
 
445
- <div class="options_group">
446
- <p class="form-field">
447
- <label><?php _e("Up-Sells"); ?></label>
448
- <input type="text" class="" placeholder="Products SKU, comma separated" name="single_product_up_sells" style="" value="<?php echo esc_attr($post['single_product_up_sells']) ?>"/>
449
- <a href="#help" class="help" title="<?php _e('Up-sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce') ?>">?</a>
450
- </p>
451
- <p class="form-field">
452
- <label><?php _e("Cross-Sells"); ?></label>
453
- <input type="text" class="" placeholder="Products SKU, comma separated" name="single_product_cross_sells" value="<?php echo esc_attr($post['single_product_cross_sells']) ?>"/>
454
- <a href="#help" class="help" title="<?php _e('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce') ?>">?</a>
455
- </p>
456
- </div> <!-- End options group -->
457
- <div class="options_group grouping show_if_simple show_if_external">
458
- <?php
459
- $post_parents = array();
460
- $post_parents[''] = __( 'Choose a grouped product&hellip;', 'woocommerce' );
461
 
462
- $posts_in = array_unique( (array) get_objects_in_term( get_term_by( 'slug', 'grouped', 'product_type' )->term_id, 'product_type' ) );
463
- if ( sizeof( $posts_in ) > 0 ) {
464
- $args = array(
465
- 'post_type' => 'product',
466
- 'post_status' => 'any',
467
- 'numberposts' => -1,
468
- 'orderby' => 'title',
469
- 'order' => 'asc',
470
- 'post_parent' => 0,
471
- 'include' => $posts_in,
472
- );
473
- $grouped_products = get_posts( $args );
474
 
475
- if ( $grouped_products ) {
476
- foreach ( $grouped_products as $product ) {
477
 
478
- if ( $product->ID == $post->ID )
479
- continue;
480
 
481
- $post_parents[ $product->ID ] = $product->post_title;
482
- }
483
- }
484
- }
485
- ?>
486
-
487
- <div class="input">
488
- <div class="main_choise">
489
- <input type="radio" id="multiple_grouping_product_yes" class="switcher" name="is_multiple_grouping_product" value="yes" <?php echo 'no' != $post['is_multiple_grouping_product'] ? 'checked="checked"': '' ?>/>
490
- <label for="multiple_grouping_product_yes"><?php _e("Grouping"); ?></label>
491
- </div>
492
- <div class="switcher-target-multiple_grouping_product_yes" style="padding-left:17px;">
493
- <div class="input">
494
- <select name="multiple_grouping_product">
495
- <?php
496
- foreach ($post_parents as $parent_id => $parent_title) {
497
- ?>
498
- <option value="<?php echo $parent_id; ?>" <?php if ($parent_id == $post['multiple_grouping_product']):?>selected="selected"<?php endif;?>><?php echo $parent_title;?></option>
499
- <?php
500
- }
501
- ?>
502
- </select>
503
- <a href="#help" class="help" title="<?php _e('Set this option to make this product part of a grouped product.', 'woocommerce'); ?>">?</a>
504
- </div>
505
- </div>
506
- </div>
507
- <div class="input">
508
- <div class="main_choise">
509
- <input type="radio" id="multiple_grouping_product_no" class="switcher" name="is_multiple_grouping_product" value="no" <?php echo 'no' == $post['is_multiple_grouping_product'] ? 'checked="checked"': '' ?>/>
510
- <label for="multiple_grouping_product_no"><?php _e('Manual matching grouping product with', 'pmxi_plugin' )?></label>
511
- </div>
512
-
513
- <div class="switcher-target-multiple_grouping_product_no" style="padding-left:17px; clear:both;">
514
- <div class="input">
515
- <input type="radio" id="duplicate_indicator_xpath_grouping" class="switcher" name="grouping_indicator" value="xpath" <?php echo 'xpath' == $post['grouping_indicator'] ? 'checked="checked"': '' ?>/>
516
- <label for="duplicate_indicator_xpath_grouping"><?php _e('xpath', 'pmxi_plugin' )?></label>
517
- <span class="switcher-target-duplicate_indicator_xpath_grouping" style="vertical-align:middle" style="padding-left:17px;">
518
- <input type="text" name="single_grouping_product" value="<?php echo esc_attr($post['single_grouping_product']); ?>" style="float:none; margin:1px; margin-top:-3px;" />
519
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be grouped product ID or Title).', 'pmxi_plugin') ?>">?</a>
520
- </span>
521
- </div>
522
-
523
- <div class="input">
524
- <input type="radio" id="duplicate_indicator_custom_field_grouping" class="switcher" name="grouping_indicator" value="custom field" <?php echo 'custom field' == $post['grouping_indicator'] ? 'checked="checked"': '' ?>/>
525
- <label for="duplicate_indicator_custom_field_grouping"><?php _e('custom field', 'pmxi_plugin' )?></label><br>
526
- <span class="switcher-target-duplicate_indicator_custom_field_grouping" style="vertical-align:middle" style="padding-left:17px;">
527
- <div class="input">
528
- <label><?php _e('Name', 'pmxi_plugin') ?></label>
529
- <input type="text" name="custom_grouping_indicator_name" value="<?php echo esc_attr($post['custom_grouping_indicator_name']) ?>" style="float:none; margin:1px;" />
530
- </div>
531
- <div class="input">
532
- <label><?php _e('Value', 'pmxi_plugin') ?></label>
533
- <input type="text" name="custom_grouping_indicator_value" value="<?php echo esc_attr($post['custom_grouping_indicator_value']) ?>" style="float:none; margin:1px; margin-left:3px;" />
534
- </div>
535
- </span>
536
-
537
-
538
- <!--input type="text" class="smaller-text" name="single_grouping_product" style="width:300px;" value="<?php echo esc_attr($post['single_grouping_product']) ?>"/>
539
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be grouped product ID).', 'pmxi_plugin') ?>">?</a-->
540
- </div>
541
- </div>
542
- </div>
543
-
544
- </div>
545
- </div><!-- End Product Panel -->
546
-
547
- <!-- ATTRIBUTES -->
548
 
549
- <div class="panel woocommerce_options_panel" id="woocommerce_attributes" style="display:none;">
550
-
551
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
552
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
553
- </p>
554
-
555
- <div class="input">
556
- <table class="form-table custom-params" id="attributes_table" style="max-width:95%;">
557
- <thead>
558
- <tr>
559
- <td><?php _e('Name', 'pmxi_plugin') ?></td>
560
- <td><?php _e('Values', 'pmxi_plugin') ?></td>
561
- <td></td>
562
- </tr>
563
- </thead>
564
- <tbody>
565
- <?php if (!empty($post['attribute_name'][0])):?>
566
- <?php foreach ($post['attribute_name'] as $i => $name): if ("" == $name) continue; ?>
567
- <tr class="form-field">
568
- <td><input type="text" name="attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:100%;"/></td>
569
- <td>
570
- <textarea name="attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."><?php echo str_replace("&amp;","&", htmlentities(htmlentities($post['attribute_value'][$i]))); ?></textarea>
571
- <br>
572
- <span class='in_variations'>
573
- <input type="checkbox" name="in_variations[]" id="in_variations_<?php echo $i; ?>" <?php echo ($post['in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
574
- <label for="in_variations_<?php echo $i; ?>"><?php _e('In Variations','pmxi_plugin');?></label>
575
- </span>
576
-
577
- <span class='is_visible'>
578
- <input type="checkbox" name="is_visible[]" id="is_visible_<?php echo $i; ?>" <?php echo ($post['is_visible'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
579
- <label for="is_visible_<?php echo $i; ?>"><?php _e('Is Visible','pmxi_plugin');?></label>
580
- </span>
581
-
582
- <span class='is_taxonomy'>
583
- <input type="checkbox" name="is_taxonomy[]" id="is_taxonomy_<?php echo $i; ?>" <?php echo ($post['is_taxonomy'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
584
- <label for="is_taxonomy_<?php echo $i; ?>"><?php _e('Taxonomy','pmxi_plugin');?></label>
585
- </span>
586
-
587
- <span class='is_create_taxonomy'>
588
- <input type="checkbox" name="create_taxonomy_in_not_exists[]" id="create_taxonomy_in_not_exists_<?php echo $i; ?>" <?php echo ($post['create_taxonomy_in_not_exists'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
589
- <label for="create_taxonomy_in_not_exists_<?php echo $i; ?>"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
590
- </span>
591
- </td>
592
- <td class="action remove"><a href="#remove"></a></td>
593
- </tr>
594
- <?php endforeach ?>
595
- <?php else: ?>
596
- <tr class="form-field">
597
- <td><input type="text" name="attribute_name[]" value="" style="width:100%;"/></td>
598
- <td>
599
- <textarea name="attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
600
- <br>
601
- <span class='in_variations'>
602
- <input type="checkbox" name="in_variations[]" id="in_variations_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
603
- <label for="in_variations_0"><?php _e('In Variations','pmxi_plugin');?></label>
604
- </span>
605
- <span class='is_visible'>
606
- <input type="checkbox" name="is_visible[]" id="is_visible_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
607
- <label for="is_visible_0"><?php _e('Is Visible','pmxi_plugin');?></label>
608
- </span>
609
- <span class='is_taxonomy'>
610
- <input type="checkbox" name="is_taxonomy[]" id="is_taxonomy_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
611
- <label for="is_taxonomy_0"><?php _e('Taxonomy','pmxi_plugin');?></label>
612
- </span>
613
- <span class='is_create_taxonomy'>
614
- <input type="checkbox" name="create_taxonomy_in_not_exists[]" id="create_taxonomy_in_not_exists_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
615
- <label for="create_taxonomy_in_not_exists_0"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
616
- </span>
617
- <td class="action remove"><a href="#remove"></a></td>
618
- </tr>
619
- <?php endif;?>
620
- <tr class="form-field template">
621
- <td><input type="text" name="attribute_name[]" value="" style="width:100%;"/></td>
622
- <td>
623
- <textarea name="attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
624
- <br>
625
- <span class='in_variations'>
626
- <input type="checkbox" name="in_variations[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
627
- <label for=""><?php _e('In Variations','pmxi_plugin');?></label>
628
- </span>
629
- <span class='is_visible'>
630
- <input type="checkbox" name="is_visible[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
631
- <label for=""><?php _e('Is Visible','pmxi_plugin');?></label>
632
- </span>
633
- <span class='is_taxonomy'>
634
- <input type="checkbox" name="is_taxonomy[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
635
- <label for=""><?php _e('Taxonomy','pmxi_plugin');?></label>
636
- </span>
637
- <span class='is_create_taxonomy'>
638
- <input type="checkbox" name="create_taxonomy_in_not_exists[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
639
- <label for=""><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
640
- </span>
641
- <td class="action remove"><a href="#remove"></a></td>
642
- </tr>
643
- <tr>
644
- <td colspan="3"><a href="#add" title="<?php _e('add', 'pmxi_plugin')?>" class="action add-new-custom"><?php _e('Add more', 'pmxi_plugin') ?></a></td>
645
- </tr>
646
- </tbody>
647
- </table>
648
- </div>
649
- <div class="options_group show_if_variable">
650
- <div class="input" style="padding-left:5px; marign-top:10px;">
651
- <input type="hidden" name="link_all_variations" value="0" />
652
- <input type="checkbox" id="link_all_variations" name="link_all_variations" value="1" <?php echo $post['link_all_variations'] ? 'checked="checked"' : '' ?> style="width:25px; position:relative; top:-1px;"/>
653
- <label for="link_all_variations"><?php _e('Link all variations', 'pmxi_plugin') ?></label>
654
- <a href="#help" class="help" title="<?php _e('This option will create all possible variations for the presented attributes. Works just like the Link All Variations option inside WooCommerce.', 'pmxi_plugin') ?>" style="position:relative; top:-3px;">?</a>
655
- </div>
656
- </div>
657
- </div><!-- End Product Panel -->
658
 
659
- <!-- ADVANCED -->
660
-
661
- <div class="panel woocommerce_options_panel" id="advanced_product_data" style="display:none;">
662
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
663
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
664
- </p>
665
- <div class="options_group hide_if_external" style="padding-bottom:0px;">
666
- <p class="form-field">
667
- <label><?php _e("Purchase Note"); ?></label>
668
- <input type="text" class="short" placeholder="" name="single_product_purchase_note" style="" value="<?php echo esc_attr($post['single_product_purchase_note']) ?>"/>
669
- </p>
670
- </div>
671
- <div class="options_group" style="padding-bottom:0px;">
672
- <p class="form-field">
673
- <label><?php _e("Menu order"); ?></label>
674
- <input type="text" class="short" placeholder="" name="single_product_menu_order" value="<?php echo esc_attr($post['single_product_menu_order']) ?>"/>
675
- </p>
676
- </div>
677
- <div class="options_group reviews">
678
- <p class="form-field"><?php _e('Enable reviews','pmxi_plugin');?></p>
679
- <div class="input" style="margin-top:-10px;">
680
- <div class="input fleft">
681
- <input type="radio" id="product_enable_reviews_yes" class="switcher" name="is_product_enable_reviews" value="yes" <?php echo 'yes' == $post['is_product_enable_reviews'] ? 'checked="checked"': '' ?>/>
682
- <label for="product_enable_reviews_yes"><?php _e("Yes"); ?></label>
683
- </div>
684
- <div class="input fleft">
685
- <input type="radio" id="product_enable_reviews_no" class="switcher" name="is_product_enable_reviews" value="no" <?php echo 'no' == $post['is_product_enable_reviews'] ? 'checked="checked"': '' ?>/>
686
- <label for="product_enable_reviews_no"><?php _e("No"); ?></label>
687
- </div>
688
- <div class="input fleft" style="position:relative; width:220px;">
689
- <input type="radio" id="product_enable_reviews_xpath" class="switcher" name="is_product_enable_reviews" value="xpath" <?php echo 'xpath' == $post['is_product_enable_reviews'] ? 'checked="checked"': '' ?>/>
690
- <label for="product_enable_reviews_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
691
- <div class="switcher-target-product_enable_reviews_xpath set_with_xpath">
692
- <div class="input">
693
- <input type="text" class="smaller-text" name="single_product_enable_reviews" style="width:300px;" value="<?php echo esc_attr($post['single_product_enable_reviews']) ?>"/>
694
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
695
- </div>
696
- </div>
697
- </div>
698
- </div>
699
- </div> <!-- End options group -->
700
- <div class="options_group">
701
- <p class="form-field"><?php _e('Featured','pmxi_plugin');?></p>
702
- <div class="input" style="margin-top:-10px;">
703
- <div class="input fleft">
704
- <input type="radio" id="product_featured_yes" class="switcher" name="is_product_featured" value="yes" <?php echo 'yes' == $post['is_product_featured'] ? 'checked="checked"': '' ?>/>
705
- <label for="product_featured_yes"><?php _e("Yes"); ?></label>
706
- </div>
707
- <div class="input fleft">
708
- <input type="radio" id="product_featured_no" class="switcher" name="is_product_featured" value="no" <?php echo 'no' == $post['is_product_featured'] ? 'checked="checked"': '' ?>/>
709
- <label for="product_featured_no"><?php _e("No"); ?></label>
710
- </div>
711
- <div class="input fleft" style="position:relative; width:220px;">
712
- <input type="radio" id="product_featured_xpath" class="switcher" name="is_product_featured" value="xpath" <?php echo 'xpath' == $post['is_product_featured'] ? 'checked="checked"': '' ?>/>
713
- <label for="product_featured_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
714
- <div class="switcher-target-product_featured_xpath set_with_xpath">
715
- <div class="input">
716
- <input type="text" class="smaller-text" name="single_product_featured" style="width:300px;" value="<?php echo esc_attr($post['single_product_featured']) ?>"/>
717
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
718
- </div>
719
- </div>
720
- </div>
721
- </div>
722
- </div> <!-- End options group -->
723
- <div class="options_group">
724
- <p class="form-field"><?php _e('Catalog visibility','pmxi_plugin');?></p>
725
- <div class="input" style="margin-top:-10px;">
726
- <div class="input fleft">
727
- <input type="radio" id="product_visibility_visible" class="switcher" name="is_product_visibility" value="visible" <?php echo 'visible' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
728
- <label for="product_visibility_visible"><?php _e("Catalog/search"); ?></label>
729
- </div>
730
- <div class="input fleft">
731
- <input type="radio" id="product_visibility_catalog" class="switcher" name="is_product_visibility" value="catalog" <?php echo 'catalog' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
732
- <label for="product_visibility_catalog"><?php _e("Catalog"); ?></label>
733
- </div>
734
- <div class="input fleft">
735
- <input type="radio" id="product_visibility_search" class="switcher" name="is_product_visibility" value="search" <?php echo 'search' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
736
- <label for="product_visibility_search"><?php _e("Search"); ?></label>
737
- </div>
738
- <div class="input fleft">
739
- <input type="radio" id="product_visibility_hidden" class="switcher" name="is_product_visibility" value="hidden" <?php echo 'hidden' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
740
- <label for="product_visibility_hidden"><?php _e("Hidden"); ?></label>
741
- </div>
742
- <div class="input fleft" style="position:relative; width:220px;">
743
- <input type="radio" id="product_visibility_xpath" class="switcher" name="is_product_visibility" value="xpath" <?php echo 'xpath' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
744
- <label for="product_visibility_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
745
- <div class="switcher-target-product_visibility_xpath set_with_xpath">
746
- <div class="input">
747
- <input type="text" class="smaller-text" name="single_product_visibility" style="width:300px;" value="<?php echo esc_attr($post['single_product_visibility']) ?>"/>
748
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'visible\', \'catalog\', \'search\', \'hidden\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
749
- </div>
750
- </div>
751
- </div>
752
- </div>
753
- </div> <!-- End options group -->
754
- </div><!-- End Product Panel -->
755
 
756
- <!-- VARIATIONS -->
757
 
758
- <div class="panel woocommerce_options_panel" id="variable_product_options" style="display:none;">
759
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
760
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
761
- </p>
762
- <div class="options_group" style="padding-bottom:0px;">
763
- <div class="input" style="padding-bottom:10px;">
764
- <input type="radio" id="auto_matching_parent" class="switcher" name="matching_parent" value="auto" <?php echo 'auto' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
765
- <label for="auto_matching_parent" style="width:95%"><?php _e('All my variable products have SKUs or some other unique identifier. Each variation is linked to its parent with its parent\'s SKU or other unique identifier.', 'pmxi_plugin' )?></label><br>
766
- <div class="switcher-target-auto_matching_parent" style="padding-left:17px;">
767
- <p class="form-field">
768
- <label style="width:185px;"><?php _e("SKU element for parent", "pmxi_plugin"); ?></label>
769
- <input type="text" class="short" placeholder="" name="single_product_id" value="<?php echo esc_attr($post['single_product_id']) ?>"/>
770
- <a href="#help" class="help" title="<?php _e('SKU column in the below example.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
771
- </p>
772
- <p class="form-field">
773
- <label style="width:185px;"><?php _e("Parent SKU element for variation", "pmxi_plugin"); ?></label>
774
- <input type="text" class="short" placeholder="" name="single_product_parent_id" value="<?php echo esc_attr($post['single_product_parent_id']) ?>"/>
775
- <a href="#help" class="help" title="<?php _e('Parent SKU column in the below example.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
776
- </p>
777
- <p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2013/12/data-example-1.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
778
- <img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-1.png"/>
779
- <p class="highlight">
780
- <strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
781
- </p>
782
- <?php if ( ! $id ): ?>
783
- <p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
784
- <?php endif; ?>
785
- </div>
786
- <div class="clear" style="margin-top:5px;"></div>
787
- <input type="radio" id="auto_matching_parent_first_is_parent_id" class="switcher" name="matching_parent" value="first_is_parent_id" <?php echo 'first_is_parent_id' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
788
- <label for="auto_matching_parent_first_is_parent_id" style="width:95%"><?php _e('All products with variations are grouped with a unique identifier that is the same for each variation and unique for each product.', 'pmxi_plugin' )?></label><br>
789
- <div class="switcher-target-auto_matching_parent_first_is_parent_id" style="padding-left:17px;">
790
- <p class="form-field">
791
- <label style="width:95px;"><?php _e("Unique Identifier", "pmxi_plugin"); ?></label>
792
- <input type="text" class="short" placeholder="" name="single_product_id_first_is_parent_id" value="<?php echo esc_attr($post['single_product_id_first_is_parent_id']) ?>"/>
793
- <a href="#help" class="help" title="<?php _e('Group ID column in the below example.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
794
- </p>
795
- <p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2013/12/data-example-2.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
796
- <img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-2.png"/>
797
- <p class="highlight"><strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a></p>
798
- <?php if ( ! $id ): ?>
799
- <p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
800
- <?php endif; ?>
801
- </div>
802
- <div class="clear" style="margin-top:5px;"></div>
803
- <input type="radio" id="auto_matching_parent_first_is_parent_title" class="switcher" name="matching_parent" value="first_is_parent_title" <?php echo 'first_is_parent_title' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
804
- <label for="auto_matching_parent_first_is_parent_title"><?php _e('All variations for a particular product have the same title as the parent product.', 'pmxi_plugin' )?></label><br>
805
- <div class="switcher-target-auto_matching_parent_first_is_parent_title" style="padding-left:17px;">
806
- <p class="form-field">
807
- <label style="width:75px;"><?php _e("Product Title", "pmxi_plugin"); ?></label>
808
- <input type="text" class="short" placeholder="" name="single_product_id_first_is_parent_title" value="<?php echo ($post['single_product_id_first_is_parent_title']) ? esc_attr($post['single_product_id_first_is_parent_title']) : ((!empty(PMXI_Plugin::$session->data['pmxi_import']['template']['title'])) ? esc_attr(PMXI_Plugin::$session->data['pmxi_import']['template']['title']) : ''); ?>"/>
809
- </p>
810
- <p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2013/12/data-example-3.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
811
- <img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-3.png"/>
812
- <p class="highlight"><strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a></p>
813
- <?php if ( ! $id ): ?>
814
- <p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
815
- <?php endif; ?>
816
- </div>
817
- <div class="clear" style="margin-top:5px;"></div>
818
- <input type="radio" id="auto_matching_parent_first_is_variation" class="switcher" name="matching_parent" value="first_is_variation" <?php echo 'first_is_variation' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
819
- <label for="auto_matching_parent_first_is_variation"><?php _e('All variations for a particular product have the same title. There are no parent products.', 'pmxi_plugin' )?></label><br>
820
- <div class="switcher-target-auto_matching_parent_first_is_variation" style="padding-left:17px;">
821
- <p class="form-field">
822
- <label style="width:75px;"><?php _e("Product Title"); ?></label>
823
- <input type="text" class="short" placeholder="" name="single_product_id_first_is_variation" value="<?php echo ($post['single_product_id_first_is_variation']) ? esc_attr($post['single_product_id_first_is_variation']) : ((!empty(PMXI_Plugin::$session->data['pmxi_import']['template']['title'])) ? esc_attr(PMXI_Plugin::$session->data['pmxi_import']['template']['title']) : ''); ?>"/>
824
- </p>
825
- <p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2013/12/data-example-4.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
826
- <img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-4.png"/>
827
- <p class="highlight"><strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a></p>
828
- <?php if ( ! $id ): ?>
829
- <p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
830
- <?php endif; ?>
831
- </div>
832
- <div class="clear" style="margin-top:5px;"></div>
833
 
834
- <input type="radio" id="xml_matching_parent" class="switcher" name="matching_parent" value="xml" <?php echo 'xml' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
835
- <label for="xml_matching_parent"><?php _e('I\'m importing XML and my variations are child XML elements', 'pmxi_plugin' )?> </label>
836
- <a href="#help" class="help" title="<?php _e('This allows you to set variations that are stored as children XML elements.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
837
- <div class="switcher-target-xml_matching_parent" style="padding-left:17px; position:relative;">
838
- <div class="input">
839
- <p class="form-field"><a href="http://youtu.be/7xL4RGT-JRc?t=1m40s" target="_blank"><?php _e("Video Example", "pmxi_plugin");?></a></p>
840
- <p class="form-field">
841
- <label style="width:150px;"><?php _e("Variations XPath", "pmxi_plugin"); ?></label>
842
- <input type="text" class="short" placeholder="" id="variations_xpath" name="variations_xpath" value="<?php echo esc_attr($post['variations_xpath']) ?>" style="width:370px !important;"/> <a href="javascript:void(0);" id="toggle_xml_tree">Open XML Tree</a>
843
- <div id="variations_console"></div>
844
- </p>
845
- <p class="form-field">
846
- <label style="border-right:none;" for="_variable_virtual"><?php _e('Virtual', 'woocommerce');?> </label>
847
- <input type="checkbox" name="_variable_virtual" id="_variable_virtual" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['_variable_virtual']) ? 'checked="checked"' : ''; ?>>
848
- <label for="_variable_downloadable" class="show_if_simple"><?php _e('Downloadable','woocommerce');?></label>
849
- <input type="checkbox" name="_variable_downloadable" id="_variable_downloadable" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['_variable_downloadable']) ? 'checked="checked"' : ''; ?>>
850
- </p>
851
- <div style="margin-right:2%;">
852
 
853
- <div class="options_group">
854
- <p class="form-field">
855
- <label style="width:150px;"><?php _e('SKU','woocommerce');?></label>
856
- <input type="text" value="<?php echo esc_attr($post['variable_sku']) ?>" style="" name="variable_sku" class="short">
857
- <span class="use_parent">
858
- <input type="hidden" name="variable_sku_add_parent" value="0"/>
859
- <input type="checkbox" name="variable_sku_add_parent" id="variable_sku_add_parent" style="position:relative; top:6px; margin-left:5px;" <?php echo ($post['variable_sku_add_parent']) ? 'checked="checked"' : ''; ?>>
860
- <label for="variable_sku_add_parent" style="top:2px;">Add value to the parent SKU</label>
861
- <a href="#help" class="help" title="<?php _e('Enable this checkbox to combine SKU from parent and variation products.', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
862
- </span>
863
- </p>
864
- <p class="form-field">
865
- <label style="width:150px;"><?php _e('Stock Qty', 'woocommerce');?></label>
866
- <input type="text" value="<?php echo esc_attr($post['variable_stock']) ?>" style="" name="variable_stock" class="short">
867
- <a href="#help" class="help" title="<?php _e('Enter a quantity to enable stock management at variation level, oe leave blank to use parent product\'s options', 'pmxi_plugin') ?>" style="position:relative; top:0px;">?</a>
868
- <span class="use_parent">
869
- <input type="hidden" name="variable_stock_use_parent" value="0"/>
870
- <input type="checkbox" name="variable_stock_use_parent" id="variable_stock_use_parent" style="position:relative; top:6px; margin-left:5px;" <?php echo ($post['variable_stock_use_parent']) ? 'checked="checked"' : ''; ?>>
871
- <label for="variable_stock_use_parent" style="top:2px;">XPath Is From Parent</label>
872
- <a href="#help" class="help" title="<?php _e('Enable this checkbox to determine XPath from parent element.', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
873
- </span>
874
- </p>
875
- <p class="form-field">
876
- <label style="width:150px;"><?php _e('Image','woocommerce');?></label>
877
- <input type="text" value="<?php echo esc_attr($post['variable_image']) ?>" style="" name="variable_image" class="short">
878
- <span class="use_parent">
879
- <input type="hidden" name="variable_image_use_parent" value="0"/>
880
- <input type="checkbox" name="variable_image_use_parent" id="variable_image_use_parent" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['variable_image_use_parent']) ? 'checked="checked"' : ''; ?>>
881
- <label for="variable_image_use_parent" style="top:0px;">XPath Is From Parent</label>
882
- </span>
883
- </p>
884
- </div>
885
- <div class="options_group">
886
- <p class="form-field">
887
- <label style="width:150px;"><?php _e('Regular Price','woocommerce');?> (<?php echo get_woocommerce_currency_symbol(); ?>)</label>
888
- <input type="text" value="<?php echo esc_attr($post['variable_regular_price']) ?>" style="" name="variable_regular_price" class="short">
889
- <span class="use_parent">
890
- <input type="hidden" name="variable_regular_price_use_parent" value="0"/>
891
- <input type="checkbox" name="variable_regular_price_use_parent" id="variable_regular_price_use_parent" style="position:relative; top:6px; margin-left:5px;" <?php echo ($post['variable_regular_price_use_parent']) ? 'checked="checked"' : ''; ?>>
892
- <label for="variable_regular_price_use_parent" style="top:0px;">XPath Is From Parent</label>
893
- </span>
894
- </p>
895
- <p class="form-field">
896
- <label style="width:150px;"><?php _e('Sale Price','woocommerce');?> (<?php echo get_woocommerce_currency_symbol(); ?>)</label>&nbsp;
897
- <a id="variable_sale_price_shedule" href="javascript:void(0);" style="<?php if ($post['is_variable_sale_price_shedule']):?>display:none;<?php endif; ?>position:relative; top:-10px;"><?php _e('schedule');?></a>
898
- <input type="text" value="<?php echo esc_attr($post['variable_sale_price']) ?>" style="" name="variable_sale_price" class="short">
899
- <input type="hidden" name="is_variable_sale_price_shedule" value="<?php echo esc_attr($post['is_variable_sale_price_shedule']) ?>"/>
900
- <span class="use_parent">
901
- <input type="hidden" name="variable_sale_price_use_parent" value="0"/>
902
- <input type="checkbox" name="variable_sale_price_use_parent" id="variable_sale_price_use_parent" style="position:relative; top:3px; margin-left:5px;" <?php echo ($post['variable_sale_price_use_parent']) ? 'checked="checked"' : ''; ?>>
903
- <label for="variable_sale_price_use_parent">XPath Is From Parent</label>
904
- </span>
905
- </p>
906
- <?php if ( class_exists('woocommerce_wholesale_pricing') ):?>
907
- <p class="form-field">
908
- <label style="width:150px;"><?php _e("Wholesale Price (".get_woocommerce_currency_symbol().")"); ?></label>
909
- <input type="text" class="short" name="variable_whosale_price" value="<?php echo esc_attr($post['variable_whosale_price']) ?>"/>
910
- <span class="use_parent">
911
- <input type="hidden" name="variable_whosale_price_use_parent" value="0"/>
912
- <input type="checkbox" name="variable_whosale_price_use_parent" id="variable_whosale_price_use_parent" style="position:relative; top:3px; margin-left:5px;" <?php echo ($post['variable_whosale_price_use_parent']) ? 'checked="checked"' : ''; ?>>
913
- <label for="variable_whosale_price_use_parent">XPath Is From Parent</label>
914
- </span>
915
- </p>
916
- <?php endif; ?>
917
- </div>
918
- <div class="options_group" <?php if ( ! $post['is_variable_sale_price_shedule']):?>style="display:none;"<?php endif; ?> id="variable_sale_price_range">
919
- <p class="form-field">
920
- <span style="vertical-align:middle">
921
- <label style="width:150px;"><?php _e("Variable Sale Price Dates", "woocommerce"); ?></label>
922
- <span class="use_parent">
923
- <input type="hidden" name="variable_sale_dates_use_parent" value="0"/>
924
- <input type="checkbox" name="variable_sale_dates_use_parent" id="variable_sale_dates_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['variable_sale_dates_use_parent']) ? 'checked="checked"' : ''; ?>>
925
- <label for="variable_sale_dates_use_parent">XPath Is From Parent</label>
926
- </span>
927
- <br>
928
- <input type="text" class="datepicker" name="variable_sale_price_dates_from" value="<?php echo esc_attr($post['variable_sale_price_dates_from']) ?>" style="float:none;"/>
929
- <?php _e('and', 'pmxi_plugin') ?>
930
- <input type="text" class="datepicker" name="variable_sale_price_dates_to" value="<?php echo esc_attr($post['variable_sale_price_dates_to']) ?>" style="float:none;"/>
931
- &nbsp;<a id="cancel_variable_regular_price_shedule" href="javascript:void(0);"><?php _e('cancel');?></a>
932
- </span>
933
-
934
- </p>
935
- </div>
936
- <div class="options_group" <?php echo ( ! $post['_variable_virtual']) ? 'style="display:none;"' : ''; ?> id="variable_virtual">
937
- <div class="input" style="padding-left:0px;">
938
- <div class="input fleft">
939
- <input type="radio" id="is_variable_product_virtual_yes" class="switcher" name="is_variable_product_virtual" value="yes" <?php echo 'yes' == $post['is_variable_product_virtual'] ? 'checked="checked"': '' ?>/>
940
- <label for="is_variable_product_virtual_yes"><?php _e("Virtual"); ?></label>
941
- </div>
942
- <div class="input fleft">
943
- <input type="radio" id="is_variable_product_virtual_no" class="switcher" name="is_variable_product_virtual" value="no" <?php echo 'no' == $post['is_variable_product_virtual'] ? 'checked="checked"': '' ?>/>
944
- <label for="is_variable_product_virtual_no"><?php _e("Not Virtual"); ?></label>
945
- </div>
946
- <div class="input fleft" style="position:relative;width:220px;">
947
- <input type="radio" id="is_variable_product_virtual_xpath" class="switcher" name="is_variable_product_virtual" value="xpath" <?php echo 'xpath' == $post['is_variable_product_virtual'] ? 'checked="checked"': '' ?>/>
948
- <label for="is_variable_product_virtual_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label> <br>
949
- <div class="switcher-target-is_variable_product_virtual_xpath set_with_xpath" style="width:300px;">
950
- <div class="input" style="width:365px;">
951
- &nbsp;<input type="text" class="smaller-text" name="single_variable_product_virtual" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_virtual']) ?>"/>
952
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
953
- <span class="use_parent" style="float:right;">
954
- <input type="hidden" name="single_variable_product_virtual_use_parent" value="0"/>
955
- <input type="checkbox" name="single_variable_product_virtual_use_parent" id="single_variable_product_virtual_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['single_variable_product_virtual_use_parent']) ? 'checked="checked"' : ''; ?>>
956
- <label for="single_variable_product_virtual_use_parent" style="top:3px;">XPath Is From Parent</label>
957
- </span>
958
- </div>
959
- </div>
960
- </div>
961
- </div>
962
- </div>
963
- <div class="options_group" <?php echo ($post['_variable_virtual']) ? 'style="display:none;"' : ''; ?> id="variable_dimensions">
964
- <p class="form-field">
965
- <label style="width:150px;"><?php _e('Weight','woocommerce');?></label>
966
- <input type="text" placeholder="0.00" value="<?php echo esc_attr($post['variable_weight']) ?>" style="" name="variable_weight" class="short">
967
- <span class="use_parent">
968
- <input type="hidden" name="variable_weight_use_parent" value="0"/>
969
- <input type="checkbox" name="variable_weight_use_parent" id="variable_weight_use_parent" style="position:relative; top:6px; margin-left:5px;" <?php echo ($post['variable_weight_use_parent']) ? 'checked="checked"' : ''; ?>>
970
- <label for="variable_weight_use_parent">XPath Is From Parent</label>
971
- </span>
972
- </p>
973
- <p class="form-field">
974
- <label for"product_length"=""><?php _e('Dimensions (L×W×H)','woocommerce');?></label>
975
- <span class="use_parent">
976
- <input type="hidden" name="variable_dimensions_use_parent" value="0"/>
977
- <input type="checkbox" name="variable_dimensions_use_parent" id="variable_dimensions_use_parent" style="position:relative; top:3px; margin-left:5px;" <?php echo ($post['variable_dimensions_use_parent']) ? 'checked="checked"' : ''; ?>>
978
- <label for="variable_dimensions_use_parent">XPath Is From Parent</label>
979
- </span>
980
- <br>
981
- <input type="text" placeholder="0" value="<?php echo esc_attr($post['variable_length']) ?>" name="variable_length" class="short" style="margin-right:5px;">
982
- <input type="text" placeholder="0" value="<?php echo esc_attr($post['variable_width']) ?>" name="variable_width" class="short" style="margin-right:5px;">
983
- <input type="text" placeholder="0" value="<?php echo esc_attr($post['variable_height']) ?>" style="" name="variable_height" class="short">
984
-
985
- </p>
986
- </div>
987
- <div class="options_group">
988
- <p class="form-field">
989
- <div class="input">
990
- <div class="main_choise">
991
- <input type="radio" id="multiple_variable_product_shipping_class_yes" class="switcher" name="is_multiple_variable_product_shipping_class" value="yes" <?php echo 'no' != $post['is_multiple_variable_product_shipping_class'] ? 'checked="checked"': '' ?>/>
992
- <label for="multiple_variable_product_shipping_class_yes" style="width:150px;"><?php _e("Shipping Class"); ?></label>
993
- </div>
994
- <div class="switcher-target-multiple_variable_product_shipping_class_yes" style="padding-left:17px;">
995
- <div class="input">
996
- <?php
997
- $classes = get_the_terms( 0, 'product_shipping_class' );
998
- if ( $classes && ! is_wp_error( $classes ) ) $current_shipping_class = current($classes)->term_id; else $current_shipping_class = '';
999
 
1000
- $args = array(
1001
- 'taxonomy' => 'product_shipping_class',
1002
- 'hide_empty' => 0,
1003
- 'show_option_none' => __( 'No shipping class', 'woocommerce' ),
1004
- 'name' => 'multiple_variable_product_shipping_class',
1005
- 'id' => 'multiple_variable_product_shipping_class',
1006
- 'selected' => (!empty($post['multiple_variable_product_shipping_class'])) ? $post['multiple_variable_product_shipping_class'] : $current_shipping_class,
1007
- 'class' => 'select short'
1008
- );
1009
 
1010
- wp_dropdown_categories( $args );
1011
- ?>
1012
- </div>
1013
- </div>
1014
- </div>
1015
- <div class="input">
1016
- <div class="main_choise">
1017
- <input type="radio" id="multiple_variable_product_shipping_class_no" class="switcher" name="is_multiple_variable_product_shipping_class" value="no" <?php echo 'no' == $post['is_multiple_variable_product_shipping_class'] ? 'checked="checked"': '' ?>/>
1018
- <label for="multiple_variable_product_shipping_class_no"><?php _e('Set product shipping class with XPath', 'pmxi_plugin' )?></label>
1019
- </div>
1020
- <div class="switcher-target-multiple_variable_product_shipping_class_no" style="padding-left:17px;">
1021
- <div class="input">
1022
- <input type="text" class="smaller-text" name="single_variable_product_shipping_class" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_shipping_class']) ?>"/>
1023
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'taxable\', \'shipping\', \'none\').', 'pmxi_plugin') ?>">?</a>
1024
- <span class="use_parent">
1025
- <input type="hidden" name="single_variable_product_shipping_class_use_parent" value="0"/>
1026
- <input type="checkbox" name="single_variable_product_shipping_class_use_parent" id="single_variable_product_shipping_class_use_parent" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['single_variable_product_shipping_class_use_parent']) ? 'checked="checked"' : ''; ?>>
1027
- <label for="single_variable_product_shipping_class_use_parent" style="top:0px;">XPath Is From Parent</label>
1028
- </span>
1029
- </div>
1030
- </div>
1031
- </div>
1032
- </p>
1033
- <p class="form-field">
1034
- <div class="input">
1035
- <div class="main_choise">
1036
- <input type="radio" id="multiple_variable_product_tax_class_yes" class="switcher" name="is_multiple_variable_product_tax_class" value="yes" <?php echo 'no' != $post['is_multiple_variable_product_tax_class'] ? 'checked="checked"': '' ?>/>
1037
- <label for="multiple_variable_product_tax_class_yes" style="width:150px;"><?php _e("Tax Class", "woocommerce"); ?></label>
1038
- </div>
1039
- <div class="switcher-target-multiple_variable_product_tax_class_yes" style="padding-left:17px;">
1040
- <div class="input">
1041
- <?php
1042
- $tax_classes = array_filter( array_map( 'trim', explode( "\n", get_option( 'woocommerce_tax_classes' ) ) ) );
1043
- $classes_options = array();
1044
- $classes_options[''] = __( 'Standard', 'woocommerce' );
1045
- if ( $tax_classes )
1046
- foreach ( $tax_classes as $class )
1047
- $classes_options[ sanitize_title( $class ) ] = esc_html( $class );
1048
- ?>
1049
- <select class="select short" name="multiple_variable_product_tax_class">
1050
- <option value="parent" <?php echo 'parent' == $post['multiple_variable_product_tax_class'] ? 'selected="selected"': '' ?>><?php _e('Same as parent', 'woocommerce');?></option>
1051
- <?php foreach ($classes_options as $key => $value):?>
1052
- <option value="<?php echo $key; ?>" <?php echo $key == $post['multiple_variable_product_tax_class'] ? 'selected="selected"': '' ?>><?php echo $value; ?></option>
1053
- <?php endforeach; ?>
1054
- </select>
1055
- </div>
1056
- </div>
1057
- </div>
1058
- <div class="input">
1059
- <div class="main_choise">
1060
- <input type="radio" id="multiple_variable_product_tax_class_no" class="switcher" name="is_multiple_variable_product_tax_class" value="no" <?php echo 'no' == $post['is_multiple_variable_product_tax_class'] ? 'checked="checked"': '' ?>/>
1061
- <label for="multiple_variable_product_tax_class_no"><?php _e('Set product tax class with XPath', 'pmxi_plugin' )?></label>
1062
- </div>
1063
- <div class="switcher-target-multiple_variable_product_tax_class_no" style="padding-left:17px;">
1064
- <div class="input">
1065
- <input type="text" class="smaller-text" name="single_variable_product_tax_class" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_tax_class']) ?>"/>
1066
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'reduced-rate\', \'zero-rate\').', 'pmxi_plugin') ?>">?</a>
1067
- <span class="use_parent">
1068
- <input type="hidden" name="single_variable_product_tax_class_use_parent" value="0"/>
1069
- <input type="checkbox" name="single_variable_product_tax_class_use_parent" id="single_variable_product_tax_class_use_parent" style="position:relative; top:2px; margin-left:5px;" <?php echo ($post['single_variable_product_tax_class_use_parent']) ? 'checked="checked"' : ''; ?>>
1070
- <label for="single_variable_product_tax_class_use_parent" style="top:0px;">XPath Is From Parent</label>
1071
- </span>
1072
- </div>
1073
- </div>
1074
- </div>
1075
- </p>
1076
- </div>
1077
- <div class="options_group" <?php echo ( ! $post['_variable_downloadable']) ? 'style="display:none;"' : ''; ?> id="variable_downloadable">
1078
- <p class="form-field">
1079
- <div class="input fleft">
1080
- <input type="radio" id="is_variable_product_downloadable_yes" class="switcher" name="is_variable_product_downloadable" value="yes" <?php echo 'yes' == $post['is_variable_product_downloadable'] ? 'checked="checked"': '' ?>/>
1081
- <label for="is_variable_product_downloadable_yes"><?php _e("Downloadable"); ?></label>
1082
- </div>
1083
- <div class="input fleft">
1084
- <input type="radio" id="is_variable_product_downloadable_no" class="switcher" name="is_variable_product_downloadable" value="no" <?php echo 'no' == $post['is_variable_product_downloadable'] ? 'checked="checked"': '' ?>/>
1085
- <label for="is_variable_product_downloadable_no"><?php _e("Not Downloadable"); ?></label>
1086
- </div>
1087
- <div class="input fleft" style="position:relative; width:220px;">
1088
- <input type="radio" id="is_variable_product_downloadable_xpath" class="switcher" name="is_variable_product_downloadable" value="xpath" <?php echo 'xpath' == $post['is_variable_product_downloadable'] ? 'checked="checked"': '' ?>/>
1089
- <label for="is_variable_product_downloadable_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label> <br>
1090
- <div class="switcher-target-is_variable_product_downloadable_xpath set_with_xpath" style="width:300px;">
1091
- <div class="input">
1092
- <input type="text" class="smaller-text" name="single_variable_product_downloadable" style="width:345px;" value="<?php echo esc_attr($post['single_variable_product_downloadable']) ?>"/>
1093
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
1094
- <span class="use_parent">
1095
- <input type="hidden" name="single_variable_product_downloadable_use_parent" value="0"/>
1096
- <input type="checkbox" name="single_variable_product_downloadable_use_parent" id="single_variable_product_downloadable_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['single_variable_product_downloadable_use_parent']) ? 'checked="checked"' : ''; ?>>
1097
- <label for="single_variable_product_downloadable_use_parent" style="top:2px;">XPath Is From Parent</label>
1098
- </span>
1099
- </div>
1100
- </div>
1101
- </div>
1102
- </p>
1103
- <p class="form-field">
1104
- <label style="width:150px;"><?php _e('File paths','woocommerce');?></label>
1105
- <input type="text" value="<?php echo esc_attr($post['variable_file_paths']) ?>" name="variable_file_paths" class="short" style="width:60% !important;">
1106
- <input type="text" class="small" name="variable_product_files_delim" value="<?php echo esc_attr($post['variable_product_files_delim']) ?>" style="width:5% !important;text-align:center; margin-left:5px;"/>
1107
- <a href="#help" class="help" title="<?php _e('File paths/URLs, comma separated. The delimiter option uses when xml element contains few paths/URLs (http://files.com/1.doc, http://files.com/2.doc).', 'pmxi_plugin') ?>">?</a>
1108
- </p>
1109
- <p class="form-field">
1110
- <label style="width:150px;"><?php _e("File names"); ?></label>
1111
- <input type="text" class="short" name="variable_file_names" value="<?php echo esc_attr($post['variable_file_names']) ?>" style="width:60% !important;"/>
1112
- <input type="text" class="small" name="variable_product_files_names_delim" value="<?php echo esc_attr($post['variable_product_files_names_delim']) ?>" style="width:5% !important;text-align:center; margin-left:5px;"/>
1113
- <a href="#help" class="help" title="<?php _e('File names, comma separated. The delimiter is used when an XML element contains multiple names - i.e. <code>1.doc, 2.doc</code>.', 'pmxi_plugin') ?>">?</a>
1114
- </p>
1115
- <p class="form-field">
1116
- <label style="width:150px;"><?php _e('Download Limit','woocommerce');?></label>
1117
- <input type="text" value="<?php echo esc_attr($post['variable_download_limit']) ?>" style="" name="variable_download_limit" class="short">
1118
- <span class="use_parent">
1119
- <input type="hidden" name="variable_download_limit_use_parent" value="0"/>
1120
- <input type="checkbox" name="variable_download_limit_use_parent" id="variable_download_limit_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['variable_download_limit_use_parent']) ? 'checked="checked"' : ''; ?>>
1121
- <label for="variable_download_limit_use_parent">XPath Is From Parent</label>
1122
- </span>
1123
- </p>
1124
- <p class="form-field">
1125
- <label style="width:150px;"><?php _e('Download Expiry','woocommerce');?></label>
1126
- <input type="text" value="<?php echo esc_attr($post['variable_download_expiry']) ?>" style="" name="variable_download_expiry" class="short">
1127
- <span class="use_parent">
1128
- <input type="hidden" name="variable_download_expiry_use_parent" value="0"/>
1129
- <input type="checkbox" name="variable_download_expiry_use_parent" id="variable_download_expiry_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['variable_download_expiry_use_parent']) ? 'checked="checked"' : ''; ?>>
1130
- <label for="variable_download_expiry_use_parent">XPath Is From Parent</label>
1131
- </span>
1132
- </p>
1133
- </div>
1134
 
1135
- <div class="options_group">
1136
 
1137
- <p class="form-field"><?php _e('Variation Enabled','pmxi_plugin');?></p>
1138
- <div class="input" style="margin-top:-10px;">
1139
- <div class="input fleft">
1140
- <input type="radio" id="variable_product_enabled_yes" class="switcher" name="is_variable_product_enabled" value="yes" <?php echo 'yes' == $post['is_variable_product_enabled'] ? 'checked="checked"': '' ?>/>
1141
- <label for="variable_product_enabled_yes"><?php _e("Yes"); ?></label>
1142
- </div>
1143
- <div class="input fleft">
1144
- <input type="radio" id="variable_product_enabled_no" class="switcher" name="is_variable_product_enabled" value="no" <?php echo 'no' == $post['is_variable_product_enabled'] ? 'checked="checked"': '' ?>/>
1145
- <label for="variable_product_enabled_no"><?php _e("No"); ?></label>
1146
- </div>
1147
- <div class="input fleft" style="position:relative; width:220px;">
1148
- <input type="radio" id="variable_product_enabled_xpath" class="switcher" name="is_variable_product_enabled" value="xpath" <?php echo 'xpath' == $post['is_variable_product_enabled'] ? 'checked="checked"': '' ?>/>
1149
- <label for="variable_product_enabled_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
1150
- <div class="switcher-target-variable_product_enabled_xpath set_with_xpath">
1151
- <div class="input">
1152
- <input type="text" class="smaller-text" name="single_variable_product_enabled" style="width:300px; " value="<?php echo esc_attr($post['single_variable_product_enabled']) ?>"/>
1153
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
1154
- </div>
1155
- </div>
1156
- </div>
1157
- </div>
1158
 
1159
- </div>
1160
 
1161
- <div class="options_group variation_attributes">
1162
- <p class="form-field">
1163
- <label style="width:150px; padding-left:0px;"><?php _e('Variation Attributes','pmxi_plugin');?></label>
1164
- </p>
1165
- <div class="input">
1166
- <table class="form-table custom-params" style="max-width:95%;">
1167
- <thead>
1168
- <tr>
1169
- <td><?php _e('Name', 'pmxi_plugin') ?></td>
1170
- <td><?php _e('Values', 'pmxi_plugin') ?></td>
1171
- <td></td>
1172
- </tr>
1173
- </thead>
1174
- <tbody>
1175
- <?php if (!empty($post['variable_attribute_name'][0])):?>
1176
- <?php foreach ($post['variable_attribute_name'] as $i => $name): if ("" == $name) continue; ?>
1177
- <tr class="form-field">
1178
- <td><input type="text" name="variable_attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:95% !important;"/></td>
1179
- <td><textarea name="variable_attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."><?php echo esc_attr($post['variable_attribute_value'][$i]); ?></textarea>
1180
- <br>
1181
- <span class='in_variations' style="margin-left:0px;">
1182
- <input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_<?php echo $i; ?>" <?php echo ($post['variable_in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1183
- <label for="variable_in_variations_<?php echo $i; ?>"><?php _e('In Variations','pmxi_plugin');?></label>
1184
- </span>
1185
 
1186
- <span class='is_visible'>
1187
- <input type="checkbox" name="variable_is_visible[]" id="variable_is_visible_<?php echo $i; ?>" <?php echo ($post['variable_is_visible'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1188
- <label for="variable_is_visible_<?php echo $i; ?>"><?php _e('Is Visible','pmxi_plugin');?></label>
1189
- </span>
1190
 
1191
- <span class='is_taxonomy'>
1192
- <input type="checkbox" name="variable_is_taxonomy[]" id="variable_is_taxonomy_<?php echo $i; ?>" <?php echo ($post['variable_is_taxonomy'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1193
- <label for="variable_is_taxonomy_<?php echo $i; ?>"><?php _e('Taxonomy','pmxi_plugin');?></label>
1194
- </span>
1195
 
1196
- <span class='is_create_taxonomy'>
1197
- <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" id="variable_create_taxonomy_in_not_exists_<?php echo $i;?>" <?php echo ($post['variable_create_taxonomy_in_not_exists'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1198
- <label for="variable_create_taxonomy_in_not_exists_<?php echo $i; ?>"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
1199
- </span>
1200
-
1201
- <!--a href="#help" class="help" title="<?php _e('Enable &#39;is taxonomy&#39; and an Attribute on the Products -> Attributes page of WooCommerce will be added or an existing Attribute of the same name will be used. Check this box to auto-create attribute values, if they haven&#39;t already been set up.', 'pmxi_plugin') ?>" style="position:relative; top:-5px; left:24px;">?</a-->
1202
 
1203
- </td>
1204
- <td class="action remove"><a href="#remove"></a></td>
1205
- </tr>
1206
- <?php endforeach ?>
1207
- <?php else: ?>
1208
- <tr class="form-field">
1209
- <td><input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/></td>
1210
- <td><textarea name="variable_attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
1211
- <br>
1212
- <span class='in_variations' style="margin-left:0px;">
1213
- <input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1214
- <label for="variable_in_variations_0"><?php _e('In Variations','pmxi_plugin');?></label>
1215
- </span>
1216
- <span class='is_visible'>
1217
- <input type="checkbox" name="variable_is_visible[]" id="variable_is_visible_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1218
- <label for="variable_is_visible_0"><?php _e('Is Visible','pmxi_plugin');?></label>
1219
- </span>
1220
- <span class='is_taxonomy'>
1221
- <input type="checkbox" name="variable_is_taxonomy[]" id="variable_is_taxonomy_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1222
- <label for="variable_is_taxonomy_0"><?php _e('Taxonomy','pmxi_plugin');?></label>
1223
- </span>
1224
- <span class='is_create_taxonomy'>
1225
- <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" id="variable_create_taxonomy_in_not_exists_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1226
- <label for="variable_create_taxonomy_in_not_exists_0"><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
1227
- </span>
1228
- <td class="action remove"><a href="#remove"></a></td>
1229
- </tr>
1230
- <?php endif;?>
1231
- <tr class="form-field template">
1232
- <td><input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/></td>
1233
- <td><textarea name="variable_attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
1234
- <br>
1235
- <span class='in_variations' style="margin-left:0px;">
1236
- <input type="checkbox" name="variable_in_variations[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1237
- <label for=""><?php _e('In Variations','pmxi_plugin');?></label>
1238
- </span>
1239
- <span class='is_visible'>
1240
- <input type="checkbox" name="variable_is_visible[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1241
- <label for=""><?php _e('Is Visible','pmxi_plugin');?></label>
1242
- </span>
1243
- <span class='is_taxonomy'>
1244
- <input type="checkbox" name="variable_is_taxonomy[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1245
- <label for=""><?php _e('Taxonomy','pmxi_plugin');?></label>
1246
- </span>
1247
- <span class='is_create_taxonomy'>
1248
- <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
1249
- <label for=""><?php _e('Auto-Create Terms','pmxi_plugin');?></label>
1250
- </span>
1251
- <td class="action remove"><a href="#remove"></a></td>
1252
- </tr>
1253
- <tr>
1254
- <td colspan="3"><a href="#add" title="<?php _e('add', 'pmxi_plugin')?>" class="action add-new-custom"><?php _e('Add more', 'pmxi_plugin') ?></a></td>
1255
- </tr>
1256
- </tbody>
1257
- </table>
1258
- </div>
1259
- </div>
1260
- </div>
1261
- <div id="variations_tag" class="options_group show_if_variable">
1262
- <a href="javascript:void(0)" id="close_xml_tree"></a>
1263
- <div class="variations_tree">
1264
- <div id="variations_xml">
1265
- <div class="variations_tag">
1266
- <input type="hidden" name="variations_tagno" value="<?php echo (!empty($tagno)) ? $tagno : 0; ?>" />
1267
- <div class="title">
1268
- <?php printf(__('No matching elements found for XPath expression specified', 'pmxi_plugin'), (!empty($tagno)) ? $tagno : 0, (!empty($variation_list_count)) ? $variation_list_count : 0); ?>
1269
- </div>
1270
- <div class="clear"></div>
1271
- <div class="xml resetable"></div>
1272
- </div>
1273
- </div>
1274
- </div>
1275
- </div>
1276
- </div>
1277
- </div>
1278
-
1279
- <div class="clear" style="margin-top:5px;"></div>
1280
 
1281
- <input type="radio" id="manual_matching_parent" class="switcher" name="matching_parent" value="manual" <?php echo 'manual' == $post['matching_parent'] ? 'checked="checked"': '' ?> style="float:left;"/>
1282
- <label for="manual_matching_parent"><?php _e('I\'m an advanced user and will match my variations with my parent products manually. (Advanced)', 'pmxi_plugin' )?></label>
1283
- <a href="#help" class="help" title="<?php _e('This allows you to match products as you would in the Manual Record Matching section of WP All Import.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
1284
- <div class="switcher-target-manual_matching_parent" style="padding-left:17px;">
1285
- <div class="input">
1286
- <input type="radio" id="duplicate_indicator_title_parent" class="switcher" name="parent_indicator" value="title" <?php echo 'title' == $post['parent_indicator'] ? 'checked="checked"': '' ?>/>
1287
- <label for="duplicate_indicator_title_parent"><?php _e('title', 'pmxi_plugin' )?>&nbsp;</label>
1288
- </div>
1289
- <div class="input">
1290
- <input type="radio" id="duplicate_indicator_content_parent" class="switcher" name="parent_indicator" value="content" <?php echo 'content' == $post['parent_indicator'] ? 'checked="checked"': '' ?>/>
1291
- <label for="duplicate_indicator_content_parent"><?php _e('content', 'pmxi_plugin' )?>&nbsp;</label>
1292
- </div>
1293
- <div class="input">
1294
- <input type="radio" id="duplicate_indicator_custom_field_parent" class="switcher" name="parent_indicator" value="custom field" <?php echo 'custom field' == $post['parent_indicator'] ? 'checked="checked"': '' ?>/>
1295
- <label for="duplicate_indicator_custom_field_parent"><?php _e('custom field', 'pmxi_plugin' )?></label><br>
1296
- <span class="switcher-target-duplicate_indicator_custom_field_parent" style="vertical-align:middle" style="padding-left:17px;">
1297
- <div class="input">
1298
- <label><?php _e('Name', 'pmxi_plugin') ?></label>
1299
- <input type="text" name="custom_parent_indicator_name" value="<?php echo esc_attr($post['custom_parent_indicator_name']) ?>" style="float:none; margin:1px;" />
1300
- </div>
1301
- <div class="input">
1302
- <label><?php _e('Value', 'pmxi_plugin') ?></label>
1303
- <input type="text" name="custom_parent_indicator_value" value="<?php echo esc_attr($post['custom_parent_indicator_value']) ?>" style="float:none; margin:1px; margin-left:3px;" />
1304
- </div>
1305
- </span>
1306
- </div>
1307
- </div>
1308
- </div>
1309
- </div>
1310
- <div class="options_group">
1311
- <p class="form-field"><?php _e('Variable Enabled','pmxi_plugin');?></p>
1312
- <div class="input" style="margin-top:-10px;">
1313
- <div class="input fleft">
1314
- <input type="radio" id="product_enabled_yes" class="switcher" name="is_product_enabled" value="yes" <?php echo 'yes' == $post['is_product_enabled'] ? 'checked="checked"': '' ?>/>
1315
- <label for="product_enabled_yes"><?php _e("Yes"); ?></label>
1316
- </div>
1317
- <div class="input fleft">
1318
- <input type="radio" id="product_enabled_no" class="switcher" name="is_product_enabled" value="no" <?php echo 'no' == $post['is_product_enabled'] ? 'checked="checked"': '' ?>/>
1319
- <label for="product_enabled_no"><?php _e("No"); ?></label>
1320
- </div>
1321
- <div class="input fleft" style="position:relative; width:220px;">
1322
- <input type="radio" id="product_enabled_xpath" class="switcher" name="is_product_enabled" value="xpath" <?php echo 'xpath' == $post['is_product_enabled'] ? 'checked="checked"': '' ?>/>
1323
- <label for="product_enabled_xpath"><?php _e('Set with XPath', 'pmxi_plugin' )?></label><br>
1324
- <div class="switcher-target-product_enabled_xpath set_with_xpath">
1325
- <div class="input">
1326
- <input type="text" class="smaller-text" name="single_product_enabled" style="width:300px;" value="<?php echo esc_attr($post['single_product_enabled']) ?>"/>
1327
- <a href="#help" class="help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', 'pmxi_plugin') ?>" style="position:relative; top:2px;">?</a>
1328
- </div>
1329
  </div>
1330
  </div>
1331
  </div>
1332
- <div class="clear"></div>
1333
- <p class="form-field"><?php _e('Automaticaly set default selections','pmxi_plugin');?></p>
1334
- <div class="input" style="margin-top:-10px;">
1335
- <div class="input fleft">
1336
- <input type="radio" id="set_default_yes" name="is_default_attributes" value="1" <?php echo $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
1337
- <label for="set_default_yes"><?php _e("Yes"); ?></label>
1338
- </div>
1339
- <div class="input fleft">
1340
- <input type="radio" id="set_default_no" name="is_default_attributes" value="0" <?php echo ! $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
1341
- <label for="set_default_no"><?php _e("No"); ?></label>
1342
- </div>
1343
- </div>
1344
- </div>
1345
- </div><!-- End Product Panel -->
1346
-
1347
- <?php do_action('pmwi_tab_content'); ?>
1348
 
1349
- <!-- OPTIONS -->
1350
 
1351
- <div class="panel woocommerce_options_panel" id="add_on_options" style="display:none;">
1352
- <p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
1353
- <a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
1354
- </p>
1355
- <div class="options_group">
1356
- <p class="form-field" style="font-size:16px; font-weight:bold;"><?php _e('Import options','pmxi_plugin');?></p>
1357
- <div class="input" style="padding-left:20px;">
1358
- <input type="hidden" name="missing_records_stock_status" value="0" />
1359
- <input type="checkbox" id="missing_records_stock_status" name="missing_records_stock_status" value="1" <?php echo $post['missing_records_stock_status'] ? 'checked="checked"' : '' ?> />
1360
- <label for="missing_records_stock_status"><?php _e('Set out of stock status for missing records', 'pmxi_plugin') ?></label>
1361
- <a href="#help" class="help" title="<?php _e('Option to set the stock status to out of stock instead of deleting the product entirely. This option doesn\'t work when \'Delete missing records\' option is enabled.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
1362
- </div>
1363
- <div class="input" style="padding-left:20px;">
1364
- <input type="hidden" name="disable_auto_sku_generation" value="0" />
1365
- <input type="checkbox" id="disable_auto_sku_generation" name="disable_auto_sku_generation" value="1" <?php echo $post['disable_auto_sku_generation'] ? 'checked="checked"' : '' ?> />
1366
- <label for="disable_auto_sku_generation"><?php _e('Disable auto SKU generation', 'pmxi_plugin') ?></label>
1367
- <a href="#help" class="help" title="<?php _e('Plugin will NOT automaticaly generate the SKU for each product based on md5 algorithm, if SKU option is empty.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
1368
- </div>
1369
- <div class="input" style="padding-left:20px;">
1370
- <input type="hidden" name="disable_sku_matching" value="0" />
1371
- <input type="checkbox" id="disable_sku_matching" name="disable_sku_matching" value="1" <?php echo $post['disable_sku_matching'] ? 'checked="checked"' : '' ?> />
1372
- <label for="disable_sku_matching"><?php _e('Disable SKU matching', 'pmxi_plugin') ?></label>
1373
- <a href="#help" class="help" title="<?php _e('Plugin will NOT search matches for SKU. This option will speed up import process.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
1374
- </div>
1375
- <div class="input" style="padding-left:20px;">
1376
- <input type="hidden" name="disable_prepare_price" value="0" />
1377
- <input type="checkbox" id="disable_prepare_price" name="disable_prepare_price" value="1" <?php echo $post['disable_prepare_price'] ? 'checked="checked"' : '' ?> />
1378
- <label for="disable_prepare_price"><?php _e('Disable automatic fixing of improperly formatted prices.', 'pmxi_plugin') ?></label>
1379
- <a href="#help" class="help" title="<?php _e('Plugin will NOT fix prices that presented with currency symbol.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
1380
- </div>
1381
- </div>
1382
- <div class="options_group show_if_variable">
1383
- <div class="input" style="padding-left:20px;">
1384
- <input type="hidden" name="make_simple_product" value="0" />
1385
- <input type="checkbox" id="make_simple_product" name="make_simple_product" value="1" <?php echo $post['make_simple_product'] ? 'checked="checked"' : '' ?> />
1386
- <label for="make_simple_product"><?php _e('Create products with no variations as simple products.', 'pmxi_plugin') ?></label>
1387
- </div>
1388
- </div>
1389
- </div>
1390
- </div>
1391
  </div>
1392
  </div>
1393
-
1394
- <div class="clear"></div>
1395
-
1396
- </td>
1397
- </tr>
1
+ <div class="wpallimport-collapsed closed">
2
+ <div class="wpallimport-content-section">
3
+ <div class="wpallimport-collapsed-header">
4
+ <h3><?php _e('WooCommerce Add-On','pmxi_plugin');?></h3>
5
+ </div>
6
+ <div class="wpallimport-collapsed-content" style="padding:0;">
7
+ <div class="wpallimport-collapsed-content-inner">
8
+ <table class="form-table" style="max-width:none;">
9
+ <tr>
10
+ <td colspan="3">
11
+ <div class="postbox " id="woocommerce-product-data">
12
+ <h3 class="hndle" style="margin-top:0;">
13
+ <span>
14
+ <div class="main_choise" style="padding:0px; margin-right:0px;">
15
+ <input type="radio" id="multiple_product_type_yes" class="switcher" name="is_multiple_product_type" value="yes" <?php echo 'no' != $post['is_multiple_product_type'] ? 'checked="checked"': '' ?>/>
16
+ <label for="multiple_product_type_yes"><?php _e('Product Type', 'pmxi_plugin' )?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  </div>
18
+ <div class="switcher-target-multiple_product_type_yes" style="float:left;">
19
+ <div class="input">
20
+ <select name="multiple_product_type" id="product-type">
21
+ <optgroup label="Product Type">
22
+ <option value="simple" <?php echo 'simple' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('Simple product', 'woocommerce');?></option>
23
+ <option value="grouped" <?php echo 'grouped' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('Grouped product','woocommerce');?></option>
24
+ <option value="external" <?php echo 'external' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('External/Affiliate product','woocommerce');?></option>
25
+ <option value="variable" <?php echo 'variable' == $post['multiple_product_type'] ? 'selected="selected"': '' ?>><?php _e('Variable product','woocommerce');?></option>
26
+ </optgroup>
27
+ </select>
28
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  </div>
30
+ <div class="main_choise" style="padding:0px; margin-left:40px;">
31
+ <input type="radio" id="multiple_product_type_no" class="switcher" name="is_multiple_product_type" value="no" <?php echo 'no' == $post['is_multiple_product_type'] ? 'checked="checked"': '' ?> disabled="disabled"/>
32
+ <label for="multiple_product_type_no"><?php _e('Set Product Type With XPath', 'pmxi_plugin' )?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  </div>
34
+ <div class="switcher-target-multiple_product_type_no" style="float:left;">
35
+ <div class="input">
36
+ <input type="text" class="smaller-text" name="single_product_type" style="width:300px;" value="<?php echo esc_attr($post['single_product_type']) ?>"/>
37
+ <a href="#help" class="wpallimport-help" style="top: -1px;" title="<?php _e('The value of presented XPath should be one of the following: (\'simple\', \'grouped\', \'external\', \'variable\').', 'pmxi_plugin') ?>">?</a>
38
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
40
+ <div style="float:right;">
41
+ <label class="show_if_simple" for="_virtual" style="border-right:none;">
42
+ <input type="hidden" name="_virtual" value="0"/>
43
+ <?php _e('Virtual','woocommerce');?>: <input type="checkbox" id="_virtual" name="_virtual" <?php echo ($post['_virtual']) ? 'checked="checked"' : ''; ?>>
44
+ </label>
45
+ <label class="show_if_simple" for="_downloadable">
46
+ <input type="hidden" name="_downloadable" value="0"/>
47
+ <?php _e('Downloadable','woocommerce');?>: <input type="checkbox" id="_downloadable" name="_downloadable" <?php echo ($post['_downloadable']) ? 'checked="checked"' : ''; ?>>
48
+ </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  </div>
50
+ </span>
51
+ </h3>
52
+ <div class="clear"></div>
53
+ <div class="inside">
54
+ <div class="panel-wrap product_data">
55
 
56
+ <div class="wc-tabs-back"></div>
57
 
58
+ <ul style="" class="product_data_tabs wc-tabs">
 
 
 
 
59
 
60
+ <li class="general_options hide_if_grouped active"><a href="javascript:void(0);" rel="general_product_data"><?php _e('General','woocommerce');?></a></li>
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ <li class="inventory_tab show_if_simple show_if_variable show_if_grouped inventory_options" style="display: block;"><a href="javascript:void(0);" rel="inventory_product_data"><?php _e('Inventory', 'woocommerce');?></a></li>
 
 
 
 
 
 
 
 
 
63
 
64
+ <li class="shipping_tab hide_if_virtual shipping_options hide_if_grouped hide_if_external"><a href="javascript:void(0);" rel="shipping_product_data"><?php _e('Shipping', 'woocommerce');?></a></li>
 
 
 
 
 
 
 
 
65
 
66
+ <li class="linked_product_tab linked_product_options"><a href="javascript:void(0);" rel="linked_product_data"><?php _e('Linked Products', 'woocommerce');?></a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
+ <li class="attributes_tab attribute_options"><a href="javascript:void(0);" rel="woocommerce_attributes"><?php _e('Attributes','woocommerce');?></a></li>
69
 
70
+ <li class="advanced_tab advanced_options"><a href="javascript:void(0);" rel="advanced_product_data"><?php _e('Advanced','woocommerce');?></a></li>
 
 
 
 
71
 
72
+ <li class="variations_tab show_if_variable variation_options"><a title="Variations for variable products are defined here." href="javascript:void(0);" rel="variable_product_options"><?php _e('Variations','woocommerce');?></a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
+ <li class="options_tab advanced_options"><a title="Variations for variable products are defined here." href="javascript:void(0);" rel="add_on_options"><?php _e('Add-On Options', 'pmxi_plugin');?></a></li>
 
 
 
 
 
 
 
 
 
 
 
75
 
76
+ <?php //do_action('pmwi_tab_header'); ?>
 
77
 
78
+ </ul>
 
79
 
80
+ <!-- GENERAL -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
+ <?php include( '_tabs/_general.php' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
+ <!-- INVENTORY -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
+ <?php include( '_tabs/_inventory.php' ); ?>
87
 
88
+ <!-- SHIPPING -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
+ <?php include( '_tabs/_shipping.php' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
+ <!-- LINKED PRODUCT -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
+ <?php include( '_tabs/_linked_product.php' ); ?>
 
 
 
 
 
 
 
 
95
 
96
+ <!-- ATTRIBUTES -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
+ <?php include( '_tabs/_attributes.php' ); ?>
99
 
100
+ <!-- ADVANCED -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
+ <?php include( '_tabs/_advanced.php' ); ?>
103
 
104
+ <!-- VARIATIONS -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
+ <?php include( '_tabs/_variations.php' ); ?>
 
 
 
107
 
108
+ <!-- ADDITIONAL TABS -->
 
 
 
109
 
110
+ <?php do_action('pmwi_tab_content'); ?>
 
 
 
 
 
111
 
112
+ <!-- OPTIONS -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
+ <?php include( '_tabs/_options.php' ); ?>
115
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  </div>
117
  </div>
118
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
+ <div class="clear"></div>
121
 
122
+ </td>
123
+ </tr>
124
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </div>
126
  </div>
127
+ </div>
128
+ </div>