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

Version Description

  • bug fix: matching linked products didn't work properly, this functionality moved to the end of import process
  • bug fix: import download limit and download expiry are set to 1, instead of being provided empty values
  • bug fix: featured image not updated when only "Images" is set to be updated in "Choose which data to update"
Download this release

Release Info

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

Code changes from version 1.4.6 to 1.4.7

actions/pmxi_after_xml_import.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  /**
4
  * @param $importID
5
  *
@@ -102,6 +104,26 @@ function pmwi_pmxi_after_xml_import($importID) {
102
  }
103
  delete_option('wp_all_import_products_maybe_to_delete_' . $importID);
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  delete_option('wp_all_import_not_linked_products_' . $importID);
106
  // Regenerate product lookup tables.
107
  $regenerate_lookup_tables = TRUE;
1
  <?php
2
 
3
+ use wpai_woocommerce_add_on\libraries\importer\ImportProductBase;
4
+
5
  /**
6
  * @param $importID
7
  *
104
  }
105
  delete_option('wp_all_import_products_maybe_to_delete_' . $importID);
106
  }
107
+ // Associate linked products.
108
+ $wp_all_import_not_linked_products = get_option('wp_all_import_not_linked_products_' . $importID );
109
+ if (!empty($wp_all_import_not_linked_products)) {
110
+ foreach ($wp_all_import_not_linked_products as $product) {
111
+ if (!empty($product['not_linked_products'])) {
112
+ $linked_products = get_post_meta($product['pid'], $product['type'], TRUE);
113
+ if (empty($linked_products)) {
114
+ $linked_products = [];
115
+ }
116
+ foreach ($product['not_linked_products'] as $linked_product_identifier) {
117
+ // Trying to find linked product.
118
+ $linked_product_id = ImportProductBase::getProductIdByIdentifier($linked_product_identifier);
119
+ if ($linked_product_id && $linked_product_id != $product['pid'] ) {
120
+ $linked_products[] = $linked_product_id;
121
+ }
122
+ }
123
+ update_post_meta($product['pid'], $product['type'], array_unique($linked_products));
124
+ }
125
+ }
126
+ }
127
  delete_option('wp_all_import_not_linked_products_' . $importID);
128
  // Regenerate product lookup tables.
129
  $regenerate_lookup_tables = TRUE;
actions/pmxi_do_not_update_existing.php CHANGED
@@ -9,25 +9,54 @@
9
  */
10
  function pmwi_pmxi_do_not_update_existing($post_to_update_id, $import_id, $iteration) {
11
 
12
- $args = array(
13
- 'post_type' => 'product_variation',
14
- 'meta_query' => array(
15
- array(
16
- 'key' => '_sku',
17
- 'value' => get_post_meta($post_to_update_id, '_sku', true),
 
 
 
18
  )
19
- )
20
- );
21
- $query = new WP_Query( $args );
22
- if ( $query->have_posts() ){
23
- $duplicate_id = $query->post->ID;
24
- if ($duplicate_id) {
25
- $postRecord = new PMXI_Post_Record();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  $postRecord->clear();
27
- $postRecord->getBy(array(
28
- 'post_id' => $duplicate_id,
29
- 'import_id' => $import_id
30
- ));
 
 
 
 
 
 
 
 
 
31
  if ( ! $postRecord->isEmpty() ) $postRecord->set(array('iteration' => $iteration))->update();
32
  }
33
  }
9
  */
10
  function pmwi_pmxi_do_not_update_existing($post_to_update_id, $import_id, $iteration) {
11
 
12
+ if ( 'product_variation' == get_post_type($post_to_update_id) ) {
13
+
14
+ $args = array(
15
+ 'post_type' => 'product_variation',
16
+ 'meta_query' => array(
17
+ array(
18
+ 'key' => '_sku',
19
+ 'value' => get_post_meta($post_to_update_id, '_sku', true),
20
+ )
21
  )
22
+ );
23
+ $query = new WP_Query( $args );
24
+ if ( $query->have_posts() ){
25
+ $duplicate_id = $query->post->ID;
26
+ if ($duplicate_id) {
27
+ $postRecord = new PMXI_Post_Record();
28
+ $postRecord->clear();
29
+ $postRecord->getBy(array(
30
+ 'post_id' => $duplicate_id,
31
+ 'import_id' => $import_id
32
+ ));
33
+ if ( ! $postRecord->isEmpty() ) $postRecord->set(array('iteration' => $iteration))->update();
34
+ }
35
+ }
36
+
37
+ } else {
38
+
39
+ $import = new PMXI_Import_Record();
40
+
41
+ $import->getById($import_id);
42
+
43
+ if ( in_array($import->options['matching_parent'], array('first_is_parent_id', 'first_is_variation')) ) {
44
+
45
+ $postRecord = new \PMXI_Post_Record();
46
  $postRecord->clear();
47
+ // Find corresponding article among previously imported.
48
+ $postRecord->getBy(array(
49
+ 'unique_key' => 'Variation of ' . $post_to_update_id,
50
+ 'import_id' => $import_id
51
+ ));
52
+ // Backward compatibility for matching first variation by parent product SKU.
53
+ if ($postRecord->isEmpty()) {
54
+ $postRecord->getBy(array(
55
+ 'unique_key' => 'Variation ' . get_post_meta($post_to_update_id, '_sku', TRUE),
56
+ 'import_id' => $import_id
57
+ ));
58
+ }
59
+
60
  if ( ! $postRecord->isEmpty() ) $postRecord->set(array('iteration' => $iteration))->update();
61
  }
62
  }
filters/pmxi_custom_field_to_delete.php CHANGED
@@ -14,9 +14,13 @@
14
  */
15
  function pmwi_pmxi_custom_field_to_delete($field_to_delete, $pid, $post_type, $options, $cur_meta_key){
16
 
17
- if ($field_to_delete === false || $post_type != "product") return $field_to_delete;
 
 
18
 
19
- if (in_array($cur_meta_key, array('total_sales', '_stock_status'))) return false;
 
 
20
 
21
  if ($cur_meta_key == '_is_first_variation_created') {
22
  delete_post_meta($pid, $cur_meta_key);
@@ -24,55 +28,57 @@ function pmwi_pmxi_custom_field_to_delete($field_to_delete, $pid, $post_type, $o
24
  }
25
 
26
  // Do not update attributes.
27
- if ($options['update_all_data'] == 'no' && !$options['is_update_attributes'] && (in_array($cur_meta_key, array('_default_attributes', '_product_attributes')) || strpos($cur_meta_key, "attribute_") === 0)) return false;
28
-
 
29
  // Don't touch existing, only add new attributes.
30
- if ($options['update_all_data'] == 'no' && $options['is_update_attributes'] && $options['update_attributes_logic'] == 'add_new'){
31
- if (in_array($cur_meta_key, array('_default_attributes', '_product_attributes')) || strpos($cur_meta_key, "attribute_") === 0 ){
32
  return false;
33
  }
34
  }
35
 
36
  // Update only these Attributes, leave the rest alone.
37
- if ($options['update_all_data'] == 'no' && $options['is_update_attributes'] && $options['update_attributes_logic'] == 'only'){
38
-
39
- if ($cur_meta_key == '_product_attributes'){
40
  $current_product_attributes = get_post_meta($pid, '_product_attributes', true);
41
- if ( ! empty($current_product_attributes) && ! empty($options['attributes_list']) && is_array($options['attributes_list']))
42
- foreach ($current_product_attributes as $attr_name => $attr_value) {
43
- if ( in_array($attr_name, array_filter($options['attributes_list'], 'trim'))) unset($current_product_attributes[$attr_name]);
44
- }
45
-
46
  update_post_meta($pid, '_product_attributes', $current_product_attributes);
47
  return false;
48
  }
49
-
50
- if ( strpos($cur_meta_key, "attribute_") === 0 && !empty($options['attributes_list']) && is_array($options['attributes_list']) && !in_array(str_replace("attribute_", "", $cur_meta_key), array_filter($options['attributes_list'], 'trim'))) return false;
51
-
52
- if (in_array($cur_meta_key, array('_default_attributes'))) return false;
53
-
 
54
  }
55
 
56
  // Leave these attributes alone, update all other Attributes.
57
  if ($options['update_all_data'] == 'no' && $options['is_update_attributes'] && $options['update_attributes_logic'] == 'all_except') {
58
-
59
- if ($cur_meta_key == '_product_attributes'){
60
-
61
- if (empty($options['attributes_list'])) { delete_post_meta($pid, $cur_meta_key); return false; }
62
-
63
  $current_product_attributes = get_post_meta($pid, '_product_attributes', true);
64
- if ( ! empty($current_product_attributes) && ! empty($options['attributes_list']) && is_array($options['attributes_list']))
65
- foreach ($current_product_attributes as $attr_name => $attr_value) {
66
- if ( ! in_array($attr_name, array_filter($options['attributes_list'], 'trim'))) unset($current_product_attributes[$attr_name]);
67
- }
68
-
69
  update_post_meta($pid, '_product_attributes', $current_product_attributes);
70
  return false;
71
  }
72
-
73
- if ( strpos($cur_meta_key, "attribute_") === 0 && !empty($options['attributes_list']) && is_array($options['attributes_list']) && in_array(str_replace("attribute_", "", $cur_meta_key), array_filter($options['attributes_list'], 'trim'))) return false;
74
-
75
- if (in_array($cur_meta_key, array('_default_attributes'))) return false;
 
 
76
  }
77
 
78
  return true;
14
  */
15
  function pmwi_pmxi_custom_field_to_delete($field_to_delete, $pid, $post_type, $options, $cur_meta_key){
16
 
17
+ if ($field_to_delete === false || $post_type != "product") {
18
+ return $field_to_delete;
19
+ }
20
 
21
+ if (in_array($cur_meta_key, ['total_sales', '_stock_status'])) {
22
+ return false;
23
+ }
24
 
25
  if ($cur_meta_key == '_is_first_variation_created') {
26
  delete_post_meta($pid, $cur_meta_key);
28
  }
29
 
30
  // Do not update attributes.
31
+ if ($options['update_all_data'] == 'no' && !$options['is_update_attributes'] && (in_array($cur_meta_key, array('_default_attributes', '_product_attributes')) || strpos($cur_meta_key, "attribute_") === 0)) {
32
+ return false;
33
+ }
34
  // Don't touch existing, only add new attributes.
35
+ if ($options['update_all_data'] == 'no' && $options['is_update_attributes'] && $options['update_attributes_logic'] == 'add_new') {
36
+ if (in_array($cur_meta_key, array('_default_attributes', '_product_attributes')) || strpos($cur_meta_key, "attribute_") === 0 ) {
37
  return false;
38
  }
39
  }
40
 
41
  // Update only these Attributes, leave the rest alone.
42
+ if ($options['update_all_data'] == 'no' && $options['is_update_attributes'] && $options['update_attributes_logic'] == 'only') {
43
+ if ($cur_meta_key == '_product_attributes') {
 
44
  $current_product_attributes = get_post_meta($pid, '_product_attributes', true);
45
+ if ( ! empty($current_product_attributes) && ! empty($options['attributes_list']) && is_array($options['attributes_list'])) {
46
+ foreach ($current_product_attributes as $attr_name => $attr_value) {
47
+ if ( in_array($attr_name, array_filter($options['attributes_list'], 'trim'))) unset($current_product_attributes[$attr_name]);
48
+ }
49
+ }
50
  update_post_meta($pid, '_product_attributes', $current_product_attributes);
51
  return false;
52
  }
53
+ if ( strpos($cur_meta_key, "attribute_") === 0 && !empty($options['attributes_list']) && is_array($options['attributes_list']) && !in_array(str_replace("attribute_", "", $cur_meta_key), array_filter($options['attributes_list'], 'trim'))) {
54
+ return false;
55
+ }
56
+ if (in_array($cur_meta_key, array('_default_attributes'))) {
57
+ return false;
58
+ }
59
  }
60
 
61
  // Leave these attributes alone, update all other Attributes.
62
  if ($options['update_all_data'] == 'no' && $options['is_update_attributes'] && $options['update_attributes_logic'] == 'all_except') {
63
+ if ($cur_meta_key == '_product_attributes') {
64
+ if (empty($options['attributes_list'])) {
65
+ delete_post_meta($pid, $cur_meta_key); return false;
66
+ }
 
67
  $current_product_attributes = get_post_meta($pid, '_product_attributes', true);
68
+ if ( ! empty($current_product_attributes) && ! empty($options['attributes_list']) && is_array($options['attributes_list'])) {
69
+ foreach ($current_product_attributes as $attr_name => $attr_value) {
70
+ if ( ! in_array($attr_name, array_filter($options['attributes_list'], 'trim'))) unset($current_product_attributes[$attr_name]);
71
+ }
72
+ }
73
  update_post_meta($pid, '_product_attributes', $current_product_attributes);
74
  return false;
75
  }
76
+ if ( strpos($cur_meta_key, "attribute_") === 0 && !empty($options['attributes_list']) && is_array($options['attributes_list']) && in_array(str_replace("attribute_", "", $cur_meta_key), array_filter($options['attributes_list'], 'trim'))) {
77
+ return false;
78
+ }
79
+ if (in_array($cur_meta_key, array('_default_attributes'))) {
80
+ return false;
81
+ }
82
  }
83
 
84
  return true;
libraries/XmlImportWooCommerceService.php CHANGED
@@ -184,7 +184,6 @@ final class XmlImportWooCommerceService {
184
  }
185
  }
186
  }
187
- // $variation_attributes = $product->get_variation_attributes();
188
  foreach ($parentAttributes as $name => $parentAttribute) {
189
  // Only in case if attribute marked to import as taxonomy terms.
190
  if ($parentAttribute['is_taxonomy']) {
@@ -258,6 +257,11 @@ final class XmlImportWooCommerceService {
258
  }
259
  }
260
  }
 
 
 
 
 
261
  }
262
  }
263
  $product->set_default_attributes($defaultAttributes);
@@ -287,6 +291,7 @@ final class XmlImportWooCommerceService {
287
  }
288
  }
289
  }
 
290
  }
291
 
292
  update_post_meta($product->get_id(), '_product_attributes', $parentAttributes);
@@ -546,6 +551,9 @@ final class XmlImportWooCommerceService {
546
  public function pushMeta($pid, $meta_key, $meta_value, $isNewPost = TRUE) {
547
  if (!empty($meta_key) && ($isNewPost || $this->isUpdateCustomField($meta_key))) {
548
  update_post_meta($pid, $meta_key, $meta_value);
 
 
 
549
  }
550
  }
551
 
184
  }
185
  }
186
  }
 
187
  foreach ($parentAttributes as $name => $parentAttribute) {
188
  // Only in case if attribute marked to import as taxonomy terms.
189
  if ($parentAttribute['is_taxonomy']) {
257
  }
258
  }
259
  }
260
+ } else {
261
+ $default_attributes = $this->getOriginallyParsedData($product->get_id(), '_default_attributes');
262
+ if (!empty($default_attributes)) {
263
+ $defaultAttributes = maybe_unserialize($default_attributes);
264
+ }
265
  }
266
  }
267
  $product->set_default_attributes($defaultAttributes);
291
  }
292
  }
293
  }
294
+ delete_post_meta($firstVariationID, '_variation_updated');
295
  }
296
 
297
  update_post_meta($product->get_id(), '_product_attributes', $parentAttributes);
551
  public function pushMeta($pid, $meta_key, $meta_value, $isNewPost = TRUE) {
552
  if (!empty($meta_key) && ($isNewPost || $this->isUpdateCustomField($meta_key))) {
553
  update_post_meta($pid, $meta_key, $meta_value);
554
+ } elseif (in_array($meta_key, ['_product_image_gallery']) && $this->isUpdateDataAllowed('is_update_images', $isNewPost)) {
555
+ // Update gallery custom field if images is set to be updated.
556
+ update_post_meta($pid, $meta_key, $meta_value);
557
  }
558
  }
559
 
libraries/importer/ProductsImporter.php CHANGED
@@ -94,8 +94,7 @@ class ProductsImporter extends Importer {
94
  }
95
  }
96
  $post_to_update_id = $p->post_parent;
97
- }
98
- else {
99
  // Unset missing attributes.
100
  $product_attributes = get_post_meta( $this->getPid(), '_product_attributes', TRUE );
101
  $attributes = $this->getImportService()->getProductTaxonomies();
@@ -106,36 +105,8 @@ class ProductsImporter extends Importer {
106
  }
107
  }
108
  }
109
-
110
  update_post_meta( $this->getPid(), '_product_version', WC_VERSION );
111
-
112
  $post_to_update_id = $this->getPid();
113
-
114
- // Associate linked products.
115
- $wp_all_import_not_linked_products = get_option('wp_all_import_not_linked_products_' . $this->getImport()->id );
116
- if (!empty($wp_all_import_not_linked_products)) {
117
- $post_to_update_sku = get_post_meta($post_to_update_id, '_sku', TRUE);
118
- foreach ($wp_all_import_not_linked_products as $product) {
119
- if ($product['pid'] != $post_to_update_id && ! empty($product['not_linked_products'])) {
120
- if ( in_array($post_to_update_sku, $product['not_linked_products'])
121
- || in_array( (string) $post_to_update_id, $product['not_linked_products'])
122
- || in_array($p->post_title, $product['not_linked_products'])
123
- || in_array($p->post_name, $product['not_linked_products'])
124
- )
125
- {
126
- $linked_products = get_post_meta($product['pid'], $product['type'], TRUE);
127
- if (empty($linked_products)) {
128
- $linked_products = array();
129
- }
130
- if ( ! in_array($post_to_update_id, $linked_products)) {
131
- $linked_products[] = $post_to_update_id;
132
- $this->getLogger() && call_user_func($this->getLogger(), sprintf(__('Added to %s list of product ID %d.', \PMWI_Plugin::TEXT_DOMAIN), $product['type'] == '_upsell_ids' ? 'Up-Sells' : 'Cross-Sells', $product['pid']) );
133
- update_post_meta($product['pid'], $product['type'], $linked_products);
134
- }
135
- }
136
- }
137
- }
138
- }
139
  }
140
 
