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

Version Description

  • improvement: compatibility with WordPress 5.5
Download this release

Release Info

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

Code changes from version 1.4.5 to 1.4.6

libraries/XmlImportWooCommerceService.php CHANGED
@@ -89,9 +89,17 @@ final class XmlImportWooCommerceService {
89
  if (empty($importID)) {
90
  $importID = $input->get('import_id');
91
  }
92
- if (empty($importID)) {
93
  $importID = \PMXI_Plugin::$session->import_id;
94
  }
 
 
 
 
 
 
 
 
95
  if ($importID && ($this->import->isEmpty() || $this->import->id != $importID)) {
96
  $this->import->getById($importID);
97
  }
@@ -162,14 +170,29 @@ final class XmlImportWooCommerceService {
162
  $parentAttributes = get_post_meta($product->get_id(), '_product_attributes', TRUE);
163
  // Sync attribute terms with parent product.
164
  if (!empty($parentAttributes)) {
165
- $variation_attributes = $product->get_variation_attributes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  foreach ($parentAttributes as $name => $parentAttribute) {
167
  // Only in case if attribute marked to import as taxonomy terms.
168
  if ($parentAttribute['is_taxonomy']) {
 
169
  $terms = [];
170
  if (!empty($variation_attributes[$name])) {
171
  foreach ($variation_attributes[$name] as $attribute_term_slug) {
172
- $term = get_term_by('slug', $attribute_term_slug, $name);
173
  if ($term && !is_wp_error($term)) {
174
  $terms[] = $term->term_taxonomy_id;
175
  }
@@ -179,7 +202,7 @@ final class XmlImportWooCommerceService {
179
  $terms = array_filter($terms);
180
  }
181
  if (!empty($terms)) {
182
- $this->getTaxonomiesService()->associateTerms($parentID, $terms, $name);
183
  }
184
  }
185
  }
@@ -214,7 +237,28 @@ final class XmlImportWooCommerceService {
214
  }
215
  }
216
  }
217
- $defaultAttributes = $defaultVariation ? $defaultVariation->get_attributes() : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  }
219
  $product->set_default_attributes($defaultAttributes);
220
  }
89
  if (empty($importID)) {
90
  $importID = $input->get('import_id');
91
  }
92
+ if (empty($importID) && !empty(\PMXI_Plugin::$session)) {
93
  $importID = \PMXI_Plugin::$session->import_id;
94
  }
95
+ if (empty($importID) && php_sapi_name() === 'cli') {
96
+ global $argv;
97
+ foreach ($argv as $key => $arg) {
98
+ if ($arg === 'run' && !empty($argv[$key + 1])) {
99
+ $importID = $argv[$key + 1];
100
+ }
101
+ }
102
+ }
103
  if ($importID && ($this->import->isEmpty() || $this->import->id != $importID)) {
104
  $this->import->getById($importID);
105
  }
170
  $parentAttributes = get_post_meta($product->get_id(), '_product_attributes', TRUE);
171
  // Sync attribute terms with parent product.
172
  if (!empty($parentAttributes)) {
173
+ $variation_attributes = [];
174
+ foreach ($variations as $variation) {
175
+ $attributes = $variation->get_attributes();
176
+ if (!empty($attributes)) {
177
+ foreach ($attributes as $attribute_name => $attribute_value) {
178
+ if (!isset($variation_attributes[$attribute_name])) {
179
+ $variation_attributes[$attribute_name] = [];
180
+ }
181
+ if (!in_array($attribute_value, $variation_attributes[$attribute_name])) {
182
+ $variation_attributes[$attribute_name][] = $attribute_value;
183
+ }
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']) {
191
+ $taxonomy_name = strpos($name, "%") !== FALSE ? urldecode($name) : $name;
192
  $terms = [];
193
  if (!empty($variation_attributes[$name])) {
194
  foreach ($variation_attributes[$name] as $attribute_term_slug) {
195
+ $term = get_term_by('slug', $attribute_term_slug, $taxonomy_name);
196
  if ($term && !is_wp_error($term)) {
197
  $terms[] = $term->term_taxonomy_id;
198
  }
202
  $terms = array_filter($terms);
203
  }
204
  if (!empty($terms)) {
205
+ $this->getTaxonomiesService()->associateTerms($parentID, $terms, $taxonomy_name);
206
  }
207
  }
208
  }
237
  }
238
  }
239
  }
240
+ if ($defaultVariation) {
241
+ foreach ($defaultVariation->get_attributes() as $key => $value) {
242
+ if (!empty($value)) {
243
+ $defaultAttributes[$key] = $value;
244
+ } else {
245
+ // Variation can be applied to any value of this attribute.
246
+ if (isset($parentAttributes[$key])) {
247
+ // Get first value from parent product.
248
+ if ($parentAttributes[$key]['is_taxonomy']) {
249
+ $terms = explode("|", $parentAttributes[$key]['value']);
250
+ $terms = array_filter($terms);
251
+ if (!empty($terms)) {
252
+ $term = WP_Term::get_instance($terms[0]);
253
+ if ($term) {
254
+ $defaultAttributes[$key] = $term->slug;
255
+ }
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
  }
263
  $product->set_default_attributes($defaultAttributes);
264
  }
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.5
7
  Author: Soflyy
8
- WC tested up to: 4.1.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.5');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
@@ -814,7 +814,27 @@ else {
814
  'existing_parent_product_matching_logic' => 'custom field',
815
  'existing_parent_product_title' => '',
816
  'existing_parent_product_cf_name' => '_sku',
817
- 'existing_parent_product_cf_value' => ''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
818
  );
819
  }
820
  }
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
  }
26
  else {
27
 
28
+ define('PMWI_FREE_VERSION', '1.4.6');
29
 
30
  define('PMWI_EDITION', 'free');
31
 
814
  'existing_parent_product_matching_logic' => 'custom field',
815
  'existing_parent_product_title' => '',
816
  'existing_parent_product_cf_name' => '_sku',
817
+ 'existing_parent_product_cf_value' => '',
818
+ // WooCommerce Subscriptions
819
+ 'single_product_subscription_price' => '',
820
+ 'single_product_subscription_sign_up_fee' => '',
821
+ 'is_multiple_product_subscription_period_interval' => 'yes',
822
+ 'multiple_product_subscription_period_interval' => 1,
823
+ 'single_product_subscription_period_interval' => '',
824
+
825
+ 'is_multiple_product_subscription_period' => 'yes',
826
+ 'multiple_product_subscription_period' => 'month',
827
+ 'single_product_subscription_period' => '',
828
+
829
+ 'is_multiple_product_subscription_trial_period' => 'yes',
830
+ 'multiple_product_subscription_trial_period' => 0,
831
+ 'single_product_subscription_trial_period' => '',
832
+ 'is_multiple_product_subscription_length' => 'yes',
833
+ 'multiple_product_subscription_length' => 0,
834
+ 'single_product_subscription_length' => '',
835
+ 'is_multiple_product_subscription_limit' => 'yes',
836
+ 'multiple_product_subscription_limit' => 'no',
837
+ 'single_product_subscription_limit' => ''
838
  );
839
  }
840
  }
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.4
5
- Stable tag: 1.4.5
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,9 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
83
 