141
  if ($post_to_update_id){
@@ -143,9 +114,16 @@ class ProductsImporter extends Importer {
143
  $postRecord->clear();
144
  // Find corresponding article among previously imported.
145
  $postRecord->getBy(array(
146
- 'unique_key' => 'Variation ' . get_post_meta($post_to_update_id, '_sku', TRUE),
147
- 'import_id' => $this->getImport()->id,
148
  ));
 
 
 
 
 
 
 
149
  $pid = ( ! $postRecord->isEmpty() ) ? $postRecord->post_id : FALSE;
150
  // Update first variation.
151
  if ( $pid ) {
94
  }
95
  }
96
  $post_to_update_id = $p->post_parent;
97
+ } else {
 
98
  // Unset missing attributes.
99
  $product_attributes = get_post_meta( $this->getPid(), '_product_attributes', TRUE );
100
  $attributes = $this->getImportService()->getProductTaxonomies();
105
  }
106
  }
107
  }
 
108
  update_post_meta( $this->getPid(), '_product_version', WC_VERSION );
 
109
  $post_to_update_id = $this->getPid();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  if ($post_to_update_id){
114
  $postRecord->clear();
115
  // Find corresponding article among previously imported.
116
  $postRecord->getBy(array(
117
+ 'unique_key' => 'Variation of ' . $post_to_update_id,
118
+ 'import_id' => $this->getImport()->id
119
  ));
120
+ // Backward compatibility for matching first variation by parent product SKU.
121
+ if ($postRecord->isEmpty()) {
122
+ $postRecord->getBy(array(
123
+ 'unique_key' => 'Variation ' . get_post_meta($post_to_update_id, '_sku', TRUE),
124
+ 'import_id' => $this->getImport()->id
125
+ ));
126
+ }
127
  $pid = ( ! $postRecord->isEmpty() ) ? $postRecord->post_id : FALSE;
128
  // Update first variation.
129
  if ( $pid ) {
libraries/importer/products/ImportProduct.php CHANGED
@@ -155,15 +155,11 @@ abstract class ImportProduct extends ImportProductBase {
155
  public function prepareDownloadableProperties(){
156
  // Downloadable options.
157
  if ( $this->isDownloadable() ) {
158
- $_download_limit = absint( $this->getValue('product_download_limit') );
159
- if (!$_download_limit) {
160
- $_download_limit = ''; // 0 or blank = unlimited
161
- }
162
  $this->setProperty('download_limit', $_download_limit);
163
- $_download_expiry = absint( $this->getValue('product_download_expiry') );
164
- if (!$_download_expiry) {
165
- $_download_expiry = ''; // 0 or blank = unlimited
166
- }
167
  $this->setProperty('download_expiry', $_download_expiry);
168
  // File paths will be stored in an array keyed off md5(file path).
169
  if ($this->getValue('product_files')) {
@@ -276,12 +272,12 @@ abstract class ImportProduct extends ImportProductBase {
276
  public function prepareLinkedProducts() {
277
  // Upsells.
278
  if ($this->isNewProduct() || $this->getImportService()->isUpdateCustomField('_upsell_ids')) {
279
- $linked = $this->getLinkedProducts($this->getPid(), $this->getValue('product_up_sells'), '_upsell_ids');
280
  $this->productProperties['upsell_ids'] = $linked;
281
  }
282
  // Cross sells.
283
  if ($this->isNewProduct() || $this->getImportService()->isUpdateCustomField('_crosssell_ids')) {
284
- $linked = $this->getLinkedProducts($this->getPid(), $this->getValue('product_cross_sells'), '_crosssell_ids');
285
  $this->productProperties['cross_sell_ids'] = $linked;
286
  }
287
  // Grouping.
@@ -297,6 +293,10 @@ abstract class ImportProduct extends ImportProductBase {
297
  }
298
  $attributes = $this->getAttributesProperties();
299
  $this->setProperty('attributes', $attributes);
 
 
 
 
300
  }
301
 
302
  /**
@@ -360,7 +360,7 @@ abstract class ImportProduct extends ImportProductBase {
360
  if ( isset( $attribute['value']) ) {
361
  $values = array_map('stripslashes', array_map( 'strip_tags', explode( $attributes_delimiter, $attribute['value'])));
362
  // Remove empty items in the array.
363
- $values = array_filter( $values, array($this, "filtering") );
364
  if (intval($attribute['is_create_taxonomy_terms'])){
365
  $real_attr_name = $this->getImportService()->getTaxonomiesService()->createTaxonomy($real_attr_name);
366
  $attributeName = wc_attribute_taxonomy_name( $real_attr_name );
@@ -369,17 +369,23 @@ abstract class ImportProduct extends ImportProductBase {
369
  $attr_values = array();
370
  foreach ($values as $key => $val) {
371
  $value = substr($val, 0, $max_attribute_length);
 
372
  $term = get_term_by('name', $value, wc_attribute_taxonomy_name( $real_attr_name ), ARRAY_A);
373
  // For compatibility with WPML plugin.
374
  $term = apply_filters('wp_all_import_term_exists', $term, wc_attribute_taxonomy_name( $real_attr_name ), $value, null);
375
- if ( empty($term) && !is_wp_error($term) ){
376
- $term = is_exists_term($value, wc_attribute_taxonomy_name( $real_attr_name ));
377
- if ( empty($term) && !is_wp_error($term) ){
378
- $term = is_exists_term(htmlspecialchars($value), wc_attribute_taxonomy_name( $real_attr_name ));
379
- if ( empty($term) && !is_wp_error($term) && intval($attribute['is_create_taxonomy_terms'])){
 
 
 
 
380
  $term = wp_insert_term(
381
  $value, // the term
382
- wc_attribute_taxonomy_name( $real_attr_name ) // the taxonomy
 
383
  );
384
  }
385
  }
@@ -391,8 +397,7 @@ abstract class ImportProduct extends ImportProductBase {
391
  $values = $attr_values;
392
  $values = array_map( 'intval', $values );
393
  $values = array_unique( $values );
394
- }
395
- else{
396
  $values = array();
397
  }
398
  }
@@ -483,8 +488,7 @@ abstract class ImportProduct extends ImportProductBase {
483
  $term = is_exists_term( $shipping_class, 'product_shipping_class');
484
  // For compatibility with WPML plugin.
485
  $term = apply_filters('wp_all_import_term_exists', $term, 'product_shipping_class', $shipping_class, null);
486
- }
487
- else {
488
  $term = is_exists_term( (int) $shipping_class, 'product_shipping_class');
489
  if (empty($term) || is_wp_error($term)) {
490
  $term = is_exists_term( $shipping_class, 'product_shipping_class');
@@ -493,8 +497,7 @@ abstract class ImportProduct extends ImportProductBase {
493
  // The term to check. Accepts term ID, slug, or name.
494
  if (!empty($term) && !is_wp_error($term)){
495
  $shipping_class = (int) $term['term_id'];
496
- }
497
- else {
498
  $term = wp_insert_term($shipping_class, 'product_shipping_class');
499
  if (!empty($term) && !is_wp_error($term)) {
500
  $shipping_class = (int) $term['term_id'];
@@ -684,6 +687,16 @@ abstract class ImportProduct extends ImportProductBase {
684
  $this->productProperties[$property] = $value;
685
  }
686
  break;
 
 
 
 
 
 
 
 
 
 
687
  case 'description':
688
  if ($this->isNewProduct() || $this->getImportService()->isUpdateCustomField('_variation_description')) {
689
  $this->productProperties[$property] = $value;
155
  public function prepareDownloadableProperties(){
156
  // Downloadable options.
157
  if ( $this->isDownloadable() ) {
158
+ $_download_limit = $this->getValue('product_download_limit');
159
+ $_download_limit = -1 === (int) $_download_limit || '' === $_download_limit ? -1 : absint( $_download_limit );
 
 
160
  $this->setProperty('download_limit', $_download_limit);
161
+ $_download_expiry = $this->getValue('product_download_expiry');
162
+ $_download_expiry = -1 === (int) $_download_expiry || '' === $_download_expiry ? -1 : absint( $_download_expiry );
 
 
163
  $this->setProperty('download_expiry', $_download_expiry);
164
  // File paths will be stored in an array keyed off md5(file path).
165
  if ($this->getValue('product_files')) {
272
  public function prepareLinkedProducts() {
273
  // Upsells.
274
  if ($this->isNewProduct() || $this->getImportService()->isUpdateCustomField('_upsell_ids')) {
275
+ $linked = $this->getLinkedProducts($this->getValue('product_up_sells'), '_upsell_ids');
276
  $this->productProperties['upsell_ids'] = $linked;
277
  }
278
  // Cross sells.
279
  if ($this->isNewProduct() || $this->getImportService()->isUpdateCustomField('_crosssell_ids')) {
280
+ $linked = $this->getLinkedProducts($this->getValue('product_cross_sells'), '_crosssell_ids');
281
  $this->productProperties['cross_sell_ids'] = $linked;
282
  }
283
  // Grouping.
293
  }
294
  $attributes = $this->getAttributesProperties();
295
  $this->setProperty('attributes', $attributes);
296
+ $default_attributes = $this->getValue('default_attributes_type');
297
+ if ($default_attributes && !in_array($default_attributes, ['first', 'instock'])) {
298
+ $this->setProperty('_default_attributes', $default_attributes);
299
+ }
300
  }
301
 
302
  /**
360
  if ( isset( $attribute['value']) ) {
361
  $values = array_map('stripslashes', array_map( 'strip_tags', explode( $attributes_delimiter, $attribute['value'])));
362
  // Remove empty items in the array.
363
+ $values = array_filter( $values, [$this, "filtering"] );
364
  if (intval($attribute['is_create_taxonomy_terms'])){
365
  $real_attr_name = $this->getImportService()->getTaxonomiesService()->createTaxonomy($real_attr_name);
366
  $attributeName = wc_attribute_taxonomy_name( $real_attr_name );
369
  $attr_values = array();
370
  foreach ($values as $key => $val) {
371
  $value = substr($val, 0, $max_attribute_length);
372
+ $term_slug = sanitize_title(str_replace('#', '_', $value));
373
  $term = get_term_by('name', $value, wc_attribute_taxonomy_name( $real_attr_name ), ARRAY_A);
374
  // For compatibility with WPML plugin.
375
  $term = apply_filters('wp_all_import_term_exists', $term, wc_attribute_taxonomy_name( $real_attr_name ), $value, null);
376
+ if ( empty($term) && !is_wp_error($term) ) {
377
+ $term = is_exists_term($term_slug, wc_attribute_taxonomy_name( $real_attr_name ));
378
+ if ( empty($term) && !is_wp_error($term) ) {
379
+ $term = is_exists_term(htmlspecialchars($term_slug), wc_attribute_taxonomy_name( $real_attr_name ));
380
+ if ( empty($term) && !is_wp_error($term) && intval($attribute['is_create_taxonomy_terms'])) {
381
+ $term_options = [];
382
+ if (strpos($value, '#') !== FALSE) {
383
+ $term_options['slug'] = $term_slug;
384
+ }
385
  $term = wp_insert_term(
386
  $value, // the term
387
+ wc_attribute_taxonomy_name( $real_attr_name ), // the taxonomy
388
+ $term_options
389
  );
390
  }
391
  }
397
  $values = $attr_values;
398
  $values = array_map( 'intval', $values );
399
  $values = array_unique( $values );
400
+ } else {
 
401
  $values = array();
402
  }
403
  }
488
  $term = is_exists_term( $shipping_class, 'product_shipping_class');
489
  // For compatibility with WPML plugin.
490
  $term = apply_filters('wp_all_import_term_exists', $term, 'product_shipping_class', $shipping_class, null);
491
+ } else {
 
492
  $term = is_exists_term( (int) $shipping_class, 'product_shipping_class');
493
  if (empty($term) || is_wp_error($term)) {
494
  $term = is_exists_term( $shipping_class, 'product_shipping_class');
497
  // The term to check. Accepts term ID, slug, or name.
498
  if (!empty($term) && !is_wp_error($term)){
499
  $shipping_class = (int) $term['term_id'];
500
+ } else {
 
501
  $term = wp_insert_term($shipping_class, 'product_shipping_class');
502
  if (!empty($term) && !is_wp_error($term)) {
503
  $shipping_class = (int) $term['term_id'];
687
  $this->productProperties[$property] = $value;
688
  }
689
  break;
690
+ case 'reviews_allowed':
691
+ if ($this->getImportService()->isUpdateDataAllowed('is_update_comment_status', $this->isNewProduct())) {
692
+ $this->productProperties[$property] = $value;
693
+ }
694
+ break;
695
+ case 'shipping_class_id':
696
+ if ($this->getImportService()->isUpdateTaxonomy('product_shipping_class', $this->isNewProduct())) {
697
+ $this->productProperties[$property] = $value;
698
+ }
699
+ break;
700
  case 'description':
701
  if ($this->isNewProduct() || $this->getImportService()->isUpdateCustomField('_variation_description')) {
702
  $this->productProperties[$property] = $value;
libraries/importer/products/ImportProductBase.php CHANGED
@@ -84,79 +84,29 @@ abstract class ImportProductBase extends ImportBase {
84
  *
85
  * Get list of Linked Product IDs.
86
  *
87
- * @param $pid - Current product ID.
88
  * @param $products - Products which needs to be linked.
89
  * @param $type
90
  *
91
  * @return array
92
  */
93
- protected function getLinkedProducts($pid, $products, $type) {
94
  $linked_products = array();
95
  if (!empty($products)) {
96
  $not_found = [];
97
- $ids = array_filter(explode(',', $products), 'trim');
 
98
  foreach ($ids as $id) {
99
  // Do not link product to himself.
100
- if ($id == $pid) continue;
101
- // Search linked product by _SKU.
102
- $args = [
103
- 'post_type' => ['product', 'product_variation'],
104
- 'meta_query' => [
105
- [
106
- 'key' => '_sku',
107
- 'value' => $id,
108
- ]
109
- ]
110
- ];
111
- $query = new \WP_Query($args);
112
- $linked_product = FALSE;
113
- if ($query->have_posts()) {
114
- $linked_product = get_post($query->post->ID);
115
- }
116
- wp_reset_postdata();
117
- if (!$linked_product) {
118
- if (is_numeric($id)) {
119
- // Search linked product by ID.
120
- $query = new \WP_Query([
121
- 'post_type' => [
122
- 'product',
123
- 'product_variation'
124
- ],
125
- 'post__in' => [$id]
126
- ]);
127
- if ($query->have_posts()) {
128
- $linked_product = get_post($query->post->ID);
129
- }
130
- wp_reset_postdata();
131
- }
132
- if (!$linked_product) {
133
- // Search linked product by slug.
134
- $args = [
135
- 'name' => $id,
136
- 'post_type' => 'product',
137
- 'post_status' => 'publish',
138
- 'numberposts' => 1
139
- ];
140
- $query = get_posts($args);
141
- if ($query) {
142
- $linked_product = $query[0];
143
- }
144
- wp_reset_postdata();
145
- if (!$linked_product) {
146
- // Search linked product by title.
147
- $linked_product = get_page_by_title( $id, OBJECT, 'product' );
148
- }
149
- }
150
- }
151
- if ($linked_product) {
152
  // Do not link product to himself.
153
- if ($pid == $linked_product->ID) {
154
  continue;
155
  }
156
- $linked_products[] = $linked_product->ID;
157
- $this->getLogger() and call_user_func($this->getLogger(), sprintf(__('Product `%s` with ID `%d` added to %s list.', \PMWI_Plugin::TEXT_DOMAIN), $linked_product->post_title, $linked_product->ID, $type == '_upsell_ids' ? 'Up-Sells' : 'Cross-Sells'));
158
- }
159
- else {
160
  $not_found[] = $id;
161
  }
162
  }
@@ -168,7 +118,7 @@ abstract class ImportProductBase extends ImportBase {
168
  $not_founded_linked_products = [];
169
  }
170
  $not_founded_linked_products[] = [
171
- 'pid' => $pid,
172
  'type' => $type,
173
  'not_linked_products' => $not_found
174
  ];
@@ -178,6 +128,55 @@ abstract class ImportProductBase extends ImportBase {
178
  return $linked_products;
179
  }
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  /**
182
  * @param $url
183
  */
84
  *
85
  * Get list of Linked Product IDs.
86
  *
 
87
  * @param $products - Products which needs to be linked.
88
  * @param $type
89
  *
90
  * @return array
91
  */
92
+ protected function getLinkedProducts($products, $type) {
93
  $linked_products = array();
94
  if (!empty($products)) {
95
  $not_found = [];
96
+ $ids = array_filter(explode(',', $products));
97
+ $ids = array_map('trim', $ids);
98
  foreach ($ids as $id) {
99
  // Do not link product to himself.
100
+ if ($id == $this->getPid()) continue;
101
+ $linked_product_id = self::getProductIdByIdentifier($id);
102
+ if ($linked_product_id) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  // Do not link product to himself.
104
+ if ($this->getPid() == $linked_product_id) {
105
  continue;
106
  }
107
+ $linked_products[] = $linked_product_id;
108
+ $this->getLogger() and call_user_func($this->getLogger(), sprintf(__('Product with ID `%d` added to %s list.', \PMWI_Plugin::TEXT_DOMAIN), $linked_product_id, $type == '_upsell_ids' ? 'Up-Sells' : 'Cross-Sells'));
109
+ } else {
 
110
  $not_found[] = $id;
111
  }
112
  }
118
  $not_founded_linked_products = [];
119
  }
120
  $not_founded_linked_products[] = [
121
+ 'pid' => $this->getPid(),
122
  'type' => $type,
123
  'not_linked_products' => $not_found
124
  ];
128
  return $linked_products;
129
  }
130
 
131
+ /**
132
+ * Get product or variation ID by identifier.
133
+ *
134
+ * @param $identifier
135
+ * @return false|int
136
+ */
137
+ public static function getProductIdByIdentifier($identifier) {
138
+ // Trying to find linked product by _sku.
139
+ $product_id = wc_get_product_id_by_sku($identifier);
140
+ // Trying to find linked product by ID, slug or title.
141
+ if (!$product_id) {
142
+ // Trying to find linked product by ID.
143
+ if (is_numeric($identifier)) {
144
+ // Search linked product by ID.
145
+ $query = new \WP_Query([
146
+ 'post_type' => [
147
+ 'product',
148
+ 'product_variation'
149
+ ],
150
+ 'post__in' => [$identifier]
151
+ ]);
152
+ if ($query->have_posts()) {
153
+ $product_id = $query->post->ID;
154
+ }
155
+ }
156
+ if (!$product_id) {
157
+ // Search linked product by slug.
158
+ $args = [
159
+ 'name' => $identifier,
160
+ 'post_type' => 'product',
161
+ 'post_status' => 'publish',
162
+ 'numberposts' => 1
163
+ ];
164
+ $query = get_posts($args);
165
+ if ($query) {
166
+ $product_id = $query[0]->ID;
167
+ }
168
+ }
169
+ if (!$product_id) {
170
+ // Search linked product by title.
171
+ $product = get_page_by_title( $identifier, OBJECT, 'product' );
172
+ if ($product && !is_wp_error($product)) {
173
+ $product_id = $product->ID;
174
+ }
175
+ }
176
+ }
177
+ return $product_id ? $product_id : FALSE;
178
+ }
179
+
180
  /**
181
  * @param $url
182
  */
libraries/parser/Parser.php CHANGED
@@ -205,8 +205,10 @@ abstract class Parser implements ParserInterface {
205
  * Remove all temporary created files.
206
  */
207
  public function unlinkTempFiles() {
208
- foreach ($this->tmp_files as $file) { // remove all temporary files created
209
- unlink($file);
 
 
210
  }
211
  $this->tmp_files = array();
212
  }
205
  * Remove all temporary created files.
206
  */
207
  public function unlinkTempFiles() {
208
+ if (!empty($this->tmp_files)) {
209
+ foreach ($this->tmp_files as $file) { // remove all temporary files created
210
+ unlink($file);
211
+ }
212
  }
213
  $this->tmp_files = array();
214
  }
libraries/parser/ProductsParser.php CHANGED
@@ -119,7 +119,8 @@ class ProductsParser extends ProductsParserBase {
119
  protected function getOptionsType_6() {
120
  return array(
121
  'product_allow_backorders' => 'single_product_allow_backorders',
122
- 'product_sold_individually' => 'single_product_sold_individually'
 
123
  );
124
  }
125
  }
119
  protected function getOptionsType_6() {
120
  return array(
121
  'product_allow_backorders' => 'single_product_allow_backorders',
122
+ 'product_sold_individually' => 'single_product_sold_individually',
123
+ 'default_attributes_type' => 'default_attributes_xpath'
124
  );
125
  }
126
  }
libraries/parser/ProductsParserBase.php CHANGED
@@ -32,12 +32,10 @@ abstract class ProductsParserBase extends Parser {
32
  $this->data[$option] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options[$s_option], $file)
33
  ->parse();
34
  $this->tmp_files[] = $file;
35
- }
36
- else {
37
  $this->getCount() and $this->data[$option] = array_fill(0, $this->getCount(), $this->getImport()->options[$m_option]);
38
  }
39
- }
40
- catch (\Exception $e) {
41
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
42
  }
43
  }
@@ -62,12 +60,10 @@ abstract class ProductsParserBase extends Parser {
62
  $this->data['single_' . preg_replace("%id$%", "ID", $option)] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_' . $option], $file)
63
  ->parse();
64
  $this->tmp_files[] = $file;
65
- }
66
- else {
67
  $this->getCount() and $this->data['single_' . preg_replace("%id$%", "ID", $option)] = array_fill(0, $this->getCount(), "");
68
  }
69
- }
70
- catch (\Exception $e) {
71
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
72
  }
73
  }
@@ -99,12 +95,10 @@ abstract class ProductsParserBase extends Parser {
99
  default:
100
  break;
101
  }
102
- }
103
- else {
104
  $this->getCount() and $this->data[$option] = array_fill(0, $this->getCount(), "");
105
  }
106
- }
107
- catch (\Exception $e) {
108
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
109
  }
110
  }
@@ -120,12 +114,10 @@ abstract class ProductsParserBase extends Parser {
120
  $this->data['product_' . $option] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_' . $option], $file)
121
  ->parse();
122
  $this->tmp_files[] = $file;
123
- }
124
- else {
125
  $this->getCount() and $this->data['product_' . $option] = array_fill(0, $this->getCount(), "");
126
  }
127
- }
128
- catch (\Exception $e) {
129
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
130
  }
131
  }
@@ -142,12 +134,10 @@ abstract class ProductsParserBase extends Parser {
142
  $this->data['product_' . $option_name] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_product_' . $option], $file)
143
  ->parse();
144
  $this->tmp_files[] = $file;
145
- }
146
- else {
147
  $this->getCount() and $this->data['product_' . $option_name] = array_fill(0, $this->getCount(), $this->getImport()->options['multiple_product_' . $option]);
148
  }
149
- }
150
- catch (\Exception $e) {
151
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
152
  }
153
  }
@@ -204,12 +194,10 @@ abstract class ProductsParserBase extends Parser {
204
  $this->data['v_stock'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['variation_stock'], $file)
205
  ->parse();
206
  $this->tmp_files[] = $file;
207
- }
208
- else {
209
  $this->getCount() and $this->data['v_stock'] = array_fill(0, $this->getCount(), '');
210
  }
211
- }
212
- catch (\Exception $e) {
213
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
214
  }
215
  }
@@ -225,12 +213,10 @@ abstract class ProductsParserBase extends Parser {
225
  $this->data['product_grouping_parent'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_grouping_product'], $file)
226
  ->parse();
227
  $this->tmp_files[] = $file;
228
- }
229
- else {
230
  $this->getCount() and $this->data['product_grouping_parent'] = array_fill(0, $this->getCount(), $this->getImport()->options['multiple_grouping_product']);
231
  }
232
- }
233
- else {
234
  if ("" != $this->getImport()->options['custom_grouping_indicator_name'] and "" != $this->getImport()->options['custom_grouping_indicator_value']) {
235
  $this->data['custom_grouping_indicator_name'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['custom_grouping_indicator_name'], $file)
236
  ->parse();
@@ -238,18 +224,15 @@ abstract class ProductsParserBase extends Parser {
238
  $this->data['custom_grouping_indicator_value'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['custom_grouping_indicator_value'], $file)
239
  ->parse();
240
  $this->tmp_files[] = $file;
241
- }
242
- else {
243
  $this->getCount() and $this->data['custom_grouping_indicator_name'] = array_fill(0, $this->getCount(), "");
244
  $this->getCount() and $this->data['custom_grouping_indicator_value'] = array_fill(0, $this->getCount(), "");
245
  }
246
  }
247
- }
248
- else {
249
  $this->getCount() and $this->data['product_grouping_parent'] = array_fill(0, $this->getCount(), $this->getImport()->options['multiple_grouping_product']);
250
  }
251
- }
252
- catch (\Exception $e) {
253
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
254
  }
255
  }
@@ -265,8 +248,7 @@ abstract class ProductsParserBase extends Parser {
265
  ->parse();
266
  $this->tmp_files[] = $file;
267
  }
268
- }
269
- else {
270
  if ("" != $this->getImport()->options['existing_parent_product_cf_name'] and "" != $this->getImport()->options['existing_parent_product_cf_value']) {
271
  $this->data['existing_parent_product_cf_name'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['existing_parent_product_cf_name'], $file)
272
  ->parse();
@@ -276,8 +258,7 @@ abstract class ProductsParserBase extends Parser {
276
  $this->tmp_files[] = $file;
277
  }
278
  }
279
- }
280
- catch (\Exception $e) {
281
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
282
  }
283
  }
@@ -292,24 +273,20 @@ abstract class ProductsParserBase extends Parser {
292
  $this->data['product_stock_status'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_product_stock_status'], $file)
293
  ->parse();
294
  $this->tmp_files[] = $file;
295
- }
296
- elseif ($this->getImport()->options['product_stock_status'] == 'auto') {
297
  $this->getCount() and $this->data['product_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['product_stock_status']);
298
  $nostock = absint(max(get_option('woocommerce_notify_no_stock_amount'), 0));
299
  foreach ($this->data['product_stock_qty'] as $key => $value) {
300
  if ($this->data['product_manage_stock'][$key] == 'yes') {
301
  $this->data['product_stock_status'][$key] = (((int) $value === 0 or (int) $value <= $nostock) and $value != "") ? 'outofstock' : 'instock';
302
- }
303
- else {
304
  $this->data['product_stock_status'][$key] = 'instock';
305
  }
306
  }
307
- }
308
- else {
309
  $this->getCount() and $this->data['product_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['product_stock_status']);
310
  }
311
- }
312
- catch (\Exception $e) {
313
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
314
  }
315
  }
@@ -322,24 +299,20 @@ abstract class ProductsParserBase extends Parser {
322
  if ($this->getImport()->options['variation_stock_status'] == 'xpath' and "" != $this->getImport()->options['single_variation_stock_status']) {
323
  $this->data['v_stock_status'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_variation_stock_status'], $file)->parse();
324
  $this->tmp_files[] = $file;
325
- }
326
- elseif ($this->getImport()->options['variation_stock_status'] == 'auto') {
327
  $this->getCount() and $this->data['v_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['variation_stock_status']);
328
  $nostock = absint(max(get_option('woocommerce_notify_no_stock_amount'), 0));
329
  foreach ($this->data['v_stock'] as $key => $value) {
330
  if ($this->data['v_product_manage_stock'][$key] == 'yes') {
331
  $this->data['v_stock_status'][$key] = (((int) $value === 0 or (int) $value <= $nostock) and $value != "") ? 'outofstock' : 'instock';
332
- }
333
- else {
334
  $this->data['v_stock_status'][$key] = 'instock';
335
  }
336
  }
337
- }
338
- else {
339
  $this->getCount() and $this->data['v_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['variation_stock_status']);
340
  }
341
- }
342
- catch (\Exception $e) {
343
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
344
  }
345
  }
@@ -385,8 +358,7 @@ abstract class ProductsParserBase extends Parser {
385
  $attribute_options['is_create_terms'][$j] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['create_taxonomy_in_not_exists'][$j], $file)
386
  ->parse();
387
  $this->tmp_files[] = $file;
388
- }
389
- else {
390
  $options = array(
391
  'in_variations',
392
  'is_visible',
@@ -399,8 +371,7 @@ abstract class ProductsParserBase extends Parser {
399
  $attribute_options[$option][$j] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['advanced_' . $option . '_xpath'][$j], $file)
400
  ->parse();
401
  $this->tmp_files[] = $file;
402
- }
403
- else {
404
  $attribute_options[$option][$j] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['advanced_' . $option][$j], $file)
405
  ->parse();
406
  $this->tmp_files[] = $file;
@@ -409,15 +380,13 @@ abstract class ProductsParserBase extends Parser {
409
  foreach ($attribute_options[$option][$j] as $key => $value) {
410
  if (!in_array($value, array('yes', 'no'))) {
411
  $attribute_options[$option][$j][$key] = 1;
412
- }
413
- else {
414
  $attribute_options[$option][$j][$key] = ($value == 'yes') ? 1 : 0;
415
  }
416
  }
417
  }
418
  }
419
- }
420
- catch(\Exception $e) {
421
  $this->log($e->getMessage());
422
  }
423
  }
32
  $this->data[$option] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options[$s_option], $file)
33
  ->parse();
34
  $this->tmp_files[] = $file;
35
+ } else {
 
36
  $this->getCount() and $this->data[$option] = array_fill(0, $this->getCount(), $this->getImport()->options[$m_option]);
37
  }
38
+ } catch (\Exception $e) {
 
39
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
40
  }
41
  }
60
  $this->data['single_' . preg_replace("%id$%", "ID", $option)] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_' . $option], $file)
61
  ->parse();
62
  $this->tmp_files[] = $file;
63
+ } else {
 
64
  $this->getCount() and $this->data['single_' . preg_replace("%id$%", "ID", $option)] = array_fill(0, $this->getCount(), "");
65
  }
66
+ } catch (\Exception $e) {
 
67
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
68
  }
69
  }
95
  default:
96
  break;
97
  }
98
+ } else {
 
99
  $this->getCount() and $this->data[$option] = array_fill(0, $this->getCount(), "");
100
  }
101
+ } catch (\Exception $e) {
 
102
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
103
  }
104
  }
114
  $this->data['product_' . $option] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_' . $option], $file)
115
  ->parse();
116
  $this->tmp_files[] = $file;
117
+ } else {
 
118
  $this->getCount() and $this->data['product_' . $option] = array_fill(0, $this->getCount(), "");
119
  }
120
+ } catch (\Exception $e) {
 
121
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
122
  }
123
  }
134
  $this->data['product_' . $option_name] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_product_' . $option], $file)
135
  ->parse();
136
  $this->tmp_files[] = $file;
137
+ } else {
 
138
  $this->getCount() and $this->data['product_' . $option_name] = array_fill(0, $this->getCount(), $this->getImport()->options['multiple_product_' . $option]);
139
  }
140
+ } catch (\Exception $e) {
 
141
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
142
  }
143
  }
194
  $this->data['v_stock'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['variation_stock'], $file)
195
  ->parse();
196
  $this->tmp_files[] = $file;
197
+ } else {
 
198
  $this->getCount() and $this->data['v_stock'] = array_fill(0, $this->getCount(), '');
199
  }
200
+ } catch (\Exception $e) {
 
201
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
202
  }
203
  }
213
  $this->data['product_grouping_parent'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_grouping_product'], $file)
214
  ->parse();
215
  $this->tmp_files[] = $file;
216
+ } else {
 
217
  $this->getCount() and $this->data['product_grouping_parent'] = array_fill(0, $this->getCount(), $this->getImport()->options['multiple_grouping_product']);
218
  }
219
+ } else {
 
220
  if ("" != $this->getImport()->options['custom_grouping_indicator_name'] and "" != $this->getImport()->options['custom_grouping_indicator_value']) {
221
  $this->data['custom_grouping_indicator_name'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['custom_grouping_indicator_name'], $file)
222
  ->parse();
224
  $this->data['custom_grouping_indicator_value'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['custom_grouping_indicator_value'], $file)
225
  ->parse();
226
  $this->tmp_files[] = $file;
227
+ } else {
 
228
  $this->getCount() and $this->data['custom_grouping_indicator_name'] = array_fill(0, $this->getCount(), "");
229
  $this->getCount() and $this->data['custom_grouping_indicator_value'] = array_fill(0, $this->getCount(), "");
230
  }
231
  }
232
+ } else {
 
233
  $this->getCount() and $this->data['product_grouping_parent'] = array_fill(0, $this->getCount(), $this->getImport()->options['multiple_grouping_product']);
234
  }
235
+ } catch (\Exception $e) {
 
236
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
237
  }
238
  }
248
  ->parse();
249
  $this->tmp_files[] = $file;
250
  }
251
+ } else {
 
252
  if ("" != $this->getImport()->options['existing_parent_product_cf_name'] and "" != $this->getImport()->options['existing_parent_product_cf_value']) {
253
  $this->data['existing_parent_product_cf_name'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['existing_parent_product_cf_name'], $file)
254
  ->parse();
258
  $this->tmp_files[] = $file;
259
  }
260
  }
261
+ } catch (\Exception $e) {
 
262
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
263
  }
264
  }
273
  $this->data['product_stock_status'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_product_stock_status'], $file)
274
  ->parse();
275
  $this->tmp_files[] = $file;
276
+ } elseif ($this->getImport()->options['product_stock_status'] == 'auto') {
 
277
  $this->getCount() and $this->data['product_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['product_stock_status']);
278
  $nostock = absint(max(get_option('woocommerce_notify_no_stock_amount'), 0));
279
  foreach ($this->data['product_stock_qty'] as $key => $value) {
280
  if ($this->data['product_manage_stock'][$key] == 'yes') {
281
  $this->data['product_stock_status'][$key] = (((int) $value === 0 or (int) $value <= $nostock) and $value != "") ? 'outofstock' : 'instock';
282
+ } else {
 
283
  $this->data['product_stock_status'][$key] = 'instock';
284
  }
285
  }
286
+ } else {
 
287
  $this->getCount() and $this->data['product_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['product_stock_status']);
288
  }
289
+ } catch (\Exception $e) {
 
290
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
291
  }
292
  }
299
  if ($this->getImport()->options['variation_stock_status'] == 'xpath' and "" != $this->getImport()->options['single_variation_stock_status']) {
300
  $this->data['v_stock_status'] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['single_variation_stock_status'], $file)->parse();
301
  $this->tmp_files[] = $file;
302
+ } elseif ($this->getImport()->options['variation_stock_status'] == 'auto') {
 
303
  $this->getCount() and $this->data['v_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['variation_stock_status']);
304
  $nostock = absint(max(get_option('woocommerce_notify_no_stock_amount'), 0));
305
  foreach ($this->data['v_stock'] as $key => $value) {
306
  if ($this->data['v_product_manage_stock'][$key] == 'yes') {
307
  $this->data['v_stock_status'][$key] = (((int) $value === 0 or (int) $value <= $nostock) and $value != "") ? 'outofstock' : 'instock';
308
+ } else {
 
309
  $this->data['v_stock_status'][$key] = 'instock';
310
  }
311
  }
312
+ } else {
 
313
  $this->getCount() and $this->data['v_stock_status'] = array_fill(0, $this->getCount(), $this->getImport()->options['variation_stock_status']);
314
  }
315
+ } catch (\Exception $e) {
 
316
  $this->log('<b>ERROR:</b> ' . $e->getMessage());
317
  }
318
  }
358
  $attribute_options['is_create_terms'][$j] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['create_taxonomy_in_not_exists'][$j], $file)
359
  ->parse();
360
  $this->tmp_files[] = $file;
361
+ } else {
 
362
  $options = array(
363
  'in_variations',
364
  'is_visible',
371
  $attribute_options[$option][$j] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['advanced_' . $option . '_xpath'][$j], $file)
372
  ->parse();
373
  $this->tmp_files[] = $file;
374
+ } else {
 
375
  $attribute_options[$option][$j] = XmlImportParser::factory($this->getXml(), $this->getCompleteXPath(), $this->getImport()->options['advanced_' . $option][$j], $file)
376
  ->parse();
377
  $this->tmp_files[] = $file;
380
  foreach ($attribute_options[$option][$j] as $key => $value) {
381
  if (!in_array($value, array('yes', 'no'))) {
382
  $attribute_options[$option][$j][$key] = 1;
383
+ } else {
 
384
  $attribute_options[$option][$j][$key] = ($value == 'yes') ? 1 : 0;
385
  }
386
  }
387
  }