84
  == Changelog ==
85
 
 
 
 
86
  = 1.4.5 =
87
  * improvement: updated tested up to version
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.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
 
84
  == Changelog ==
85
 
86
+ = 1.4.6 =
87
+ * improvement: compatibility with WordPress 5.5
88
+
89
  = 1.4.5 =
90
  * improvement: updated tested up to version
91
 
static/js/admin.js CHANGED
@@ -288,8 +288,7 @@
288
  $('#link_all_variations').change(function(){
289
  if ($(this).is(':checked')) {
290
  $('.variations_tab').hide();
291
- }
292
- else {
293
  $('.variations_tab').show();
294
  }
295
  });
@@ -336,10 +335,7 @@
336
  $('#variations_xpath').each(function () {
337
 
338
  var $input = $('#variations_xpath');
339
- var $xml = $('#variations_xml');
340
- var $next_element = $('#next_variation_element');
341
- var $prev_element = $('#prev_variation_element');
342
- var $goto_element = $('#goto_variation_element');
343
  var $variation_tagno = 0;
344
 
345
  var variationsXPathChanged = function () {
@@ -359,7 +355,7 @@
359
  }, 'json');
360
  };
361
 
362
- $xml.find('.navigation a').live('click', function (e) {
363
  e.preventDefault();
364
  $variation_tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
365
  $input.data('checkedValue', '');
@@ -384,7 +380,7 @@
384
  });