388
  }
389
+ } catch(\Exception $e) {
 
390
  $this->log($e->getMessage());
391
  }
392
  }
models/import/record.php CHANGED
@@ -121,8 +121,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
121
  if (!in_array($attid, $gallery)) {
122
  $gallery[] = $attid;
123
  }
124
- }
125
- else {
126
  $gallery = array($attid);
127
  }
128
  update_post_meta($p->post_parent, '_product_image_gallery_tmp', implode(',', $gallery));
121
  if (!in_array($attid, $gallery)) {
122
  $gallery[] = $attid;
123
  }
124
+ } else {
 
125
  $gallery = array($attid);
126
  }
127
  update_post_meta($p->post_parent, '_product_image_gallery_tmp', implode(',', $gallery));
plugin.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: WP All Import - WooCommerce Add-On
4
  Plugin URI: http://www.wpallimport.com/woocommerce-product-import/?utm_source=import-wooco-products-addon-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
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.4.6
7
  Author: Soflyy
8
- WC tested up to: 4.3.0
9
  */
10
 
11
  if ( ! function_exists( 'is_plugin_active' ) ) {
@@ -25,7 +25,7 @@ if ( is_plugin_active('wpai-woocommerce-add-on/wpai-woocommerce-add-on.php') ) {
25
  }
26
  else {
27
 
28
- define('PMWI_FREE_VERSION', '1.4.6');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
3
  Plugin Name: WP All Import - WooCommerce Add-On
4
  Plugin URI: http://www.wpallimport.com/woocommerce-product-import/?utm_source=import-wooco-products-addon-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
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.4.7
7
  Author: Soflyy
8
+ WC tested up to: 5.2.2
9
  */
10
 
11
  if ( ! function_exists( 'is_plugin_active' ) ) {
25
  }
26
  else {
27
 
28
+ define('PMWI_FREE_VERSION', '1.4.7');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Import Products from any XML or CSV to WooCommerce ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
- Tested up to: 5.5
5
- Stable tag: 1.4.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, csv import, import csv, xml import, import xml, woocommerce csv importer, woocommerce xml importer, csv importer, csv import suite
@@ -83,6 +83,11 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
86
  = 1.4.6 =
87
  * improvement: compatibility with WordPress 5.5
88
 
1
  === Import Products from any XML or CSV to WooCommerce ===
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
+ Tested up to: 5.7.1
5
+ Stable tag: 1.4.7
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
83
 
84
  == Changelog ==
85
 
86
+ = 1.4.7 =
87
+ * bug fix: matching linked products didn't work properly, this functionality moved to the end of import process
88
+ * bug fix: import download limit and download expiry are set to 1, instead of being provided empty values
89
+ * bug fix: featured image not updated when only "Images" is set to be updated in "Choose which data to update"
90
+
91
  = 1.4.6 =
92
  * improvement: compatibility with WordPress 5.5
93
 
static/js/admin.js CHANGED
@@ -496,7 +496,7 @@
496
  $parent.find('.advanced_attribute_settings').each(function(){
497
  $(this).find('.advanced_in_variations, .advanced_is_visible, .advanced_is_taxonomy, .advanced_is_create_terms').each(function(){
498
  if (!$(this).find('input:checked').length) {
499
- $(this).find('input[type="radio"]:first').attr('checked', 'checked');
500
  }
501
  });
502
  });
@@ -542,20 +542,22 @@
542
 
543
  $clone.insertBefore($template).css('display', 'none').removeClass('template').fadeIn();
544
 
545
- $clone.on("change", "input.switcher", function (e) {
546
  if ($(this).is(':radio:checked')) {
547
  $(this).parents('form').find('input.switcher:radio[name="' + $(this).attr('name') + '"]').not(this).change();
548
  }
549
  let $targets = $('.switcher-target-' + $(this).attr('id'));
550
  let is_show = $(this).is(':checked'); if ($(this).is('.switcher-reversed')) is_show = ! is_show;
551
  if (is_show) {
552
- $targets.slideDown();
 
 
553
  } else {
554
  $targets.slideUp().find('.clear-on-switch').add($targets.filter('.clear-on-switch')).val('');
555
  }
556
  }).change();
557
 
558
- $clone.on("change", "select.switcher", function (e) {
559
  var $targets = $('.switcher-target-' + $(this).attr('id'));
560
  var is_show = $(this).val() == 'xpath'; if ($(this).is('.switcher-reversed')) is_show = ! is_show;
561
  if (is_show) {
@@ -597,10 +599,10 @@
597
  });
598
 
599
  $('a.add-new-line').each(function(){
600
- var $parent = $(this).parents('table:first');
601
  if ($(this).parents('table').length < 4 && $parent.children('tbody').children('tr').length == 2) {
602
- $(this).click();
603
- }
604
  });
605
 
606
  $('a.switcher').on('click', function (e) {
@@ -611,14 +613,7 @@
611
  if ($targets.find('a.add-new-line').length){
612
  var $parent = $targets.find('a.add-new-line').parents('table:first');
613
  if ($parent.children('tbody').children('tr').length == 2){
614
- var $add_new = $targets.find('a.add-new-line');
615
- var $taxes = $add_new.parents('table').first();
616
- var $template = $taxes.children('tbody').children('tr.template');
617
- var $clone = $template.clone(true);
618
- var $number = parseInt($taxes.find('tbody:first').children().not('.template').length) - 1;
619
- var $cloneHtml = $clone.html().replace(/ROWNUMBER/g, $number).replace(/CELLNUMBER/g, 'ROWNUMBER').replace('date-picker', 'datepicker');
620
- $clone.html($cloneHtml);
621
- $clone.insertBefore($template).css('display', 'none').removeClass('template').show();
622
  }
623
  }
624
  $targets.slideDown('slow');
496
  $parent.find('.advanced_attribute_settings').each(function(){
497
  $(this).find('.advanced_in_variations, .advanced_is_visible, .advanced_is_taxonomy, .advanced_is_create_terms').each(function(){
498
  if (!$(this).find('input:checked').length) {
499
+ $(this).find('input[type="radio"]:first').prop('checked', true);
500
  }
501
  });
502
  });
542
 
543
  $clone.insertBefore($template).css('display', 'none').removeClass('template').fadeIn();
544
 
545
+ $parent.on("change", "input.switcher", function (e) {
546
  if ($(this).is(':radio:checked')) {
547
  $(this).parents('form').find('input.switcher:radio[name="' + $(this).attr('name') + '"]').not(this).change();
548
  }
549
  let $targets = $('.switcher-target-' + $(this).attr('id'));
550
  let is_show = $(this).is(':checked'); if ($(this).is('.switcher-reversed')) is_show = ! is_show;
551
  if (is_show) {
552
+ $targets.slideDown('fast', function(){
553
+ $(this).css({'overflow': 'visible'});
554
+ });
555
  } else {
556
  $targets.slideUp().find('.clear-on-switch').add($targets.filter('.clear-on-switch')).val('');
557
  }
558
  }).change();
559
 
560
+ $parent.on("change", "select.switcher", function (e) {
561
  var $targets = $('.switcher-target-' + $(this).attr('id'));
562
  var is_show = $(this).val() == 'xpath'; if ($(this).is('.switcher-reversed')) is_show = ! is_show;
563
  if (is_show) {
599
  });
600
 
601
  $('a.add-new-line').each(function(){
602
+ var $parent = $(this).parents('table:first');
603
  if ($(this).parents('table').length < 4 && $parent.children('tbody').children('tr').length == 2) {
604
+ $(this).click();
605
+ }
606
  });
607
 
608
  $('a.switcher').on('click', function (e) {
613
  if ($targets.find('a.add-new-line').length){
614
  var $parent = $targets.find('a.add-new-line').parents('table:first');
615
  if ($parent.children('tbody').children('tr').length == 2){
616
+ $targets.find('a.add-new-line').click();
 
 
 
 
 
 
 
617
  }
618
  }
619
  $targets.slideDown('slow');
views/admin/import/product/_tabs/_variations.php CHANGED
@@ -23,7 +23,7 @@
23
  <a href="#help" class="wpallimport-help" title="<?php _e('Parent SKU column in the below example.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative;">?</a>
24
  </p>
25
  <p class="form-field">
26
- <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-1.csv" tatger="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
27
  <span class="wpallimport-clear"></span>
28
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-1.png"/>
29
  </p>
@@ -48,7 +48,7 @@
48
  <a href="#help" class="wpallimport-help" title="<?php _e('Leave empty to use SKU settings from general tab.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative;">?</a>
49
  </p>
50
  <p class="form-field">
51
- <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-2.csv" tatger="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
52
  <span class="wpallimport-clear"></span>
53
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-2.png"/>
54
  </p>
@@ -67,7 +67,7 @@
67
  <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']) : ''); ?>"/>
68
  </p>
69
  <p class="form-field">
70
- <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-3.csv" tatger="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
71
  <span class="wpallimport-clear"></span>
72
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-3.png"/>
73
  </p>
@@ -90,7 +90,7 @@
90
  <a href="#help" class="wpallimport-help" title="<?php _e('Leave empty to use SKU settings from general tab.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative;">?</a>
91
  </p>
92
  <p class="form-field">
93
- <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-4.csv" tatger="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
94
  <span class="wpallimport-clear"></span>
95
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-4.png"/>
96
  </p>
@@ -177,14 +177,14 @@
177
  <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"': '' ?>/>
178
  <label for="is_variable_product_manage_stock_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
179
  <span class="wpallimport-clear"></span>
180
- <div class="switcher-target-is_variable_product_manage_stock_xpath set_with_xpath" style="width:390px;">
181
  <span class="wpallimport-slide-content" style="padding-left:0;">
182
  <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']) ?>"/>
183
- <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
184
- <span class="use_parent" style="float:right; top: 2px;">
185
  <input type="hidden" name="single_variable_product_manage_stock_use_parent" value="0"/>
186
  <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"' : ''; ?>>
187
- <label for="single_variable_product_manage_stock_use_parent" style="top:3px;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
 
188
  </span>
189
  </span>
190
  </div>
@@ -329,15 +329,15 @@
329
  <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"': '' ?>/>
330
  <label for="is_variable_product_virtual_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
331
  <span class="wpallimport-clear"></span>
332
- <div class="switcher-target-is_variable_product_virtual_xpath set_with_xpath" style="width:390px;">
333
  <span class="wpallimport-slide-content" style="padding-left:0;">
334
  <input type="text" class="smaller-text" name="single_variable_product_virtual" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_virtual']) ?>"/>
335
- <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
336
- <span class="use_parent" style="float:right; top: 2px;">
337
  <input type="hidden" name="single_variable_product_virtual_use_parent" value="0"/>
338
  <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"' : ''; ?>>
339
- <label for="single_variable_product_virtual_use_parent" style="top:3px;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
340
- </span>
 
341
  </span>
342
  </div>
343
  </div>
@@ -403,11 +403,11 @@
403
  <div class="switcher-target-multiple_variable_product_shipping_class_no set_with_xpath">
404
  <span class="wpallimport-slide-content" style="padding-left:0;">
405
  <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']) ?>"/>
406
- <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'taxable\', \'shipping\', \'none\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position: relative; top: -10px;">?</a>
407
  <span class="use_parent">
408
  <input type="hidden" name="single_variable_product_shipping_class_use_parent" value="0"/>
409
  <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"' : ''; ?>>
410
- <label for="single_variable_product_shipping_class_use_parent" style="top:2px; position: relative;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
 
411
  </span>
412
  </span>
413
  </div>
@@ -447,11 +447,11 @@
447
  <div class="switcher-target-multiple_variable_product_tax_class_no set_with_xpath">
448
  <span class="wpallimport-slide-content" style="padding-left:0;">
449
  <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']) ?>"/>
450
- <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'reduced-rate\', \'zero-rate\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position: relative; top:-10px;">?</a>
451
  <span class="use_parent">
452
  <input type="hidden" name="single_variable_product_tax_class_use_parent" value="0"/>
453
  <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"' : ''; ?>>
454
- <label for="single_variable_product_tax_class_use_parent" style="top:1px; position: relative;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
 
455
  </span>
456
  </span>
457
  </div>
@@ -473,14 +473,14 @@
473
  <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"': '' ?>/>
474
  <label for="is_variable_product_downloadable_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
475
  <span class="wpallimport-clear"></span>
476
- <div class="switcher-target-is_variable_product_downloadable_xpath set_with_xpath" style="width:390px;">
477
  <span class="wpallimport-slide-content" style="padding-left:0;">
478
  <input type="text" class="smaller-text" name="single_variable_product_downloadable" style="width:345px;" value="<?php echo esc_attr($post['single_variable_product_downloadable']) ?>"/>
479
- <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
480
- <span class="use_parent" style="float:right; top: 2px;">
481
  <input type="hidden" name="single_variable_product_downloadable_use_parent" value="0"/>
482
  <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"' : ''; ?>>
483
- <label for="single_variable_product_downloadable_use_parent" style="top:3px;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
 
484
  </span>
485
  </span>
486
  </div>
@@ -571,21 +571,24 @@
571
  <div class="drag-attribute">
572
  <input type="text" class="widefat" name="variable_attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:95% !important;"/>
573
  </div>
574
- </td>
575
- <td style="width: 50%;">
576
- <input type="text" class="widefat" name="variable_attribute_value[]" value="<?php echo esc_attr($post['variable_attribute_value'][$i]); ?>" style="width: 100% !important;"/>
577
-
578
- <span class="wpallimport-clear"></span>
579
- <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
580
  <span class='in_variations' style="margin-left:0px;">
581
  <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"/>
582
  <label for="variable_in_variations_<?php echo $i; ?>"><?php _e('In Variations',PMWI_Plugin::TEXT_DOMAIN);?></label>
583
  </span>
584
 
585
- <span class='is_visible'>
586
  <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"/>
587
  <label for="variable_is_visible_<?php echo $i; ?>"><?php _e('Is Visible',PMWI_Plugin::TEXT_DOMAIN);?></label>
588
  </span>
 
 
 
 
 
 
 
589
 
590
  <span class='is_taxonomy'>
591
  <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"/>
@@ -596,7 +599,7 @@
596
  <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"/>
597
  <label for="variable_create_taxonomy_in_not_exists_<?php echo $i; ?>"><?php _e('Auto-Create Terms',PMWI_Plugin::TEXT_DOMAIN);?></label>
598
  </span>
599
- </p>
600
  </td>
601
  <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
602
  </tr>
@@ -607,20 +610,23 @@
607
  <div class="drag-attribute">
608
  <input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/>
609
  </div>
610
- </td>
611
- <td style="width: 50%;">
612
- <input type="text" class="widefat" name="variable_attribute_value[]" value="" style="width: 100% !important;"/>
613
-
614
- <span class="wpallimport-clear"></span>
615
- <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
616
  <span class='in_variations' style="margin-left:0px;">
617
  <input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_0" checked="checked" style="float: left;" value="1"/>
618
  <label for="variable_in_variations_0"><?php _e('In Variations',PMWI_Plugin::TEXT_DOMAIN);?></label>
619
  </span>
620
- <span class='is_visible'>
621
  <input type="checkbox" name="variable_is_visible[]" id="variable_is_visible_0" checked="checked" style="float:left;" value="1"/>
622
  <label for="variable_is_visible_0"><?php _e('Is Visible',PMWI_Plugin::TEXT_DOMAIN);?></label>
623
  </span>
 
 
 
 
 
 
 
624
  <span class='is_taxonomy'>
625
  <input type="checkbox" name="variable_is_taxonomy[]" id="variable_is_taxonomy_0" checked="checked" style="float:left;" value="1"/>
626
  <label for="variable_is_taxonomy_0"><?php _e('Taxonomy',PMWI_Plugin::TEXT_DOMAIN);?></label>
@@ -628,7 +634,7 @@
628
  <span class='is_create_taxonomy'>
629
  <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"/>
630
  <label for="variable_create_taxonomy_in_not_exists_0"><?php _e('Auto-Create Terms',PMWI_Plugin::TEXT_DOMAIN);?></label>
631
- </span>
632
  </p>
633
  </td>
634
  <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
@@ -639,20 +645,22 @@
639
  <div class="drag-attribute">
640
  <input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/>
641
  </div>
642
- </td>
643
- <td style="width: 50%;">
644
- <input type="text" class="widefat" name="variable_attribute_value[]" value="" style="width: 100% !important;"/>
645
-
646
- <span class="wpallimport-clear"></span>
647
- <p class="form-field wpallimport-radio-field" style="padding: 0 !important; position: relative; left: -100%; width: 200%;">
648
  <span class='in_variations' style="margin-left:0px;">
649
  <input type="checkbox" name="variable_in_variations[]" checked="checked" style="float: left;" value="1"/>
650
  <label for=""><?php _e('In Variations',PMWI_Plugin::TEXT_DOMAIN);?></label>
651
  </span>
652
- <span class='is_visible'>
653
  <input type="checkbox" name="variable_is_visible[]" checked="checked" style="float: left;" value="1"/>
654
  <label for=""><?php _e('Is Visible',PMWI_Plugin::TEXT_DOMAIN);?></label>
655
  </span>
 
 
 
 
 
 
 
656
  <span class='is_taxonomy'>
657
  <input type="checkbox" name="variable_is_taxonomy[]" checked="checked" style="float: left;" value="1"/>
658
  <label for=""><?php _e('Taxonomy',PMWI_Plugin::TEXT_DOMAIN);?></label>
@@ -660,7 +668,7 @@
660
  <span class='is_create_taxonomy'>
661
  <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" checked="checked" style="float: left;" value="1"/>
662
  <label for=""><?php _e('Auto-Create Terms',PMWI_Plugin::TEXT_DOMAIN);?></label>
663
- </span>
664
  </p>
665
  </td>
666
  <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
@@ -826,18 +834,29 @@
826
 
827
  <p class="form-field wpallimport-radio-field">
828
  <input type="radio" id="set_default_yes" class="switcher" name="is_default_attributes" value="1" <?php echo $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
829
- <label for="set_default_yes" style="width: 400px;"><?php _e("Set the default selection in the attributes dropdowns.", PMWI_Plugin::TEXT_DOMAIN); ?></label>
830
  <a href="#help" class="wpallimport-help" title="<?php _e('The attributes for the first variation will be automatically selected on the frontend.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
831
  </p>
832
  <div class="switcher-target-set_default_yes set_with_xpath" style="padding-left:17px;">
833
  <p class="form-field wpallimport-radio-field">
834
- <input type="radio" id="set_default_first" name="default_attributes_type" value="first" <?php echo ($post['default_attributes_type'] == 'first') ? 'checked="checked"': '' ?>/>
835
  <label for="set_default_first" style="width: 90%;"><?php _e("Set first variation as the default selection.", PMWI_Plugin::TEXT_DOMAIN); ?></label>
836
  </p>
837
  <p class="form-field wpallimport-radio-field">
838
- <input type="radio" id="set_default_instock" name="default_attributes_type" value="instock" <?php echo ($post['default_attributes_type'] == 'instock') ? 'checked="checked"': '' ?>/>
839
  <label for="set_default_instock" style="width: 90%;"><?php _e("Set first in stock variation as the default selection.", PMWI_Plugin::TEXT_DOMAIN); ?></label>
840
- </p>
 
 
 
 
 
 
 
 
 
 
 
841
  </div>
842
  <p class="form-field wpallimport-radio-field">
843
  <input type="radio" id="set_default_no" class="switcher" name="is_default_attributes" value="0" <?php echo ! $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
@@ -876,4 +895,4 @@
876
 
877
  </div>
878
 
879
- </div><!-- End Product Panel -->
23
  <a href="#help" class="wpallimport-help" title="<?php _e('Parent SKU column in the below example.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative;">?</a>
24
  </p>
25
  <p class="form-field">
26
+ <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-1.csv" target="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
27
  <span class="wpallimport-clear"></span>
28
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-1.png"/>
29
  </p>
48
  <a href="#help" class="wpallimport-help" title="<?php _e('Leave empty to use SKU settings from general tab.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative;">?</a>
49
  </p>
50
  <p class="form-field">
51
+ <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-2.csv" target="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
52
  <span class="wpallimport-clear"></span>
53
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-2.png"/>
54
  </p>
67
  <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']) : ''); ?>"/>
68
  </p>
69
  <p class="form-field">
70
+ <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-3.csv" target="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
71
  <span class="wpallimport-clear"></span>
72
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-3.png"/>
73
  </p>
90
  <a href="#help" class="wpallimport-help" title="<?php _e('Leave empty to use SKU settings from general tab.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative;">?</a>
91
  </p>
92
  <p class="form-field">
93
+ <strong><?php _e("Example Data For Use With This Option",PMWI_Plugin::TEXT_DOMAIN);?> </strong> - <a href="http://www.wpallimport.com/wp-content/uploads/2014/10/data-example-4.csv" target="_blank"><?php _e("download",PMWI_Plugin::TEXT_DOMAIN);?></a>
94
  <span class="wpallimport-clear"></span>
95
  <img src="<?php echo PMWI_ROOT_URL; ?>/static/img/data-example-4.png"/>
96
  </p>
177
  <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"': '' ?>/>
178
  <label for="is_variable_product_manage_stock_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
179
  <span class="wpallimport-clear"></span>
180
+ <div class="switcher-target-is_variable_product_manage_stock_xpath set_with_xpath" style="width:425px;">
181
  <span class="wpallimport-slide-content" style="padding-left:0;">
182
  <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']) ?>"/>
183
+ <span class="use_parent" style="top: 2px; left: 10px;">
 
184
  <input type="hidden" name="single_variable_product_manage_stock_use_parent" value="0"/>
185
  <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"' : ''; ?>>
186
+ <label for="single_variable_product_manage_stock_use_parent" style="top:3px; width: auto;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
187
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0;">?</a>
188
  </span>
189
  </span>
190
  </div>
329
  <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"': '' ?>/>
330
  <label for="is_variable_product_virtual_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
331
  <span class="wpallimport-clear"></span>
332
+ <div class="switcher-target-is_variable_product_virtual_xpath set_with_xpath" style="width:425px;">
333
  <span class="wpallimport-slide-content" style="padding-left:0;">
334
  <input type="text" class="smaller-text" name="single_variable_product_virtual" style="width:300px;" value="<?php echo esc_attr($post['single_variable_product_virtual']) ?>"/>
335
+ <span class="use_parent" style="top: 2px; left: 10px;">
 
336
  <input type="hidden" name="single_variable_product_virtual_use_parent" value="0"/>
337
  <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"' : ''; ?>>
338
+ <label for="single_variable_product_virtual_use_parent" style="top:3px; width: auto;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
339
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0; ">?</a>
340
+ </span>
341
  </span>
342
  </div>
343
  </div>
403
  <div class="switcher-target-multiple_variable_product_shipping_class_no set_with_xpath">
404
  <span class="wpallimport-slide-content" style="padding-left:0;">
405
  <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']) ?>"/>
 
406
  <span class="use_parent">
407
  <input type="hidden" name="single_variable_product_shipping_class_use_parent" value="0"/>
408
  <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"' : ''; ?>>
409
+ <label for="single_variable_product_shipping_class_use_parent" style="top:2px; position: relative; width: auto;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
410
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'taxable\', \'shipping\', \'none\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position: relative; top: 2px; ">?</a>
411
  </span>
412
  </span>
413
  </div>
447
  <div class="switcher-target-multiple_variable_product_tax_class_no set_with_xpath">
448
  <span class="wpallimport-slide-content" style="padding-left:0;">
449
  <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']) ?>"/>
 
450
  <span class="use_parent">
451
  <input type="hidden" name="single_variable_product_tax_class_use_parent" value="0"/>
452
  <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"' : ''; ?>>
453
+ <label for="single_variable_product_tax_class_use_parent" style="top:1px; position: relative; width: auto;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
454
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'reduced-rate\', \'zero-rate\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position: relative; top:2px;">?</a>
455
  </span>
456
  </span>
457
  </div>
473
  <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"': '' ?>/>
474
  <label for="is_variable_product_downloadable_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
475
  <span class="wpallimport-clear"></span>
476
+ <div class="switcher-target-is_variable_product_downloadable_xpath set_with_xpath" style="width:425px;">
477
  <span class="wpallimport-slide-content" style="padding-left:0;">
478
  <input type="text" class="smaller-text" name="single_variable_product_downloadable" style="width:345px;" value="<?php echo esc_attr($post['single_variable_product_downloadable']) ?>"/>
479
+ <span class="use_parent" style="left: 10px; top: 2px;">
 
480
  <input type="hidden" name="single_variable_product_downloadable_use_parent" value="0"/>
481
  <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"' : ''; ?>>
482
+ <label for="single_variable_product_downloadable_use_parent" style="top:3px; width: auto;"><?php _e("XPath Is From Parent",PMWI_Plugin::TEXT_DOMAIN); ?></label>
483
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one of the following: (\'yes\', \'no\').', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
484
  </span>
485
  </span>
486
  </div>
571
  <div class="drag-attribute">
572
  <input type="text" class="widefat" name="variable_attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:95% !important;"/>
573
  </div>
574
+ <span class="wpallimport-clear"></span>
575
+ <p class="form-field wpallimport-radio-field">
 
 
 
 
576
  <span class='in_variations' style="margin-left:0px;">
577
  <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"/>
578
  <label for="variable_in_variations_<?php echo $i; ?>"><?php _e('In Variations',PMWI_Plugin::TEXT_DOMAIN);?></label>
579
  </span>
580
 
581
+ <span class='is_visible'>
582
  <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"/>
583
  <label for="variable_is_visible_<?php echo $i; ?>"><?php _e('Is Visible',PMWI_Plugin::TEXT_DOMAIN);?></label>
584
  </span>
585
+ </p>
586
+ </td>
587
+ <td style="width: 50%;">
588
+ <input type="text" class="widefat" name="variable_attribute_value[]" value="<?php echo esc_attr($post['variable_attribute_value'][$i]); ?>" style="width: 100% !important;"/>
589
+
590
+ <span class="wpallimport-clear"></span>
591
+ <p class="form-field wpallimport-radio-field">
592
 
593
  <span class='is_taxonomy'>
594
  <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"/>
599
  <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"/>
600
  <label for="variable_create_taxonomy_in_not_exists_<?php echo $i; ?>"><?php _e('Auto-Create Terms',PMWI_Plugin::TEXT_DOMAIN);?></label>
601
  </span>
602
+ </p>
603
  </td>
604
  <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
605
  </tr>
610
  <div class="drag-attribute">
611
  <input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/>
612
  </div>
613
+ <span class="wpallimport-clear"></span>
614
+ <p class="form-field wpallimport-radio-field">
 
 
 
 
615
  <span class='in_variations' style="margin-left:0px;">
616
  <input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_0" checked="checked" style="float: left;" value="1"/>
617
  <label for="variable_in_variations_0"><?php _e('In Variations',PMWI_Plugin::TEXT_DOMAIN);?></label>
618
  </span>
619
+ <span class='is_visible'>
620
  <input type="checkbox" name="variable_is_visible[]" id="variable_is_visible_0" checked="checked" style="float:left;" value="1"/>
621
  <label for="variable_is_visible_0"><?php _e('Is Visible',PMWI_Plugin::TEXT_DOMAIN);?></label>
622
  </span>
623
+ </p>
624
+ </td>
625
+ <td style="width: 50%;">
626
+ <input type="text" class="widefat" name="variable_attribute_value[]" value="" style="width: 100% !important;"/>
627
+
628
+ <span class="wpallimport-clear"></span>
629
+ <p class="form-field wpallimport-radio-field">
630
  <span class='is_taxonomy'>
631
  <input type="checkbox" name="variable_is_taxonomy[]" id="variable_is_taxonomy_0" checked="checked" style="float:left;" value="1"/>
632
  <label for="variable_is_taxonomy_0"><?php _e('Taxonomy',PMWI_Plugin::TEXT_DOMAIN);?></label>
634
  <span class='is_create_taxonomy'>
635
  <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"/>
636
  <label for="variable_create_taxonomy_in_not_exists_0"><?php _e('Auto-Create Terms',PMWI_Plugin::TEXT_DOMAIN);?></label>
637
+ </span>
638
  </p>
639
  </td>
640
  <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
645
  <div class="drag-attribute">
646
  <input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/>
647
  </div>
648
+ <p class="form-field wpallimport-radio-field">
 
 
 
 
 
649
  <span class='in_variations' style="margin-left:0px;">
650
  <input type="checkbox" name="variable_in_variations[]" checked="checked" style="float: left;" value="1"/>
651
  <label for=""><?php _e('In Variations',PMWI_Plugin::TEXT_DOMAIN);?></label>
652
  </span>
653
+ <span class='is_visible'>
654
  <input type="checkbox" name="variable_is_visible[]" checked="checked" style="float: left;" value="1"/>
655
  <label for=""><?php _e('Is Visible',PMWI_Plugin::TEXT_DOMAIN);?></label>
656
  </span>
657
+ </p>
658
+ </td>
659
+ <td style="width: 50%;">
660
+ <input type="text" class="widefat" name="variable_attribute_value[]" value="" style="width: 100% !important;"/>
661
+
662
+ <span class="wpallimport-clear"></span>
663
+ <p class="form-field wpallimport-radio-field">
664
  <span class='is_taxonomy'>
665
  <input type="checkbox" name="variable_is_taxonomy[]" checked="checked" style="float: left;" value="1"/>
666
  <label for=""><?php _e('Taxonomy',PMWI_Plugin::TEXT_DOMAIN);?></label>
668
  <span class='is_create_taxonomy'>
669
  <input type="checkbox" name="variable_create_taxonomy_in_not_exists[]" checked="checked" style="float: left;" value="1"/>
670
  <label for=""><?php _e('Auto-Create Terms',PMWI_Plugin::TEXT_DOMAIN);?></label>
671
+ </span>
672
  </p>
673
  </td>
674
  <td class="action remove"><a href="#remove" style="top: 9px;"></a></td>
834
 
835
  <p class="form-field wpallimport-radio-field">
836
  <input type="radio" id="set_default_yes" class="switcher" name="is_default_attributes" value="1" <?php echo $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
837
+ <label for="set_default_yes" style="width: 305px;"><?php _e("Set the default selection in the attributes dropdowns.", PMWI_Plugin::TEXT_DOMAIN); ?></label>
838
  <a href="#help" class="wpallimport-help" title="<?php _e('The attributes for the first variation will be automatically selected on the frontend.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
839
  </p>
840
  <div class="switcher-target-set_default_yes set_with_xpath" style="padding-left:17px;">
841
  <p class="form-field wpallimport-radio-field">
842
+ <input type="radio" id="set_default_first" class="switcher" name="default_attributes_type" value="first" <?php echo ($post['default_attributes_type'] == 'first') ? 'checked="checked"': '' ?>/>
843
  <label for="set_default_first" style="width: 90%;"><?php _e("Set first variation as the default selection.", PMWI_Plugin::TEXT_DOMAIN); ?></label>
844
  </p>
845
  <p class="form-field wpallimport-radio-field">
846
+ <input type="radio" id="set_default_instock" class="switcher" name="default_attributes_type" value="instock" <?php echo ($post['default_attributes_type'] == 'instock') ? 'checked="checked"': '' ?>/>
847
  <label for="set_default_instock" style="width: 90%;"><?php _e("Set first in stock variation as the default selection.", PMWI_Plugin::TEXT_DOMAIN); ?></label>
848
+ </p>
849
+ <div class="form-field wpallimport-radio-field">
850
+ <input type="radio" id="set_default_xpath" class="switcher" name="default_attributes_type" value="xpath" <?php echo 'xpath' == $post['default_attributes_type'] ? 'checked="checked"': '' ?>/>
851
+ <label for="set_default_xpath"><?php _e('Set with XPath', PMWI_Plugin::TEXT_DOMAIN )?></label>
852
+ <span class="wpallimport-clear"></span>
853
+ <div class="switcher-target-set_default_xpath set_with_xpath">
854
+ <span class="wpallimport-slide-content" style="padding-left:0;">
855
+ <input type="text" class="smaller-text" name="default_attributes_xpath" style="width:300px;" value="<?php echo esc_attr($post['default_attributes_xpath']) ?>"/>
856
+ <a href="#help" class="wpallimport-help" title="<?php _e('The value of presented XPath should be one serialized data: a:2:{s:7:”pa_size”;s:3:”6-5″;s:8:”pa_color”;s:3:”red”;}.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:2px;">?</a>
857
+ </span>
858
+ </div>
859
+ </div>
860
  </div>
861
  <p class="form-field wpallimport-radio-field">
862
  <input type="radio" id="set_default_no" class="switcher" name="is_default_attributes" value="0" <?php echo ! $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
895
 
896
  </div>
897
 
898
+ </div><!-- End Product Panel -->
views/admin/import/shop_order/_tabs/_order_item_products.php CHANGED
@@ -1,11 +1,6 @@
1
  <div class="panel woocommerce_options_panel" id="order_products">
2
  <div class="options_group hide_if_grouped">
3
  <!-- Product matching mode -->
4
- <!-- <div class="form-field wpallimport-radio-field wpallimport-clear">
5
- <input type="radio" id="products_repeater_mode_fixed" name="pmwi_order[products_repeater_mode]" value="fixed" <?php echo 'fixed' == $post['pmwi_order']['products_repeater_mode'] ? 'checked="checked"' : '' ?> class="switcher variable_repeater_mode"/>
6
- <label for="products_repeater_mode_fixed" style="width:auto;"><?php _e('Fixed Repeater Mode', PMWI_Plugin::TEXT_DOMAIN) ?></label>
7
- </div> -->
8
-
9
  <div class="form-field wpallimport-radio-field">
10
  <input type="radio" id="products_source_existing" name="pmwi_order[products_source]" value="existing" <?php echo 'existing' == $post['pmwi_order']['products_source'] ? 'checked="checked"' : '' ?> class="switcher"/>
11
  <label for="products_source_existing" style="width:auto;"><?php _e('Get data from existing products', PMWI_Plugin::TEXT_DOMAIN) ?></label>
@@ -16,237 +11,186 @@
16
  <span class="wpallimport-slide-content" style="padding-left:0;">
17
  <table class="wpallimport_variable_table" style="width:100%;">
18
  <?php
19
- foreach ($post['pmwi_order']['products'] as $i => $product):
20
-
21
- $product += array('unique_key' => '', 'sku' => '', 'qty' => '', 'price_per_unit' => '', 'tax_rates' => array());
22
-
23
- if (empty($product['sku'])) continue;
24
- ?>
25
-
26
- <tr>
27
- <td colspan="2">
28
- <div style="float:left; width:50%;">
29
- <label><?php _e('Product Unique Key', PMWI_Plugin::TEXT_DOMAIN); ?></label>
30
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][unique_key]" value="<?php echo esc_attr($product['unique_key']) ?>" style="width:95%;"/>
31
- </div>
32
- <div style="float:right; width:50%;">
33
- <label><?php _e('Quantity', PMWI_Plugin::TEXT_DOMAIN); ?></label>
34
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][qty]" value="<?php echo esc_attr($product['qty']) ?>" style="width:95%;"/>
35
- </div>
36
- <div class="wpallimport-clear"></div>
37
- <div style="float:left; width:50%;">
38
- <label><?php _e('Product SKU', PMWI_Plugin::TEXT_DOMAIN); ?></label>
39
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][sku]" value="<?php echo esc_attr($product['sku']) ?>" style="width:95%;"/>
40
- </div>
41
- <div style="float:right; width:50%;">
42
- <label><?php _e('Price', PMWI_Plugin::TEXT_DOMAIN); ?></label>
43
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][price_per_unit]" value="<?php echo esc_attr($product['price_per_unit']) ?>" style="width:95%;"/>
44
- </div>
45
- <div class="wpallimport-clear"></div>
46
- <!-- Product Taxes -->
47
- <a class="switcher" id="taxes_existing_products_<?php echo $i; ?>" href="javascript:void(0);" style="display: block;margin: 10px 0 15px;width: 50px;"><span>-</span> <?php _e("Taxes", PMWI_Plugin::TEXT_DOMAIN); ?></a>
48
- <div class="wpallimport-clear"></div>
49
- <div class="switcher-target-taxes_existing_products_<?php echo $i; ?>">
50
- <span class="wpallimport-slide-content" style="padding-left:0;">
51
- <table style="width:45%;" class="taxes-form-table">
52
- <?php
53
- foreach ($product['tax_rates'] as $j => $tax_rate):
54
-
55
- $tax_rate += array('code' => '', 'calculate_logic' => 'percentage', 'percentage_value' => '', 'amount_per_unit' => '');
56
-
57
- if (empty($tax_rate['code'])) continue;
58
-
59
- ?>
60
- <tr class="form-field">
61
- <td>
62
- <div class="form-field">
63
- <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
64
- <div class="clear"></div>
65
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][code]" style="width:100%;" value="<?php echo esc_attr($tax_rate['code']) ?>"/>
66
- </div>
67
-
68
- <span class="wpallimport-clear"></span>
69
-
70
- <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
71
-
72
- <div class="form-field wpallimport-radio-field">
73
- <input type="radio" id="tax_calculate_logic_percentage_<?php echo $i; ?>_<?php echo $j; ?>" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][calculate_logic]" value="percentage" <?php echo 'percentage' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
74
- <label for="tax_calculate_logic_percentage_<?php echo $i; ?>_<?php echo $j; ?>" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
75
- <span class="wpallimport-clear"></span>
76
- <div class="switcher-target-tax_calculate_logic_percentage_<?php echo $i; ?>_<?php echo $j; ?>" style="padding-left:25px;">
77
- <span class="wpallimport-slide-content" style="padding-left:0;">
78
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][percentage_value]" style="width:100%;" value="<?php echo esc_attr($tax_rate['percentage_value']) ?>"/>
79
- </span>
80
- </div>
81
- </div>
82
- <span class="wpallimport-clear"></span>
83
- <div class="form-field wpallimport-radio-field">
84
- <input type="radio" id="tax_calculate_logic_per_unit_<?php echo $i; ?>_<?php echo $j; ?>" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][calculate_logic]" value="per_unit" <?php echo 'per_unit' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
85
- <label for="tax_calculate_logic_per_unit_<?php echo $i; ?>_<?php echo $j; ?>" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
86
- <span class="wpallimport-clear"></span>
87
- <div class="switcher-target-tax_calculate_logic_per_unit_<?php echo $i; ?>_<?php echo $j; ?>" style="padding-left:25px;">
88
- <span class="wpallimport-slide-content" style="padding-left:0;">
89
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][amount_per_unit]" style="width:100%;" value="<?php echo esc_attr($tax_rate['amount_per_unit']) ?>"/>
90
- </span>
91
- </div>
92
- </div>
93
- <span class="wpallimport-clear"></span>
94
- <div class="form-field wpallimport-radio-field">
95
- <input type="radio" id="tax_calculate_logic_lookup_<?php echo $i; ?>_<?php echo $j; ?>" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][<?php echo $i; ?>][calculate_logic]" value="loocup" <?php echo 'loocup' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
96
- <label for="tax_calculate_logic_lookup_<?php echo $i; ?>_<?php echo $j; ?>" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
97
- <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
98
- </div>
99
- <hr style="margin-left: 20px;">
100
- </td>
101
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
102
- </tr>
103
- <?php endforeach; ?>
104
- <tr class="form-field template">
105
- <td>
106
- <div class="form-field">
107
- <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
108
- <div class="clear"></div>
109
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][ROWNUMBER][code]" style="width:100%;" value=""/>
110
- </div>
111
-
112
- <span class="wpallimport-clear"></span>
113
-
114
- <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
115
-
116
- <div class="form-field wpallimport-radio-field">
117
- <input type="radio" id="tax_calculate_logic_percentage_<?php echo $i; ?>_ROWNUMBER" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][ROWNUMBER][calculate_logic]" value="percentage" checked="checked" class="switcher"/>
118
- <label for="tax_calculate_logic_percentage_<?php echo $i; ?>_ROWNUMBER" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
119
- <span class="wpallimport-clear"></span>
120
- <div class="switcher-target-tax_calculate_logic_percentage_<?php echo $i; ?>_ROWNUMBER" style="padding-left:25px;">
121
- <span class="wpallimport-slide-content" style="padding-left:0;">
122
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][ROWNUMBER][percentage_value]" style="width:100%;"/>
123
- </span>
124
- </div>
125
- </div>
126
- <span class="wpallimport-clear"></span>
127
- <div class="form-field wpallimport-radio-field">
128
- <input type="radio" id="tax_calculate_logic_per_unit_<?php echo $i; ?>_ROWNUMBER" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][ROWNUMBER][calculate_logic]" value="per_unit" class="switcher"/>
129
- <label for="tax_calculate_logic_per_unit_<?php echo $i; ?>_ROWNUMBER" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
130
- <span class="wpallimport-clear"></span>
131
- <div class="switcher-target-tax_calculate_logic_per_unit_<?php echo $i; ?>_ROWNUMBER" style="padding-left:25px;">
132
- <span class="wpallimport-slide-content" style="padding-left:0;">
133
- <input type="text" class="short rad4" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][ROWNUMBER][amount_per_unit]" style="width:100%;"/>
134
- </span>
135
- </div>
136
- </div>
137
- <span class="wpallimport-clear"></span>
138
- <div class="form-field wpallimport-radio-field">
139
- <input type="radio" id="tax_calculate_logic_lookup_<?php echo $i; ?>_ROWNUMBER" name="pmwi_order[products][<?php echo $i; ?>][tax_rates][ROWNUMBER][calculate_logic]" value="loocup" class="switcher"/>
140
- <label for="tax_calculate_logic_lookup_<?php echo $i; ?>_ROWNUMBER" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
141
- <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
142
- </div>
143
- <hr style="margin-left: 20px;">
144
- </td>
145
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
146
- </tr>
147
- <tr>
148
- <td colspan="2">
149
- <div class="form-field">
150
- <a class="add-new-line" title="Add Tax" href="javascript:void(0);"><?php _e("Add Tax", " wp_all_import_plugin"); ?></a>
151
- </div>
152
- </td>
153
- </tr>
154
- </table>
155
- </span>
156
- </div>
157
- <!-- <hr> -->
158
- </td>
159
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
160
- </tr>
161
- <?php endforeach; ?>
162
- <tr class="template">
163
- <td colspan="2">
164
  <div style="float:left; width:50%;">
165
  <label><?php _e('Product Unique Key', PMWI_Plugin::TEXT_DOMAIN); ?></label>
166
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][unique_key]" value="" style="width:95%;"/>
 
 
 
 
167
  </div>
168
- <div style="float:right; width:50%;">
169
- <label><?php _e('Quantity', PMWI_Plugin::TEXT_DOMAIN); ?></label>
170
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][qty]" value="" style="width:95%;"/>
171
- </div>
172
- <div class="wpallimport-clear"></div>
173
  <div style="float:left; width:50%;">
174
- <label><?php _e('Product SKU', PMWI_Plugin::TEXT_DOMAIN); ?></label>
175
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][sku]" value="" style="width:95%;"/>
176
- </div>
177
- <div style="float:right; width:50%;">
178
- <label><?php _e('Price', PMWI_Plugin::TEXT_DOMAIN); ?></label>
179
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][price_per_unit]" value="" style="width:95%;"/>
180
- </div>
181
- <div class="wpallimport-clear"></div>
182
- <!-- Product Taxes -->
183
- <a class="switcher" id="taxes_existing_products_ROWNUMBER" href="javascript:void(0);" style="display: block;margin: 10px 0 15px;width: 50px;"><span>-</span> <?php _e("Taxes", PMWI_Plugin::TEXT_DOMAIN); ?></a>
184
- <div class="wpallimport-clear"></div>
185
- <div class="switcher-target-taxes_existing_products_ROWNUMBER">
186
- <span class="wpallimport-slide-content" style="padding-left:0;">
187
- <table style="width:45%;" class="taxes-form-table">
188
- <tr class="form-field template">
189
- <td>
190
- <div class="form-field">
191
- <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
192
- <div class="clear"></div>
193
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][tax_rates][CELLNUMBER][code]" style="width:100%;" value=""/>
194
- </div>
195
-
196
- <span class="wpallimport-clear"></span>
197
-
198
- <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
199
-
200
- <div class="form-field wpallimport-radio-field">
201
- <input type="radio" id="tax_calculate_logic_percentage_ROWNUMBER_CELLNUMBER" name="pmwi_order[products][ROWNUMBER][tax_rates][CELLNUMBER][calculate_logic]" value="percentage" checked="checked" class="switcher"/>
202
- <label for="tax_calculate_logic_percentage_ROWNUMBER_CELLNUMBER" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
203
- <span class="wpallimport-clear"></span>
204
- <div class="switcher-target-tax_calculate_logic_percentage_ROWNUMBER_CELLNUMBER" style="padding-left:25px;">
205
- <span class="wpallimport-slide-content" style="padding-left:0;">
206
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][tax_rates][CELLNUMBER][percentage_value]" style="width:100%;"/>
207
- </span>
208
- </div>
209
- </div>
210
- <span class="wpallimport-clear"></span>
211
- <div class="form-field wpallimport-radio-field">
212
- <input type="radio" id="tax_calculate_logic_per_unit_ROWNUMBER_CELLNUMBER" name="pmwi_order[products][ROWNUMBER][tax_rates][CELLNUMBER][calculate_logic]" value="per_unit" class="switcher"/>
213
- <label for="tax_calculate_logic_per_unit_ROWNUMBER_CELLNUMBER" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
214
- <span class="wpallimport-clear"></span>
215
- <div class="switcher-target-tax_calculate_logic_per_unit_ROWNUMBER_CELLNUMBER" style="padding-left:25px;">
216
- <span class="wpallimport-slide-content" style="padding-left:0;">
217
- <input type="text" class="short rad4" name="pmwi_order[products][ROWNUMBER][tax_rates][CELLNUMBER][amount_per_unit]" style="width:100%;"/>
218
- </span>
219
- </div>
220
- </div>
221
- <span class="wpallimport-clear"></span>
222
- <div class="form-field wpallimport-radio-field">
223
- <input type="radio" id="tax_calculate_logic_lookup_ROWNUMBER_CELLNUMBER" name="pmwi_order[products][ROWNUMBER][tax_rates][CELLNUMBER][calculate_logic]" value="loocup" class="switcher"/>
224
- <label for="tax_calculate_logic_lookup_ROWNUMBER_CELLNUMBER" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
225
- <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
226
- </div>
227
- <hr style="margin-left: 20px;">
228
- </td>
229
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
230
- </tr>
231
- <tr>
232
- <td colspan="2">
233
- <div class="form-field">
234
- <a class="add-new-line" title="Add Tax" href="javascript:void(0);"><?php _e("Add Tax", " wp_all_import_plugin"); ?></a>
235
- </div>
236
- </td>
237
- </tr>
238
- </table>
239
- </span>
240
- </div>
241
- <!-- <hr> -->
242
- </td>
243
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
244
- </tr>
245
- <tr class="wpallimport-row-actions" style="display:none;">
246
- <td colspan="3">
247
- <a class="add-new-line" title="Add Product" href="javascript:void(0);" style="width:200px;"><?php _e("Add Product", PMWI_Plugin::TEXT_DOMAIN); ?></a>
248
- </td>
249
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  </table>
251
  </span>