385
 
386
 
387
- $('.variation_attributes').find('label').live({
388
  mouseenter: function () {
389
  if ("" == $(this).attr('for')) {
390
  var counter = $(this).parents('table:first').find('tr.form-field:visible').length;
@@ -455,8 +451,7 @@
455
  if (attrs.length) {
456
  $(this).parents('#product:first').find('input[name=unique_key]').val($unique_key + attrs.join('-'));
457
  alert('The unique key has been successfully generated');
458
- }
459
- else {
460
  alert('At first, you should add minimum one attribute on the "Attributes" tab.');
461
  }
462
  });
@@ -465,8 +460,7 @@
465
  if ($(this).val() == '%') {
466
  $(this).parents('.form-field:first').find('.pmwi_reduce_prices_note').hide();
467
  $(this).parents('.form-field:first').find('.pmwi_percentage_prices_note').show();
468
- }
469
- else {
470
  $(this).parents('.form-field:first').find('.pmwi_reduce_prices_note').show();
471
  $(this).parents('.form-field:first').find('.pmwi_percentage_prices_note').hide();
472
  }
@@ -474,16 +468,14 @@
474
 
475
  if ($('input[name=matching_parent]:checked').val() == 'first_is_parent_id' || $('input[name=matching_parent]:checked').val() == 'first_is_variation'){
476
  $('.set_parent_stock_option').slideDown();
477
- }
478
- else{
479
  $('.set_parent_stock_option').slideUp();
480
  }
481
 
482
  $('input[name=matching_parent]').click(function(){
483
  if ($(this).val() == 'first_is_parent_id' || $(this).val() == 'first_is_variation'){
484
  $('.set_parent_stock_option').slideDown();
485
- }
486
- else{
487
  $('.set_parent_stock_option').slideUp();
488
  }
489
  });
@@ -491,23 +483,27 @@
491
  $('.pmwi_trigger_adjust_prices').click(function(){
492
  if ($(this).find('span').html() == '-') {
493
  $(this).find('span').html('+');
494
- }
495
- else {
496
  $(this).find('span').html('-');
497
  }
498
  $('.pmwi_adjust_prices').slideToggle();
499
  });
500
 
501
- $('.advanced_attributes').live('click', function(){
502
  var $parent = $(this).parent('div.wpallimport-radio-field:first');
503
-
504
  if ($(this).find('span').html() == "+") {
505
  $parent.find('.default_attribute_settings').hide();
 
 
 
 
 
 
 
506
  $parent.find('.advanced_attribute_settings').fadeIn();
507
  $parent.find('input[name^=is_advanced]').val('1');
508
  $(this).find('span').html("-");
509
- }
510
- else {
511
  $parent.find('.advanced_attribute_settings').hide();
512
  $parent.find('.default_attribute_settings').fadeIn();
513
  $parent.find('input[name^=is_advanced]').val('0');
@@ -524,20 +520,17 @@
524
 
525
  // [ WC Orders View ]
526
  // swither show/hide logic
527
- $('select.switcher').live('change', function (e) {
528
-
529
  var $targets = $('.switcher-target-' + $(this).attr('id'));
530
-
531
  var is_show = $(this).val() == 'xpath'; if ($(this).is('.switcher-reversed')) is_show = ! is_show;
532
  if (is_show) {
533
  $targets.slideDown();
534
  } else {
535
  $targets.slideUp().find('.clear-on-switch').add($targets.filter('.clear-on-switch')).val('');
536
  }
537
-
538
  }).change();
539
 
540
- $('a.add-new-line').live('click', function(){
541
  var $parent = $(this).parents('table').first();
542
  var $template = $parent.children('tbody').children('tr.template');
543
  var $clone = $template.clone(true);
@@ -547,7 +540,30 @@
547
 
548
  $clone.html($cloneHtml);
549
 
550
- $clone.insertBefore($template).css('display', 'none').removeClass('template').fadeIn();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
551
 
552
  // datepicker
553
  $parent.find('input.datepicker').removeClass('date-picker').addClass('datepicker').datepicker({
@@ -587,14 +603,11 @@
587
  }
588
  });
589
 
590
- $('a.switcher').live('click', function (e) {
591
-
592
  var $targets = $('.switcher-target-' + $(this).attr('id'));
593
-
594
  var is_show = $(this).find('span').html() == '+'; if ($(this).is('.switcher-reversed')) is_show = ! is_show;
595
  if (is_show) {
596
  $(this).find('span').html('-');
597
-
598
  if ($targets.find('a.add-new-line').length){
599
  var $parent = $targets.find('a.add-new-line').parents('table:first');
600
  if ($parent.children('tbody').children('tr').length == 2){
@@ -602,12 +615,9 @@
602
  var $taxes = $add_new.parents('table').first();
603
  var $template = $taxes.children('tbody').children('tr.template');
604
  var $clone = $template.clone(true);
605
- var $number = parseInt($taxes.find('tbody:first').children().not('.template').length) - 1;
606
-
607
  var $cloneHtml = $clone.html().replace(/ROWNUMBER/g, $number).replace(/CELLNUMBER/g, 'ROWNUMBER').replace('date-picker', 'datepicker');
608
-
609
- $clone.html($cloneHtml);
610
-
611
  $clone.insertBefore($template).css('display', 'none').removeClass('template').show();
612
  }
613
  }
@@ -618,14 +628,13 @@
618
  }
619
  }).click();
620
 
621
- $('.variable_repeater_mode').live('change', function(){
622
  // if variable mode
623
  if ($(this).is(':checked')) {
624
  var $parent = $(this).parents('.options_group:first');
625
  if ($(this).val() == 'xml' || $(this).val() == 'csv') {
626
  $parent.find('table.wpallimport_variable_table').find('tr.wpallimport-row-actions').hide();
627
- }
628
- else {
629
  $parent.find('table.wpallimport_variable_table').find('tr.wpallimport-row-actions').show();
630
  }
631
  }
@@ -639,25 +648,23 @@
639
  $('#billing_is_guest_matching').on('change', function(){
640
  if ($(this).is(':checked')){
641
  $('.is_guest_matching_notice').hide();
642
- }
643
- else{
644
  $('.is_guest_matching_notice').slideDown();
645
  }
646
  }).change();
647
 
648
- $('input[name="is_multiple_product_subscription_period"]').live('click', function(){
649
  if ($(this).val() == 'no') {
650
  $('select[name="multiple_product_subscription_length"]').html($('.subscription_length-xpath').html());
651
- }
652
- else {
653
  var $period = $('select[name="multiple_product_subscription_period"]').val();
654
  $('select[name="multiple_product_subscription_length"]').html($('.subscription_length-' + $period).html());
655
- }
656
  });
657
 
658
  $('input[name="is_multiple_product_subscription_period"]:checked').click();
659
 
660
- $('select[name="multiple_product_subscription_period"]').live('change', function(){
661
  $('select[name="multiple_product_subscription_length"]').html($('.subscription_length-' + $(this).val()).html());
662
  });
663
 
288
  $('#link_all_variations').change(function(){
289
  if ($(this).is(':checked')) {
290
  $('.variations_tab').hide();
291
+ } else {
 
292
  $('.variations_tab').show();
293
  }
294
  });
335
  $('#variations_xpath').each(function () {
336
 
337
  var $input = $('#variations_xpath');
338
+ var $xml = $('#variations_xml');
 
 
 
339
  var $variation_tagno = 0;
340
 
341
  var variationsXPathChanged = function () {
355
  }, 'json');
356
  };
357
 
358
+ $(document).on('click', '.variations_tag .title .navigation a', function (e) {
359
  e.preventDefault();
360
  $variation_tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
361
  $input.data('checkedValue', '');
380
  });
381
 
382
 
383
+ $('.variation_attributes').find('label').on({
384
  mouseenter: function () {
385
  if ("" == $(this).attr('for')) {
386
  var counter = $(this).parents('table:first').find('tr.form-field:visible').length;
451
  if (attrs.length) {
452
  $(this).parents('#product:first').find('input[name=unique_key]').val($unique_key + attrs.join('-'));
453
  alert('The unique key has been successfully generated');
454
+ } else {
 
455
  alert('At first, you should add minimum one attribute on the "Attributes" tab.');
456
  }
457
  });
460
  if ($(this).val() == '%') {
461
  $(this).parents('.form-field:first').find('.pmwi_reduce_prices_note').hide();
462
  $(this).parents('.form-field:first').find('.pmwi_percentage_prices_note').show();
463
+ } else {
 
464
  $(this).parents('.form-field:first').find('.pmwi_reduce_prices_note').show();
465
  $(this).parents('.form-field:first').find('.pmwi_percentage_prices_note').hide();
466
  }
468
 
469
  if ($('input[name=matching_parent]:checked').val() == 'first_is_parent_id' || $('input[name=matching_parent]:checked').val() == 'first_is_variation'){
470
  $('.set_parent_stock_option').slideDown();
471
+ } else {
 
472
  $('.set_parent_stock_option').slideUp();
473
  }
474
 
475
  $('input[name=matching_parent]').click(function(){
476
  if ($(this).val() == 'first_is_parent_id' || $(this).val() == 'first_is_variation'){
477
  $('.set_parent_stock_option').slideDown();
478
+ } else {
 
479
  $('.set_parent_stock_option').slideUp();
480
  }
481
  });
483
  $('.pmwi_trigger_adjust_prices').click(function(){
484
  if ($(this).find('span').html() == '-') {
485
  $(this).find('span').html('+');
486
+ } else {
 
487
  $(this).find('span').html('-');
488
  }
489
  $('.pmwi_adjust_prices').slideToggle();
490
  });
491
 
492
+ $('.advanced_attributes').on('click', function(){
493
  var $parent = $(this).parent('div.wpallimport-radio-field:first');
 
494
  if ($(this).find('span').html() == "+") {
495
  $parent.find('.default_attribute_settings').hide();
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
+ });
503
  $parent.find('.advanced_attribute_settings').fadeIn();
504
  $parent.find('input[name^=is_advanced]').val('1');
505
  $(this).find('span').html("-");
506
+ } else {
 
507
  $parent.find('.advanced_attribute_settings').hide();
508
  $parent.find('.default_attribute_settings').fadeIn();
509
  $parent.find('input[name^=is_advanced]').val('0');
520
 
521
  // [ WC Orders View ]
522
  // swither show/hide logic
523
+ $('select.switcher').on('change', function (e) {
 
524
  var $targets = $('.switcher-target-' + $(this).attr('id'));
 
525
  var is_show = $(this).val() == 'xpath'; if ($(this).is('.switcher-reversed')) is_show = ! is_show;
526
  if (is_show) {
527
  $targets.slideDown();
528
  } else {
529
  $targets.slideUp().find('.clear-on-switch').add($targets.filter('.clear-on-switch')).val('');
530
  }
 
531
  }).change();
532
 
533
+ $(document).on('click', 'a.add-new-line', function(){
534
  var $parent = $(this).parents('table').first();
535
  var $template = $parent.children('tbody').children('tr.template');
536
  var $clone = $template.clone(true);
540
 
541
  $clone.html($cloneHtml);
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) {
562
+ $targets.slideDown();
563
+ } else {
564
+ $targets.slideUp().find('.clear-on-switch').add($targets.filter('.clear-on-switch')).val('');
565
+ }
566
+ }).change();
567
 
568
  // datepicker
569
  $parent.find('input.datepicker').removeClass('date-picker').addClass('datepicker').datepicker({
603
  }
604
  });
605
 
606
+ $('a.switcher').on('click', function (e) {
 
607
  var $targets = $('.switcher-target-' + $(this).attr('id'));
 
608
  var is_show = $(this).find('span').html() == '+'; if ($(this).is('.switcher-reversed')) is_show = ! is_show;
609
  if (is_show) {
610
  $(this).find('span').html('-');
 
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){
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
  }
628
  }
629
  }).click();
630
 
631
+ $('.variable_repeater_mode').on('change', function(){
632
  // if variable mode
633
  if ($(this).is(':checked')) {
634
  var $parent = $(this).parents('.options_group:first');
635
  if ($(this).val() == 'xml' || $(this).val() == 'csv') {
636
  $parent.find('table.wpallimport_variable_table').find('tr.wpallimport-row-actions').hide();
637
+ } else {
 
638
  $parent.find('table.wpallimport_variable_table').find('tr.wpallimport-row-actions').show();
639
  }
640
  }
648
  $('#billing_is_guest_matching').on('change', function(){
649
  if ($(this).is(':checked')){
650
  $('.is_guest_matching_notice').hide();
651
+ } else {
 
652
  $('.is_guest_matching_notice').slideDown();
653
  }
654
  }).change();
655
 
656
+ $('input[name="is_multiple_product_subscription_period"]').on('click', function(){
657
  if ($(this).val() == 'no') {
658
  $('select[name="multiple_product_subscription_length"]').html($('.subscription_length-xpath').html());
659
+ } else {
 
660
  var $period = $('select[name="multiple_product_subscription_period"]').val();
661
  $('select[name="multiple_product_subscription_length"]').html($('.subscription_length-' + $period).html());
662
+ }
663
  });
664
 
665
  $('input[name="is_multiple_product_subscription_period"]:checked').click();
666
 
667
+ $('select[name="multiple_product_subscription_period"]').on('change', function(){
668
  $('select[name="multiple_product_subscription_length"]').html($('.subscription_length-' + $(this).val()).html());
669
  });
670
 
views/admin/import/options/_reimport_options.php CHANGED
@@ -182,10 +182,8 @@
182
  </div>
183
  </div>
184
  <?php
185
-
186
  // add-ons re-import options
187
- do_action('pmxi_reimport', $post_type, $post);
188
-
189
  ?>
190
  </div>
191
  </div>
182
  </div>
183
  </div>
184
  <?php
 
185
  // add-ons re-import options
186
+ do_action('pmxi_reimport', $post['custom_type'], $post);
 
187
  ?>
188
  </div>
189
  </div>
views/admin/import/product/index.php CHANGED
@@ -106,7 +106,7 @@
106
 
107
  <!-- ADDITIONAL TABS -->
108
 
109
- <?php do_action('pmwi_tab_content'); ?>
110
 
111
  <!-- OPTIONS -->
112
 
106
 
107
  <!-- ADDITIONAL TABS -->
108
 
109
+ <?php do_action('pmwi_tab_content', $post ); ?>
110
 
111
  <!-- OPTIONS -->
112
 
views/admin/import/shop_order/_tabs/_order_item_coupons.php CHANGED
@@ -97,7 +97,7 @@
97
  <span class="wpallimport-slide-content" style="padding-left:0;">
98
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple coupons separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
99
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[coupons_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['coupons_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
100
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two coupons would be imported like this coupon1|coupon2">?</a>
101
  </span>
102
  </div>
103
  </div>
@@ -117,7 +117,7 @@
117
  <div class="form-field input" style="margin-bottom: 20px;">
118
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple coupons separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
119
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[coupons_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['coupons_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
120
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two coupons would be imported like this coupon1|coupon2">?</a>
121
  </div>
122
  <?php endif; ?>
123
  </div>
97
  <span class="wpallimport-slide-content" style="padding-left:0;">
98
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple coupons separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
99
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[coupons_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['coupons_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
100
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two coupons would be imported like this coupon1|coupon2">?</a>
101
  </span>
102
  </div>
103
  </div>
117
  <div class="form-field input" style="margin-bottom: 20px;">
118
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple coupons separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
119
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[coupons_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['coupons_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
120
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two coupons would be imported like this coupon1|coupon2">?</a>
121
  </div>
122
  <?php endif; ?>
123
  </div>
views/admin/import/shop_order/_tabs/_order_item_fees.php CHANGED
@@ -70,7 +70,7 @@
70
  <span class="wpallimport-slide-content" style="padding-left:0;">
71
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple fees separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
72
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[fees_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['fees_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
73
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two fees would be imported like this 'Fee 1|Fee 2' and the fee amounts like this 10|20">?</a>
74
  </span>
75
  </div>
76
  </div>
@@ -90,7 +90,7 @@
90
  <div class="form-field input" style="margin-bottom: 20px;">
91
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple fees separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
92
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[fees_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['fees_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
93
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two fees would be imported like this 'Fee 1|Fee 2' and the fee amounts like this 10|20">?</a>
94
  </div>
95
  <?php endif; ?>
96
  </div>
70
  <span class="wpallimport-slide-content" style="padding-left:0;">
71
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple fees separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
72
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[fees_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['fees_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
73
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two fees would be imported like this 'Fee 1|Fee 2' and the fee amounts like this 10|20">?</a>
74
  </span>
75
  </div>
76
  </div>
90
  <div class="form-field input" style="margin-bottom: 20px;">
91
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple fees separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
92
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[fees_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['fees_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
93
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two fees would be imported like this 'Fee 1|Fee 2' and the fee amounts like this 10|20">?</a>
94
  </div>
95
  <?php endif; ?>
96
  </div>
views/admin/import/shop_order/_tabs/_order_item_products.php CHANGED
@@ -609,7 +609,7 @@
609
  <div class="form-field input" style="margin-bottom: 20px;">
610
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple products separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
611
  <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;"/>
612
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two products would be imported like this SKU1|SKU2, and their quantities like this 15|20">?</a>
613
  </div>
614
  <?php endif; ?>
615
  </div>
609
  <div class="form-field input" style="margin-bottom: 20px;">
610
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple products separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
611
  <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;"/>
612
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two products would be imported like this SKU1|SKU2, and their quantities like this 15|20">?</a>
613
  </div>
614
  <?php endif; ?>
615
  </div>
views/admin/import/shop_order/_tabs/_order_item_shipping.php CHANGED
@@ -128,7 +128,7 @@
128
  <span class="wpallimport-slide-content" style="padding-left:0;">
129
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple shipping costs separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
130
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[shipping_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['shipping_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
131
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two shipping names would be imported like this 'Shipping 1|Shipping 2' and the shipping amounts like this 10|20">?</a>
132
  </span>
133
  </div>
134
  </div>
@@ -148,7 +148,7 @@
148
  <div class="form-field input" style="margin-bottom: 20px;">
149
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple shipping costs separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
150
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[shipping_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['shipping_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
151
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two shipping names would be imported like this 'Shipping 1|Shipping 2' and the shipping amounts like this 10|20">?</a>
152
  </div>
153
  <?php endif; ?>
154
  </div>
128
  <span class="wpallimport-slide-content" style="padding-left:0;">
129
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple shipping costs separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
130
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[shipping_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['shipping_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
131
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two shipping names would be imported like this 'Shipping 1|Shipping 2' and the shipping amounts like this 10|20">?</a>
132
  </span>
133
  </div>
134
  </div>
148
  <div class="form-field input" style="margin-bottom: 20px;">
149
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple shipping costs separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
150
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[shipping_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['shipping_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
151
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two shipping names would be imported like this 'Shipping 1|Shipping 2' and the shipping amounts like this 10|20">?</a>
152
  </div>
153
  <?php endif; ?>
154
  </div>
views/admin/import/shop_order/_tabs/_order_item_taxes.php CHANGED
@@ -143,7 +143,7 @@
143
  <span class="wpallimport-slide-content" style="padding-left:0;">
144
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple taxes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
145
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[taxes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['taxes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
146
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two tax rate amounts would be imported like this '10|20'">?</a>
147
  </span>
148
  </div>
149
  </div>
@@ -163,7 +163,7 @@
163
  <div class="form-field input" style="margin-bottom: 20px;">
164
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple taxes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
165
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[taxes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['taxes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
166
- <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" original-title="For example, two tax rate amounts would be imported like this '10|20'">?</a>
167
  </div>
168
  <?php endif; ?>
169
  </div>
143
  <span class="wpallimport-slide-content" style="padding-left:0;">
144
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple taxes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
145
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[taxes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['taxes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
146
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two tax rate amounts would be imported like this '10|20'">?</a>
147
  </span>
148
  </div>
149
  </div>
163
  <div class="form-field input" style="margin-bottom: 20px;">
164
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple taxes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
165
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[taxes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['taxes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
166
+ <a href="#help" class="wpallimport-help" style="top:10px;left:8px;" title="For example, two tax rate amounts would be imported like this '10|20'">?</a>
167
  </div>
168
  <?php endif; ?>
169
  </div>
views/admin/import/shop_order/order_notes_section.php CHANGED
@@ -178,7 +178,7 @@
178
  <span class="order-separator-label wpallimport-slide-content" style="padding-left:0;">
179
  <label><?php _e('Multiple notes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
180
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[notes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['notes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
181
- <a href="#help" class="wpallimport-help" style="top:0px;left:8px;" original-title="For example, two notes would be imported like this Note 1|Note 2">?</a>
182
  </span>
183
  </div>
184
  </div>
@@ -198,7 +198,7 @@
198
  <div class="form-field input" style="padding-left: 20px;">
199
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple notes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
200
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[notes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['notes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
201
- <a href="#help" class="wpallimport-help" style="top:0px;left:8px;" original-title="For example, two notes would be imported like this 'Note 1|Note 2'">?</a>
202
  </div>
203
  <?php endif; ?>
204
  </div>
178
  <span class="order-separator-label wpallimport-slide-content" style="padding-left:0;">
179
  <label><?php _e('Multiple notes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
180
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[notes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['notes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
181
+ <a href="#help" class="wpallimport-help" style="top:0px;left:8px;" title="For example, two notes would be imported like this Note 1|Note 2">?</a>
182
  </span>
183
  </div>
184
  </div>
198
  <div class="form-field input" style="padding-left: 20px;">
199
  <label class="order-separator-label" style="line-height: 30px;"><?php _e('Multiple notes separated by', PMWI_Plugin::TEXT_DOMAIN); ?></label>
200
  <input type="text" class="short rad4 order-separator-input" name="pmwi_order[notes_repeater_mode_separator]" value="<?php echo esc_attr($post['pmwi_order']['notes_repeater_mode_separator']) ?>" style="width:10%; text-align: center;"/>
201
+ <a href="#help" class="wpallimport-help" style="top:0px;left:8px;" title="For example, two notes would be imported like this 'Note 1|Note 2'">?</a>
202
  </div>
203
  <?php endif; ?>
204
  </div>