252
  </div>
@@ -262,50 +206,49 @@
262
  <div class="switcher-target-products_source_new" style="padding-left:45px;">
263
  <span class="wpallimport-slide-content" style="padding-left:0;">
264
  <table class="wpallimport_variable_table">
265
- <?php
266
- foreach ($post['pmwi_order']['manual_products'] as $i => $product):
267
-
268
- $product += array(
269
- 'unique_key' => '',
270
- 'sku' => '',
271
- 'meta_name' => array(),
272
- 'meta_value' => array(),
273
- 'price_per_unit' => '',
274
- 'qty' => '',
275
- 'tax_rates' => array()
276
- );
277
-
278
- if (empty($product['sku'])) continue;
279
-
280
- ?>
281
  <tr class="form-field">
282
  <td colspan="2">
283
-
284
  <label><?php _e('Product Unique Key', PMWI_Plugin::TEXT_DOMAIN); ?></label>
285
  <div class="clear"></div>
286
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][unique_key]" value="<?php echo esc_attr($product['unique_key']) ?>" style="width:100%;"/>
287
 
288
  <span class="wpallimport-clear"></span>
289
 
290
  <label><?php _e('Product Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
291
  <div class="clear"></div>
292
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][sku]" value="<?php echo esc_attr($product['sku']) ?>" style="width:100%;"/>
293
-
294
  <span class="wpallimport-clear"></span>
295
 
296
  <table class="form-field">
297
  <?php foreach ($product['meta_name'] as $j => $meta_name): if (empty($meta_name)) continue; ?>
298
- <tr class="form-field">
299
  <td style="padding-right:10px;">
300
  <label><?php _e('Meta Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
301
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i;?>][meta_name][]" value="<?php echo esc_attr($meta_name); ?>" style="width:100%;"/>
302
  </td>
303
  <td style="padding-left:10px;">
304
  <label><?php _e('Meta Value', PMWI_Plugin::TEXT_DOMAIN); ?></label>
305
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i;?>][meta_value][]" value="<?php echo esc_attr($product['meta_value'][$j]); ?>" style="width:100%;"/>
306
  </td>
307
  <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
308
- </tr>
309
  <?php endforeach; ?>
310
  <tr class="form-field template">
311
  <td style="padding-right:10px;">
@@ -319,7 +262,7 @@
319
  <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
320
  </tr>
321
  <tr>
322
- <td colspan="3">
323
  <a class="add-new-line" title="Add Product Meta" href="javascript:void(0);" style="display:block;margin:5px 0;width:140px;top:0;padding-top:4px;"><?php empty($product['meta_name']) ? _e("Add Product Meta", PMWI_Plugin::TEXT_DOMAIN): _e("Add More Product Meta", PMWI_Plugin::TEXT_DOMAIN); ?></a>
324
  </td>
325
  </tr>
@@ -329,66 +272,66 @@
329
  <tr>
330
  <td style="padding-right:10px;">
331
  <label><?php _e('Price per Unit', PMWI_Plugin::TEXT_DOMAIN); ?></label>
332
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][price_per_unit]" value="<?php echo esc_attr($product['price_per_unit']) ?>" style="width:100%;"/>
333
  </td>
334
  <td style="padding-left: 10px;">
335
  <label><?php _e('Quantity', PMWI_Plugin::TEXT_DOMAIN); ?></label>
336
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][qty]" value="<?php echo esc_attr($product['qty']) ?>" style="width:100%;"/>
337
  </td>
338
- </tr>
339
  </table>
340
 
341
- <a class="switcher" id="taxes_manual_products_<?php echo $i; ?>" href="javascript:void(0);" style="display: block;margin: 10px 0 15px;width: 50px;"><span>-</span> <?php _e("Taxes", PMWI_Plugin::TEXT_DOMAIN); ?></a>
342
  <div class="wpallimport-clear"></div>
343
- <div class="switcher-target-taxes_manual_products_<?php echo $i; ?>">
344
  <span class="wpallimport-slide-content" style="padding-left:0;">
345
  <table style="width:45%;" class="taxes-form-table">
346
- <?php
347
- foreach ($product['tax_rates'] as $j => $tax_rate):
348
 
349
- $tax_rate += array('code' => '', 'calculate_logic' => 'percentage', 'percentage_value' => '', 'amount_per_unit' => '');
350
 
351
  if (empty($tax_rate['code'])) continue;
352
 
353
  ?>
354
 
355
- <tr class="form-field">
356
  <td>
357
  <div class="form-field">
358
  <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
359
  <div class="clear"></div>
360
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][code]" style="width:100%;" value="<?php echo esc_attr($tax_rate['code']) ?>"/>
361
  </div>
362
-
363
  <span class="wpallimport-clear"></span>
364
 
365
  <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
366
 
367
  <div class="form-field wpallimport-radio-field">
368
- <input type="radio" id="product_tax_calculate_logic_percentage_<?php echo $i . '_' . $j; ?>" name="pmwi_order[manual_products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][calculate_logic]" value="percentage" <?php echo 'percentage' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
369
- <label for="product_tax_calculate_logic_percentage_<?php echo $i . '_' . $j; ?>" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
370
  <span class="wpallimport-clear"></span>
371
- <div class="switcher-target-product_tax_calculate_logic_percentage_<?php echo $i . '_' . $j; ?>" style="padding-left:25px;">
372
  <span class="wpallimport-slide-content" style="padding-left:0;">
373
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][percentage_value]" style="width:100%;" value="<?php echo esc_attr($tax_rate['percentage_value']) ?>"/>
374
  </span>
375
  </div>
376
  </div>
377
  <span class="wpallimport-clear"></span>
378
  <div class="form-field wpallimport-radio-field">
379
- <input type="radio" id="product_tax_calculate_logic_per_unit_<?php echo $i . '_' . $j; ?>" name="pmwi_order[manual_products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][calculate_logic]" value="per_unit" <?php echo 'per_unit' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
380
- <label for="product_tax_calculate_logic_per_unit_<?php echo $i . '_' . $j; ?>" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
381
  <span class="wpallimport-clear"></span>
382
- <div class="switcher-target-product_tax_calculate_logic_per_unit_<?php echo $i . '_' . $j; ?>" style="padding-left:25px;">
383
  <span class="wpallimport-slide-content" style="padding-left:0;">
384
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][amount_per_unit]" style="width:100%;" value="<?php echo esc_attr($tax_rate['amount_per_unit']) ?>"/>
385
  </span>
386
  </div>
387
  </div>
388
  <span class="wpallimport-clear"></span>
389
  <div class="form-field wpallimport-radio-field">
390
- <input type="radio" id="product_tax_calculate_logic_lookup_<?php echo $i . '_' . $j; ?>" name="pmwi_order[manual_products][<?php echo $i; ?>][tax_rates][<?php echo $j; ?>][calculate_logic]" value="loocup" <?php echo 'loocup' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
391
- <label for="product_tax_calculate_logic_lookup_<?php echo $i . '_' . $j; ?>" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
392
  <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
393
  </div>
394
  <hr style="margin-left: 20px;">
@@ -402,149 +345,38 @@
402
  <div class="form-field">
403
  <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
404
  <div class="clear"></div>
405
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i;?>][tax_rates][ROWNUMBER][code]" style="width:100%;" value=""/>
406
- </div>
407
-
408
- <span class="wpallimport-clear"></span>
409
-
410
- <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
411
-
412
- <div class="form-field wpallimport-radio-field">
413
- <input type="radio" id="product_tax_calculate_logic_percentage_<?php echo $i;?>_ROWNUMBER" name="pmwi_order[manual_products][<?php echo $i;?>][tax_rates][ROWNUMBER][calculate_logic]" value="percentage" checked="checked" class="switcher"/>
414
- <label for="product_tax_calculate_logic_percentage_<?php echo $i;?>_ROWNUMBER" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
415
- <span class="wpallimport-clear"></span>
416
- <div class="switcher-target-product_tax_calculate_logic_percentage_<?php echo $i;?>_ROWNUMBER" style="padding-left:25px;">
417
- <span class="wpallimport-slide-content" style="padding-left:0;">
418
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i;?>][tax_rates][ROWNUMBER][percentage_value]" style="width:100%;" value=""/>
419
- </span>
420
- </div>
421
- </div>
422
- <span class="wpallimport-clear"></span>
423
- <div class="form-field wpallimport-radio-field">
424
- <input type="radio" id="product_tax_calculate_logic_per_unit_<?php echo $i;?>_ROWNUMBER" name="pmwi_order[manual_products][<?php echo $i;?>][tax_rates][ROWNUMBER][calculate_logic]" value="per_unit" class="switcher"/>
425
- <label for="product_tax_calculate_logic_per_unit_<?php echo $i;?>_ROWNUMBER" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
426
- <span class="wpallimport-clear"></span>
427
- <div class="switcher-target-product_tax_calculate_logic_per_unit_<?php echo $i;?>_ROWNUMBER" style="padding-left:25px;">
428
- <span class="wpallimport-slide-content" style="padding-left:0;">
429
- <input type="text" class="short rad4" name="pmwi_order[manual_products][<?php echo $i;?>][tax_rates][ROWNUMBER][amount_per_unit]" style="width:100%;" value=""/>
430
- </span>
431
- </div>
432
- </div>
433
- <span class="wpallimport-clear"></span>
434
- <div class="form-field wpallimport-radio-field">
435
- <input type="radio" id="product_tax_calculate_logic_lookup_<?php echo $i;?>_ROWNUMBER" name="pmwi_order[manual_products][<?php echo $i;?>][tax_rates][ROWNUMBER][calculate_logic]" value="loocup" class="switcher"/>
436
- <label for="product_tax_calculate_logic_lookup_<?php echo $i;?>_ROWNUMBER" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
437
- <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
438
- </div>
439
- <hr style="margin-left: 20px;">
440
- </td>
441
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
442
- </tr>
443
- <tr>
444
- <td colspan="2">
445
- <div class="form-field">
446
- <a class="add-new-line" title="Add Tax" href="javascript:void(0);"><?php _e("Add Tax", " wp_all_import_plugin"); ?></a>
447
  </div>
448
- </td>
449
- </tr>
450
- </table>
451
- </span>
452
- </div>
453
- <!-- <hr> -->
454
- </td>
455
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
456
- </tr>
457
-
458
- <?php endforeach; ?>
459
- <tr class="form-field template">
460
- <td colspan="2">
461
-
462
- <label><?php _e('Product Unique Key', PMWI_Plugin::TEXT_DOMAIN); ?></label>
463
- <div class="clear"></div>
464
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][unique_key]" value="" style="width:100%;"/>
465
-
466
- <span class="wpallimport-clear"></span>
467
-
468
- <label><?php _e('Product Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
469
- <div class="clear"></div>
470
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][sku]" value="" style="width:100%;"/>
471
-
472
- <span class="wpallimport-clear"></span>
473
-
474
- <table class="form-field">
475
- <tr class="form-field template">
476
- <td style="padding-right:10px;">
477
- <label><?php _e('Meta Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
478
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][meta_name][]" value="" style="width:100%;"/>
479
- </td>
480
- <td style="padding-left:10px;">
481
- <label><?php _e('Meta Value', PMWI_Plugin::TEXT_DOMAIN); ?></label>
482
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][meta_value][]" value="" style="width:100%;"/>
483
- </td>
484
- <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
485
- </tr>
486
- <tr>
487
- <td colspan="3">
488
- <a class="add-new-line" title="Add Product Meta" href="javascript:void(0);" style="display:block; margin: 5px 0; width:140px; top:0;padding-top:4px;"><?php _e("Add Product Meta", PMWI_Plugin::TEXT_DOMAIN); ?></a>
489
- </td>
490
- </tr>
491
- </table>
492
-
493
- <table>
494
- <tr>
495
- <td style="padding-right:10px;">
496
- <label><?php _e('Price per Unit', PMWI_Plugin::TEXT_DOMAIN); ?></label>
497
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][price_per_unit]" value="" style="width:100%;"/>
498
- </td>
499
- <td style="padding-left:10px;">
500
- <label><?php _e('Quantity', PMWI_Plugin::TEXT_DOMAIN); ?></label>
501
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][qty]" value="" style="width:100%;"/>
502
- </td>
503
- </tr>
504
- </table>
505
 
506
- <a class="switcher" id="taxes_manual_products_ROWNUMBER" href="javascript:void(0);" style="display: block;margin: 10px 0 15px;width: 50px;"><span>-</span> <?php _e("Taxes", PMWI_Plugin::TEXT_DOMAIN); ?></a>
507
- <div class="wpallimport-clear"></div>
508
- <div class="switcher-target-taxes_manual_products_ROWNUMBER">
509
- <span class="wpallimport-slide-content" style="padding-left:0;">
510
- <table style="width:45%;" class="taxes-form-table">
511
- <tr class="form-field template">
512
- <td>
513
- <div class="form-field">
514
- <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
515
- <div class="clear"></div>
516
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][tax_rates][CELLNUMBER][code]" style="width:100%;" value=""/>
517
- </div>
518
-
519
  <span class="wpallimport-clear"></span>
520
 
521
  <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
522
 
523
  <div class="form-field wpallimport-radio-field">
524
- <input type="radio" id="product_tax_calculate_logic_percentage_ROWNUMBER_CELLNUMBER" name="pmwi_order[manual_products][ROWNUMBER][tax_rates][CELLNUMBER][calculate_logic]" value="percentage" checked="checked" class="switcher"/>
525
- <label for="product_tax_calculate_logic_percentage_ROWNUMBER_CELLNUMBER" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
526
  <span class="wpallimport-clear"></span>
527
- <div class="switcher-target-product_tax_calculate_logic_percentage_ROWNUMBER_CELLNUMBER" style="padding-left:25px;">
528
  <span class="wpallimport-slide-content" style="padding-left:0;">
529
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][tax_rates][CELLNUMBER][percentage_value]" style="width:100%;" value=""/>
530
  </span>
531
  </div>
532
  </div>
533
  <span class="wpallimport-clear"></span>
534
  <div class="form-field wpallimport-radio-field">
535
- <input type="radio" id="product_tax_calculate_logic_per_unit_ROWNUMBER_CELLNUMBER" name="pmwi_order[manual_products][ROWNUMBER][tax_rates][CELLNUMBER][calculate_logic]" value="per_unit" class="switcher"/>
536
- <label for="product_tax_calculate_logic_per_unit_ROWNUMBER_CELLNUMBER" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
537
  <span class="wpallimport-clear"></span>
538
- <div class="switcher-target-product_tax_calculate_logic_per_unit_ROWNUMBER_CELLNUMBER" style="padding-left:25px;">
539
  <span class="wpallimport-slide-content" style="padding-left:0;">
540
- <input type="text" class="short rad4" name="pmwi_order[manual_products][ROWNUMBER][tax_rates][CELLNUMBER][amount_per_unit]" style="width:100%;" value=""/>
541
  </span>
542
  </div>
543
  </div>
544
  <span class="wpallimport-clear"></span>
545
  <div class="form-field wpallimport-radio-field">
546
- <input type="radio" id="product_tax_calculate_logic_lookup_ROWNUMBER_CELLNUMBER" name="pmwi_order[manual_products][ROWNUMBER][tax_rates][CELLNUMBER][calculate_logic]" value="loocup" class="switcher"/>
547
- <label for="product_tax_calculate_logic_lookup_ROWNUMBER_CELLNUMBER" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
548
  <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
549
  </div>
550
  <hr style="margin-left: 20px;">
@@ -560,15 +392,10 @@
560
  </tr>
561
  </table>
562
  </span>
563
- </div>
564
- <!-- <hr> -->
565
  </td>
566
  <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
567
- </tr>
568
- <tr class="wpallimport-row-actions" style="display:none;">
569
- <td colspan="3">
570
- <a class="add-new-line" title="Add Product" href="javascript:void(0);" style="width:200px;"><?php _e("Add Product", PMWI_Plugin::TEXT_DOMAIN); ?></a>
571
- </td>
572
  </tr>
573
  </table>
574
  </span>
@@ -586,7 +413,7 @@
586
  <div class="form-field wpallimport-radio-field wpallimport-clear">
587
  <input type="radio" id="products_repeater_mode_variable_csv" name="pmwi_order[products_repeater_mode]" value="csv" <?php echo 'csv' == $post['pmwi_order']['products_repeater_mode'] ? 'checked="checked"' : '' ?> class="switcher variable_repeater_mode"/>
588
  <label for="products_repeater_mode_variable_csv" style="width:auto; float: none;"><?php _e('Fixed Repeater Mode', PMWI_Plugin::TEXT_DOMAIN) ?></label>
589
- <div class="switcher-target-products_repeater_mode_variable_csv wpallimport-clear" style="padding: 10px 0 10px 25px; overflow: hidden;">
590
  <span class="wpallimport-slide-content" style="padding-left:0;">
591
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple products separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
592
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[products_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['products_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
@@ -596,7 +423,7 @@
596
  <div class="form-field wpallimport-radio-field wpallimport-clear">
597
  <input type="radio" id="products_repeater_mode_variable_xml" name="pmwi_order[products_repeater_mode]" value="xml" <?php echo 'xml' == $post['pmwi_order']['products_repeater_mode'] ? 'checked="checked"' : '' ?> class="switcher variable_repeater_mode"/>
598
  <label for="products_repeater_mode_variable_xml" style="width:auto; float: none;"><?php _e('Variable Repeater Mode', PMWI_Plugin::TEXT_DOMAIN) ?></label>
599
- <div class="switcher-target-products_repeater_mode_variable_xml wpallimport-clear" style="padding: 10px 0 10px 25px; overflow: hidden;">
600
  <span class="wpallimport-slide-content" style="padding-left:0;">
601
  <label style="width: 60px; line-height: 30px;"><?php _e('For each', PMWI_Plugin::TEXT_DOMAIN); ?></label>
602
  <input type="text" class="short rad4" name="pmwi_order[products_repeater_mode_foreach]" value="<?php echo esc_attr($post['pmwi_order']['products_repeater_mode_foreach']) ?>" style="width:50%;"/>
1
  <div class="panel woocommerce_options_panel" id="order_products">
2
  <div class="options_group hide_if_grouped">
3
  <!-- Product matching mode -->
 
 
 
 
 
4
  <div class="form-field wpallimport-radio-field">
5
  <input type="radio" id="products_source_existing" name="pmwi_order[products_source]" value="existing" <?php echo 'existing' == $post['pmwi_order']['products_source'] ? 'checked="checked"' : '' ?> class="switcher"/>
6
  <label for="products_source_existing" style="width:auto;"><?php _e('Get data from existing products', PMWI_Plugin::TEXT_DOMAIN) ?></label>
11
  <span class="wpallimport-slide-content" style="padding-left:0;">
12
  <table class="wpallimport_variable_table" style="width:100%;">
13
  <?php
14
+ $product = [];
15
+ if (!empty($post['pmwi_order']['products'])) {
16
+ $product = array_shift($post['pmwi_order']['products']);
17
+ }
18
+ $product += array('unique_key' => '', 'sku' => '', 'qty' => '', 'price_per_unit' => '', 'tax_rates' => [], 'meta_name' => [], 'meta_value' => []);
19
+ ?>
20
+ <tr>
21
+ <td colspan="2">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  <div style="float:left; width:50%;">
23
  <label><?php _e('Product Unique Key', PMWI_Plugin::TEXT_DOMAIN); ?></label>
24
+ <input type="text" class="short rad4" name="pmwi_order[products][0][unique_key]" value="<?php echo esc_attr($product['unique_key']) ?>" style="width:95%;"/>
25
+ </div>
26
+ <div style="float:right; width:50%;">
27
+ <label><?php _e('Quantity', PMWI_Plugin::TEXT_DOMAIN); ?></label>
28
+ <input type="text" class="short rad4" name="pmwi_order[products][0][qty]" value="<?php echo esc_attr($product['qty']) ?>" style="width:95%;"/>
29
  </div>
30
+ <div class="wpallimport-clear"></div>
 
 
 
 
31
  <div style="float:left; width:50%;">
32
+ <label><?php _e('Product SKU', PMWI_Plugin::TEXT_DOMAIN); ?></label>
33
+ <input type="text" class="short rad4" name="pmwi_order[products][0][sku]" value="<?php echo esc_attr($product['sku']) ?>" style="width:95%;"/>
34
+ </div>
35
+ <div style="float:right; width:50%;">
36
+ <label><?php _e('Price', PMWI_Plugin::TEXT_DOMAIN); ?></label>
37
+ <input type="text" class="short rad4" name="pmwi_order[products][0][price_per_unit]" value="<?php echo esc_attr($product['price_per_unit']) ?>" style="width:95%;"/>
38
+ </div>
39
+ <span class="wpallimport-clear"></span>
40
+
41
+ <table class="form-field">
42
+ <?php foreach ($product['meta_name'] as $j => $meta_name): if (empty($meta_name)) continue; ?>
43
+ <tr class="form-field">
44
+ <td style="padding-right:10px;">
45
+ <label><?php _e('Meta Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
46
+ <input type="text" class="short rad4" name="pmwi_order[products][0][meta_name][]" value="<?php echo esc_attr($meta_name); ?>" style="width:100%;"/>
47
+ </td>
48
+ <td style="padding-left:10px;">
49
+ <label><?php _e('Meta Value', PMWI_Plugin::TEXT_DOMAIN); ?></label>
50
+ <input type="text" class="short rad4" name="pmwi_order[products][0][meta_value][]" value="<?php echo esc_attr($product['meta_value'][$j]); ?>" style="width:100%;"/>
51
+ </td>
52
+ <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
53
+ </tr>
54
+ <?php endforeach; ?>
55
+ <tr class="form-field template">
56
+ <td style="padding-right:10px;">
57
+ <label><?php _e('Meta Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
58
+ <input type="text" class="short rad4" name="pmwi_order[products][0][meta_name][]" value="" style="width:100%;"/>
59
+ </td>
60
+ <td style="padding-left:10px;">
61
+ <label><?php _e('Meta Value', PMWI_Plugin::TEXT_DOMAIN); ?></label>
62
+ <input type="text" class="short rad4" name="pmwi_order[products][0][meta_value][]" value="" style="width:100%;"/>
63
+ </td>
64
+ <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
65
+ </tr>
66
+ <tr>
67
+ <td colspan="3">
68
+ <a class="add-new-line" title="Add Product Meta" href="javascript:void(0);" style="display:block;margin:5px 0;width:140px;top:0;padding-top:4px;"><?php empty($product['meta_name']) ? _e("Add Product Meta", PMWI_Plugin::TEXT_DOMAIN): _e("Add More Product Meta", PMWI_Plugin::TEXT_DOMAIN); ?></a>
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ <!-- Product Taxes -->
73
+ <a class="switcher" id="taxes_existing_products_0" href="javascript:void(0);" style="display: block;margin: 10px 0 15px;width: 50px;"><span>-</span> <?php _e("Taxes", PMWI_Plugin::TEXT_DOMAIN); ?></a>
74
+ <div class="wpallimport-clear"></div>
75
+ <div class="switcher-target-taxes_existing_products_0">
76
+ <span class="wpallimport-slide-content" style="padding-left:0;">
77
+ <table style="width:45%;" class="taxes-form-table">
78
+ <?php
79
+ foreach ($product['tax_rates'] as $j => $tax_rate):
80
+
81
+ $tax_rate += array(
82
+ 'code' => '',
83
+ 'calculate_logic' => 'percentage',
84
+ 'meta_name' => array(),
85
+ 'meta_value' => array(),
86
+ 'percentage_value' => '',
87
+ 'amount_per_unit' => ''
88
+ );
89
+
90
+ if (empty($tax_rate['code'])) continue;
91
+
92
+ ?>
93
+ <tr class="form-field">
94
+ <td>
95
+ <div class="form-field">
96
+ <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
97
+ <div class="clear"></div>
98
+ <input type="text" class="short rad4" name="pmwi_order[products][0][tax_rates][<?php echo $j; ?>][code]" style="width:100%;" value="<?php echo esc_attr($tax_rate['code']) ?>"/>
99
+ </div>
100
+
101
+ <span class="wpallimport-clear"></span>
102
+
103
+ <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
104
+
105
+ <div class="form-field wpallimport-radio-field">
106
+ <input type="radio" id="products_tax_calculate_logic_percentage_0_<?php echo $j; ?>" name="pmwi_order[products][0][tax_rates][<?php echo $j; ?>][calculate_logic]" value="percentage" <?php echo 'percentage' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
107
+ <label for="products_tax_calculate_logic_percentage_0_<?php echo $j; ?>" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
108
+ <span class="wpallimport-clear"></span>
109
+ <div class="switcher-target-products_tax_calculate_logic_percentage_0_<?php echo $j; ?>" style="padding-left:25px;">
110
+ <span class="wpallimport-slide-content" style="padding-left:0;">
111
+ <input type="text" class="short rad4" name="pmwi_order[products][0][tax_rates][<?php echo $j; ?>][percentage_value]" style="width:100%;" value="<?php echo esc_attr($tax_rate['percentage_value']) ?>"/>
112
+ </span>
113
+ </div>
114
+ </div>
115
+ <span class="wpallimport-clear"></span>
116
+ <div class="form-field wpallimport-radio-field">
117
+ <input type="radio" id="products_tax_calculate_logic_per_unit_0_<?php echo $j; ?>" name="pmwi_order[products][0][tax_rates][<?php echo $j; ?>][calculate_logic]" value="per_unit" <?php echo 'per_unit' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
118
+ <label for="products_tax_calculate_logic_per_unit_0_<?php echo $j; ?>" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
119
+ <span class="wpallimport-clear"></span>
120
+ <div class="switcher-target-products_tax_calculate_logic_per_unit_0_<?php echo $j; ?>" style="padding-left:25px;">
121
+ <span class="wpallimport-slide-content" style="padding-left:0;">
122
+ <input type="text" class="short rad4" name="pmwi_order[products][0][tax_rates][<?php echo $j; ?>][amount_per_unit]" style="width:100%;" value="<?php echo esc_attr($tax_rate['amount_per_unit']) ?>"/>
123
+ </span>
124
+ </div>
125
+ </div>
126
+ <span class="wpallimport-clear"></span>
127
+ <div class="form-field wpallimport-radio-field">
128
+ <input type="radio" id="products_tax_calculate_logic_lookup_0_<?php echo $j; ?>" name="pmwi_order[products][0][tax_rates][<?php echo $j; ?>][calculate_logic]" value="loocup" <?php echo 'loocup' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
129
+ <label for="products_tax_calculate_logic_lookup_0_<?php echo $j; ?>" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
130
+ <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
131
+ </div>
132
+ <hr style="margin-left: 20px;">
133
+ </td>
134
+ <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
135
+ </tr>
136
+ <?php endforeach; ?>
137
+ <tr class="form-field template">
138
+ <td>
139
+ <div class="form-field">
140
+ <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
141
+ <div class="clear"></div>
142
+ <input type="text" class="short rad4" name="pmwi_order[products][0][tax_rates][ROWNUMBER][code]" style="width:100%;" value=""/>
143
+ </div>
144
+
145
+ <span class="wpallimport-clear"></span>
146
+
147
+ <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
148
+
149
+ <div class="form-field wpallimport-radio-field">
150
+ <input type="radio" id="products_tax_calculate_logic_percentage_0_ROWNUMBER" name="pmwi_order[products][0][tax_rates][ROWNUMBER][calculate_logic]" value="percentage" checked="checked" class="switcher"/>
151
+ <label for="products_tax_calculate_logic_percentage_0_ROWNUMBER" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
152
+ <span class="wpallimport-clear"></span>
153
+ <div class="switcher-target-products_tax_calculate_logic_percentage_0_ROWNUMBER" style="padding-left:25px;">
154
+ <span class="wpallimport-slide-content" style="padding-left:0;">
155
+ <input type="text" class="short rad4" name="pmwi_order[products][0][tax_rates][ROWNUMBER][percentage_value]" style="width:100%;"/>
156
+ </span>
157
+ </div>
158
+ </div>
159
+ <span class="wpallimport-clear"></span>
160
+ <div class="form-field wpallimport-radio-field">
161
+ <input type="radio" id="products_tax_calculate_logic_per_unit_0_ROWNUMBER" name="pmwi_order[products][0][tax_rates][ROWNUMBER][calculate_logic]" value="per_unit" class="switcher"/>
162
+ <label for="products_tax_calculate_logic_per_unit_0_ROWNUMBER" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
163
+ <span class="wpallimport-clear"></span>
164
+ <div class="switcher-target-products_tax_calculate_logic_per_unit_0_ROWNUMBER" style="padding-left:25px;">
165
+ <span class="wpallimport-slide-content" style="padding-left:0;">
166
+ <input type="text" class="short rad4" name="pmwi_order[products][0][tax_rates][ROWNUMBER][amount_per_unit]" style="width:100%;"/>
167
+ </span>
168
+ </div>
169
+ </div>
170
+ <span class="wpallimport-clear"></span>
171
+ <div class="form-field wpallimport-radio-field">
172
+ <input type="radio" id="products_tax_calculate_logic_lookup_0_ROWNUMBER" name="pmwi_order[products][0][tax_rates][ROWNUMBER][calculate_logic]" value="loocup" class="switcher"/>
173
+ <label for="products_tax_calculate_logic_lookup_0_ROWNUMBER" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
174
+ <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
175
+ </div>
176
+ <hr style="margin-left: 20px;">
177
+ </td>
178
+ <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
179
+ </tr>
180
+ <tr>
181
+ <td colspan="2">
182
+ <div class="form-field">
183
+ <a class="add-new-line" title="Add Tax" href="javascript:void(0);"><?php _e("Add Tax", " wp_all_import_plugin"); ?></a>
184
+ </div>
185
+ </td>
186
+ </tr>
187
+ </table>
188
+ </span>
189
+ </div>
190
+ <!-- <hr> -->
191
+ </td>
192
+ <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
193
+ </tr>
194
  </table>
195
  </span>
196
  </div>
206
  <div class="switcher-target-products_source_new" style="padding-left:45px;">
207
  <span class="wpallimport-slide-content" style="padding-left:0;">
208
  <table class="wpallimport_variable_table">
209
+ <?php
210
+ $product = [];
211
+ if (!empty($post['pmwi_order']['manual_products'])) {
212
+ $product = array_shift($post['pmwi_order']['manual_products']);
213
+ }
214
+ $product += array(
215
+ 'unique_key' => '',
216
+ 'sku' => '',
217
+ 'meta_name' => array(),
218
+ 'meta_value' => array(),
219
+ 'price_per_unit' => '',
220
+ 'qty' => '',
221
+ 'tax_rates' => array()
222
+ );
223
+ ?>
 
224
  <tr class="form-field">
225
  <td colspan="2">
226
+
227
  <label><?php _e('Product Unique Key', PMWI_Plugin::TEXT_DOMAIN); ?></label>
228
  <div class="clear"></div>
229
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][unique_key]" value="<?php echo esc_attr($product['unique_key']) ?>" style="width:100%;"/>
230
 
231
  <span class="wpallimport-clear"></span>
232
 
233
  <label><?php _e('Product Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
234
  <div class="clear"></div>
235
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][sku]" value="<?php echo esc_attr($product['sku']) ?>" style="width:100%;"/>
236
+
237
  <span class="wpallimport-clear"></span>
238
 
239
  <table class="form-field">
240
  <?php foreach ($product['meta_name'] as $j => $meta_name): if (empty($meta_name)) continue; ?>
241
+ <tr class="form-field">
242
  <td style="padding-right:10px;">
243
  <label><?php _e('Meta Name', PMWI_Plugin::TEXT_DOMAIN); ?></label>
244
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][meta_name][]" value="<?php echo esc_attr($meta_name); ?>" style="width:100%;"/>
245
  </td>
246
  <td style="padding-left:10px;">
247
  <label><?php _e('Meta Value', PMWI_Plugin::TEXT_DOMAIN); ?></label>
248
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][meta_value][]" value="<?php echo esc_attr($product['meta_value'][$j]); ?>" style="width:100%;"/>
249
  </td>
250
  <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
251
+ </tr>
252
  <?php endforeach; ?>
253
  <tr class="form-field template">
254
  <td style="padding-right:10px;">
262
  <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
263
  </tr>
264
  <tr>
265
+ <td colspan="3">
266
  <a class="add-new-line" title="Add Product Meta" href="javascript:void(0);" style="display:block;margin:5px 0;width:140px;top:0;padding-top:4px;"><?php empty($product['meta_name']) ? _e("Add Product Meta", PMWI_Plugin::TEXT_DOMAIN): _e("Add More Product Meta", PMWI_Plugin::TEXT_DOMAIN); ?></a>
267
  </td>
268
  </tr>
272
  <tr>
273
  <td style="padding-right:10px;">
274
  <label><?php _e('Price per Unit', PMWI_Plugin::TEXT_DOMAIN); ?></label>
275
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][price_per_unit]" value="<?php echo esc_attr($product['price_per_unit']) ?>" style="width:100%;"/>
276
  </td>
277
  <td style="padding-left: 10px;">
278
  <label><?php _e('Quantity', PMWI_Plugin::TEXT_DOMAIN); ?></label>
279
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][qty]" value="<?php echo esc_attr($product['qty']) ?>" style="width:100%;"/>
280
  </td>
281
+ </tr>
282
  </table>
283
 
284
+ <a class="switcher" id="taxes_manual_products_0" href="javascript:void(0);" style="display: block;margin: 10px 0 15px;width: 50px;"><span>-</span> <?php _e("Taxes", PMWI_Plugin::TEXT_DOMAIN); ?></a>
285
  <div class="wpallimport-clear"></div>
286
+ <div class="switcher-target-taxes_manual_products_0">
287
  <span class="wpallimport-slide-content" style="padding-left:0;">
288
  <table style="width:45%;" class="taxes-form-table">
289
+ <?php
290
+ foreach ($product['tax_rates'] as $j => $tax_rate):
291
 
292
+ $tax_rate += array('code' => '', 'calculate_logic' => 'percentage', 'percentage_value' => '', 'amount_per_unit' => '');
293
 
294
  if (empty($tax_rate['code'])) continue;
295
 
296
  ?>
297
 
298
+ <tr class="form-field">
299
  <td>
300
  <div class="form-field">
301
  <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
302
  <div class="clear"></div>
303
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][tax_rates][<?php echo $j; ?>][code]" style="width:100%;" value="<?php echo esc_attr($tax_rate['code']) ?>"/>
304
  </div>
305
+
306
  <span class="wpallimport-clear"></span>
307
 
308
  <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
309
 
310
  <div class="form-field wpallimport-radio-field">
311
+ <input type="radio" id="manual_products_tax_calculate_logic_percentage_0_<?php echo $j; ?>" name="pmwi_order[manual_products][0][tax_rates][<?php echo $j; ?>][calculate_logic]" value="percentage" <?php echo 'percentage' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
312
+ <label for="manual_products_tax_calculate_logic_percentage_0_<?php echo $j; ?>" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
313
  <span class="wpallimport-clear"></span>
314
+ <div class="switcher-target-manual_products_tax_calculate_logic_percentage_0_<?php echo $j; ?>" style="padding-left:25px;">
315
  <span class="wpallimport-slide-content" style="padding-left:0;">
316
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][tax_rates][<?php echo $j; ?>][percentage_value]" style="width:100%;" value="<?php echo esc_attr($tax_rate['percentage_value']) ?>"/>
317
  </span>
318
  </div>
319
  </div>
320
  <span class="wpallimport-clear"></span>
321
  <div class="form-field wpallimport-radio-field">
322
+ <input type="radio" id="manual_products_tax_calculate_logic_per_unit_0_<?php echo $j; ?>" name="pmwi_order[manual_products][0][tax_rates][<?php echo $j; ?>][calculate_logic]" value="per_unit" <?php echo 'per_unit' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
323
+ <label for="manual_products_tax_calculate_logic_per_unit_0_<?php echo $j; ?>" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
324
  <span class="wpallimport-clear"></span>
325
+ <div class="switcher-target-manual_products_tax_calculate_logic_per_unit_0_<?php echo $j; ?>" style="padding-left:25px;">
326
  <span class="wpallimport-slide-content" style="padding-left:0;">
327
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][tax_rates][<?php echo $j; ?>][amount_per_unit]" style="width:100%;" value="<?php echo esc_attr($tax_rate['amount_per_unit']) ?>"/>
328
  </span>
329
  </div>
330
  </div>
331
  <span class="wpallimport-clear"></span>
332
  <div class="form-field wpallimport-radio-field">
333
+ <input type="radio" id="manual_products_tax_calculate_logic_lookup_0_<?php echo $j; ?>" name="pmwi_order[manual_products][0][tax_rates][<?php echo $j; ?>][calculate_logic]" value="loocup" <?php echo 'loocup' == $tax_rate['calculate_logic'] ? 'checked="checked"' : '' ?> class="switcher"/>
334
+ <label for="manual_products_tax_calculate_logic_lookup_0_<?php echo $j; ?>" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
335
  <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
336
  </div>
337
  <hr style="margin-left: 20px;">
345
  <div class="form-field">
346
  <label><?php _e('Tax Rate Code', PMWI_Plugin::TEXT_DOMAIN); ?></label>
347
  <div class="clear"></div>
348
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][tax_rates][ROWNUMBER][code]" style="width:100%;" value=""/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  <span class="wpallimport-clear"></span>
352
 
353
  <p class="form-field"><?php _e("Calculate Tax Amount By:", PMWI_Plugin::TEXT_DOMAIN);?></p>
354
 
355
  <div class="form-field wpallimport-radio-field">
356
+ <input type="radio" id="manual_products_tax_calculate_logic_percentage_0_ROWNUMBER" name="pmwi_order[manual_products][0][tax_rates][ROWNUMBER][calculate_logic]" value="percentage" checked="checked" class="switcher"/>
357
+ <label for="manual_products_tax_calculate_logic_percentage_0_ROWNUMBER" style="width:auto;"><?php _e('Percentage', PMWI_Plugin::TEXT_DOMAIN) ?></label>
358
  <span class="wpallimport-clear"></span>
359
+ <div class="switcher-target-manual_products_tax_calculate_logic_percentage_0_ROWNUMBER" style="padding-left:25px;">
360
  <span class="wpallimport-slide-content" style="padding-left:0;">
361
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][tax_rates][ROWNUMBER][percentage_value]" style="width:100%;" value=""/>
362
  </span>
363
  </div>
364
  </div>
365
  <span class="wpallimport-clear"></span>
366
  <div class="form-field wpallimport-radio-field">
367
+ <input type="radio" id="manual_products_tax_calculate_logic_per_unit_0_ROWNUMBER" name="pmwi_order[manual_products][0][tax_rates][ROWNUMBER][calculate_logic]" value="per_unit" class="switcher"/>
368
+ <label for="manual_products_tax_calculate_logic_per_unit_0_ROWNUMBER" style="width:auto;"><?php _e('Tax amount per unit', PMWI_Plugin::TEXT_DOMAIN) ?></label>
369
  <span class="wpallimport-clear"></span>
370
+ <div class="switcher-target-manual_products_tax_calculate_logic_per_unit_0_ROWNUMBER" style="padding-left:25px;">
371
  <span class="wpallimport-slide-content" style="padding-left:0;">
372
+ <input type="text" class="short rad4" name="pmwi_order[manual_products][0][tax_rates][ROWNUMBER][amount_per_unit]" style="width:100%;" value=""/>
373
  </span>
374
  </div>
375
  </div>
376
  <span class="wpallimport-clear"></span>
377
  <div class="form-field wpallimport-radio-field">
378
+ <input type="radio" id="manual_products_tax_calculate_logic_lookup_0_ROWNUMBER" name="pmwi_order[manual_products][0][tax_rates][ROWNUMBER][calculate_logic]" value="loocup" class="switcher"/>
379
+ <label for="manual_products_tax_calculate_logic_lookup_0_ROWNUMBER" style="width:auto;"><?php _e('Look up tax rate code', PMWI_Plugin::TEXT_DOMAIN) ?></label>
380
  <a href="#help" class="wpallimport-help" title="<?php _e('If rate code is not found, this tax amount will not be imported.', PMWI_Plugin::TEXT_DOMAIN) ?>" style="position:relative; top:0px;">?</a>
381
  </div>
382
  <hr style="margin-left: 20px;">
392
  </tr>
393
  </table>
394
  </span>
395
+ </div>
396
+ <!-- <hr> -->
397
  </td>
398
  <td class="action remove"><a href="#remove" style="top: 33px;"></a></td>
 
 
 
 
 
399
  </tr>
400
  </table>
401
  </span>
413
  <div class="form-field wpallimport-radio-field wpallimport-clear">
414
  <input type="radio" id="products_repeater_mode_variable_csv" name="pmwi_order[products_repeater_mode]" value="csv" <?php echo 'csv' == $post['pmwi_order']['products_repeater_mode'] ? 'checked="checked"' : '' ?> class="switcher variable_repeater_mode"/>
415
  <label for="products_repeater_mode_variable_csv" style="width:auto; float: none;"><?php _e('Fixed Repeater Mode', PMWI_Plugin::TEXT_DOMAIN) ?></label>
416
+ <div class="switcher-target-products_repeater_mode_variable_csv wpallimport-clear" style="padding: 10px 0 10px 25px;">
417
  <span class="wpallimport-slide-content" style="padding-left:0;">
418
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple products separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
419
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[products_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['products_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
423
  <div class="form-field wpallimport-radio-field wpallimport-clear">
424
  <input type="radio" id="products_repeater_mode_variable_xml" name="pmwi_order[products_repeater_mode]" value="xml" <?php echo 'xml' == $post['pmwi_order']['products_repeater_mode'] ? 'checked="checked"' : '' ?> class="switcher variable_repeater_mode"/>
425
  <label for="products_repeater_mode_variable_xml" style="width:auto; float: none;"><?php _e('Variable Repeater Mode', PMWI_Plugin::TEXT_DOMAIN) ?></label>
426
+ <div class="switcher-target-products_repeater_mode_variable_xml wpallimport-clear" style="padding: 10px 0 10px 25px;">
427
  <span class="wpallimport-slide-content" style="padding-left:0;">
428
  <label style="width: 60px; line-height: 30px;"><?php _e('For each', PMWI_Plugin::TEXT_DOMAIN); ?></label>
429
  <input type="text" class="short rad4" name="pmwi_order[products_repeater_mode_foreach]" value="<?php echo esc_attr($post['pmwi_order']['products_repeater_mode_foreach']) ?>" style="width:50%;"/>
views/admin/import/shop_order/_tabs/_order_item_taxes.php CHANGED
@@ -47,7 +47,8 @@
47
  <td colspan="2">
48
  <label><?php _e('Tax Rate', PMWI_Plugin::TEXT_DOMAIN); ?></label>
49
  <span class="wpallimport-clear"></span>
50
- <select name="pmwi_order[taxes][<?php echo $i;?>][tax_code]" id="order_tax_code_<?php echo $i;?>" class="rad4 switcher" style="font-size: 14px !important;">
 
51
  <?php
52
  $taxes_for_tooltip = array();
53
  foreach ($classes_options as $key => $value):?>
47
  <td colspan="2">
48
  <label><?php _e('Tax Rate', PMWI_Plugin::TEXT_DOMAIN); ?></label>
49
  <span class="wpallimport-clear"></span>
50
+ <select name="pmwi_order[taxes][<?php echo $i;?>][tax_code]" id="order_tax_code_<?php echo $i;?>" class="rad4 switcher" style="font-size: 14px !important;">
51
+ <option value=""><?php _e("Select",PMWI_Plugin::TEXT_DOMAIN);?></option>
52
  <?php
53
  $taxes_for_tooltip = array();
54
  foreach ($classes_options as $key => $value):?>