Version Description
- Fixed import product shipping class
- Fixed import attributes;
- Added SKU auto generation options;
- Updated parsing price, now plugin will delect price correctly even it present with currency symbol, like $100.20
Download this release
Release Info
Developer | soflyy |
Plugin | Import Products from any XML or CSV to WooCommerce |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.0.1
- controllers/admin/import.php +2 -2
- controllers/controller/admin.php +1 -9
- models/import/record.php +162 -79
- plugin.php +15 -6
- readme.txt +14 -6
- static/css/admin.css +57 -7
- static/img/data-example-1.png +0 -0
- static/img/data-example-2.png +0 -0
- static/img/data-example-3.png +0 -0
- static/img/data-example-4.png +0 -0
- static/img/ico-remove.png +0 -0
- static/js/admin.js +105 -6
- views/admin/import/index.php +159 -50
controllers/admin/import.php
CHANGED
@@ -14,7 +14,7 @@ class PMWI_Admin_Import extends PMWI_Controller_Admin {
|
|
14 |
|
15 |
$default = PMWI_Plugin::get_default_import_options();
|
16 |
|
17 |
-
$id = $this->input->get('id');
|
18 |
|
19 |
$this->data['import'] = $import = new PMXI_Import_Record();
|
20 |
if ( ! $id or $import->getById($id)->isEmpty()) { // specified import is not found
|
@@ -26,7 +26,7 @@ class PMWI_Admin_Import extends PMWI_Controller_Admin {
|
|
26 |
$post = $this->input->post(
|
27 |
$this->data['import']->options
|
28 |
+ $default
|
29 |
-
);
|
30 |
|
31 |
$this->data['is_loaded_template'] = PMXI_Plugin::$session->data['pmxi_import']['is_loaded_template'];
|
32 |
|
14 |
|
15 |
$default = PMWI_Plugin::get_default_import_options();
|
16 |
|
17 |
+
$this->data['id'] = $id = $this->input->get('id');
|
18 |
|
19 |
$this->data['import'] = $import = new PMXI_Import_Record();
|
20 |
if ( ! $id or $import->getById($id)->isEmpty()) { // specified import is not found
|
26 |
$post = $this->input->post(
|
27 |
$this->data['import']->options
|
28 |
+ $default
|
29 |
+
);
|
30 |
|
31 |
$this->data['is_loaded_template'] = PMXI_Plugin::$session->data['pmxi_import']['is_loaded_template'];
|
32 |
|
controllers/controller/admin.php
CHANGED
@@ -44,18 +44,10 @@ abstract class PMWI_Controller_Admin extends PMWI_Controller {
|
|
44 |
|
45 |
|
46 |
wp_enqueue_script('pmwi-script', PMWI_FREE_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
|
47 |
-
wp_enqueue_script('pmwi-admin-script', PMWI_FREE_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable'));
|
48 |
|
49 |
global $woocommerce;
|
50 |
|
51 |
-
/*wp_enqueue_script('woocommerce_writepanel', $woocommerce->plugin_url() . '/assets/js/admin/write-panels.min.js', array('jquery', 'jquery-ui-datepicker'), $woocommerce->version);
|
52 |
-
wp_enqueue_script('jquery-ui-datepicker', $woocommerce->plugin_url() . '/assets/js/admin/ui-datepicker.js', array('jquery','jquery-ui-core'), $woocommerce->version );
|
53 |
-
wp_enqueue_script('woocommerce_admin', $woocommerce->plugin_url() . '/assets/js/admin/woocommerce_admin.min.js', array('jquery', 'jquery-ui-widget', 'jquery-ui-core'), $woocommerce->version);
|
54 |
-
wp_enqueue_script('ajax-chosen', $woocommerce->plugin_url() . '/assets/js/chosen/ajax-chosen.jquery.min.js', array('jquery', 'chosen'), $woocommerce->version );
|
55 |
-
wp_enqueue_script('chosen', $woocommerce->plugin_url() . '/assets/js/chosen/chosen.jquery.min.js', array('jquery'), $woocommerce->version );
|
56 |
-
wp_enqueue_script('jquery-blockui', $woocommerce->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI.min.js', array( 'jquery' ), $woocommerce->version, true );
|
57 |
-
wp_enqueue_script('jquery-placeholder', $woocommerce->plugin_url() . '/assets/js/jquery-placeholder/jquery.placeholder.min.js', array( 'jquery' ), $woocommerce->version, true );*/
|
58 |
-
|
59 |
$woocommerce_witepanel_params = array(
|
60 |
'remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'woocommerce'),
|
61 |
'remove_attribute' => __('Remove this attribute?', 'woocommerce'),
|
44 |
|
45 |
|
46 |
wp_enqueue_script('pmwi-script', PMWI_FREE_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
|
47 |
+
wp_enqueue_script('pmwi-admin-script', PMWI_FREE_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'));
|
48 |
|
49 |
global $woocommerce;
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
$woocommerce_witepanel_params = array(
|
52 |
'remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'woocommerce'),
|
53 |
'remove_attribute' => __('Remove this attribute?', 'woocommerce'),
|
models/import/record.php
CHANGED
@@ -86,7 +86,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
86 |
}
|
87 |
else{
|
88 |
$count and $this->data['product_sku'] = array_fill(0, $count, "");
|
89 |
-
}
|
90 |
|
91 |
if ("" != $import->options['single_product_url']){
|
92 |
$this->data['product_url'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_url'], $file)->parse($records); $tmp_files[] = $file;
|
@@ -103,7 +103,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
103 |
}
|
104 |
|
105 |
if ("" != $import->options['single_product_regular_price']){
|
106 |
-
$this->data['product_regular_price'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_regular_price'], $file)->parse($records); $tmp_files[] = $file;
|
107 |
}
|
108 |
else{
|
109 |
$count and $this->data['product_regular_price'] = array_fill(0, $count, "");
|
@@ -124,18 +124,25 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
124 |
}
|
125 |
|
126 |
if ("" != $import->options['single_product_sale_price']){
|
127 |
-
$this->data['product_sale_price'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_sale_price'], $file)->parse($records); $tmp_files[] = $file;
|
128 |
}
|
129 |
else{
|
130 |
$count and $this->data['product_sale_price'] = array_fill(0, $count, "");
|
131 |
}
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
if ("" != $import->options['single_product_files']){
|
134 |
$this->data['product_files'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_files'], $file)->parse($records); $tmp_files[] = $file;
|
135 |
}
|
136 |
else{
|
137 |
$count and $this->data['product_files'] = array_fill(0, $count, "");
|
138 |
-
}
|
139 |
|
140 |
if ("" != $import->options['single_product_download_limit']){
|
141 |
$this->data['product_download_limit'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_download_limit'], $file)->parse($records); $tmp_files[] = $file;
|
@@ -314,8 +321,8 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
314 |
);
|
315 |
}
|
316 |
}
|
317 |
-
}
|
318 |
-
|
319 |
remove_filter('user_has_cap', array($this, '_filter_has_cap_unfiltered_html')); kses_init(); // return any filtering rules back if they has been disabled for import procedure
|
320 |
|
321 |
foreach ($tmp_files as $file) { // remove all temporary files created
|
@@ -323,13 +330,17 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
323 |
}
|
324 |
|
325 |
return $this->data;
|
326 |
-
}
|
|
|
|
|
|
|
|
|
327 |
|
328 |
public function import($pid, $i, $import, $articleData, $xml, $is_cron = false){
|
329 |
|
330 |
$logger = create_function('$m', 'echo "<div class=\\"progress-msg\\">$m</div>\\n"; if ( "" != strip_tags(pmxi_strip_tags_content($m))) { PMXI_Plugin::$session[\'pmxi_import\'][\'log\'] .= "<p>".strip_tags(pmxi_strip_tags_content($m))."</p>"; flush(); }');
|
331 |
|
332 |
-
global $woocommerce;
|
333 |
|
334 |
extract($this->data);
|
335 |
|
@@ -337,11 +348,16 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
337 |
add_post_meta( $pid, 'total_sales', '0', true );
|
338 |
|
339 |
// Get types
|
340 |
-
$product_type = 'simple';
|
341 |
$is_downloadable = $product_downloadable[$i];
|
342 |
$is_virtual = $product_virtual[$i];
|
343 |
$is_featured = $product_featured[$i];
|
344 |
|
|
|
|
|
|
|
|
|
|
|
345 |
$existing_meta_keys = array();
|
346 |
foreach (get_post_meta($pid, '') as $cur_meta_key => $cur_meta_val) $existing_meta_keys[] = $cur_meta_key;
|
347 |
|
@@ -353,6 +369,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
353 |
// Update post meta
|
354 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_regular_price')) update_post_meta( $pid, '_regular_price', stripslashes( $product_regular_price[$i] ) );
|
355 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_sale_price')) update_post_meta( $pid, '_sale_price', stripslashes( $product_sale_price[$i] ) );
|
|
|
356 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_tax_status')) update_post_meta( $pid, '_tax_status', stripslashes( $product_tax_status[$i] ) );
|
357 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_tax_class')) update_post_meta( $pid, '_tax_class', stripslashes( $product_tax_class[$i] ) );
|
358 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_visibility')) update_post_meta( $pid, '_visibility', stripslashes( $product_visibility[$i] ) );
|
@@ -372,17 +389,35 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
372 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_height')) update_post_meta( $pid, '_height', '' );
|
373 |
}
|
374 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
// Save shipping class
|
376 |
-
$product_shipping_class = $product_shipping_class[$i] > 0 && $product_type != 'external' ? absint( $product_shipping_class[$i] ) :
|
377 |
wp_set_object_terms( $pid, $product_shipping_class, 'product_shipping_class');
|
378 |
|
379 |
// Unique SKU
|
380 |
$sku = get_post_meta($pid, '_sku', true);
|
381 |
$new_sku = esc_html( trim( stripslashes( $product_sku[$i] ) ) );
|
382 |
|
383 |
-
if ( $new_sku == '' ) {
|
384 |
-
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_sku'))
|
385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
if ( ! empty( $new_sku ) ) {
|
387 |
if (
|
388 |
$this->wpdb->get_var( $this->wpdb->prepare("
|
@@ -411,13 +446,12 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
411 |
|
412 |
$attribute_position = 0;
|
413 |
|
414 |
-
foreach ($serialized_attributes as $attr_name => $attr_data) {
|
415 |
|
416 |
$is_visible = intval( $attr_data['is_visible'][$i] );
|
417 |
$is_variation = intval( $attr_data['in_variation'][$i] );
|
418 |
$is_taxonomy = intval( $attr_data['in_taxonomy'][$i] );
|
419 |
|
420 |
-
|
421 |
if ( $is_taxonomy ) {
|
422 |
|
423 |
if ( isset( $attr_data['value'][$i] ) ) {
|
@@ -425,13 +459,13 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
425 |
$values = array_map( 'stripslashes', array_map( 'strip_tags', explode( '|', $attr_data['value'][$i] ) ) );
|
426 |
|
427 |
// Remove empty items in the array
|
428 |
-
$values = array_filter( $values );
|
429 |
-
|
430 |
if ( ! taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attr_name ) ) and intval($attr_data['is_create_taxonomy_terms'][$i])) {
|
431 |
|
432 |
-
// Grab the submitted data
|
433 |
$attribute_name = ( isset( $attr_name ) ) ? woocommerce_sanitize_taxonomy_name( stripslashes( (string) $attr_name ) ) : '';
|
434 |
-
$attribute_label = ucwords($
|
435 |
$attribute_type = 'select';
|
436 |
$attribute_orderby = 'menu_order';
|
437 |
|
@@ -443,7 +477,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
443 |
'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type',
|
444 |
'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', 'second', 'sentence',
|
445 |
'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id',
|
446 |
-
'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', '
|
447 |
);
|
448 |
|
449 |
if ( in_array( $attribute_name, $reserved_terms ) ) {
|
@@ -460,7 +494,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
460 |
)
|
461 |
);
|
462 |
|
463 |
-
$logger and call_user_func($logger, sprintf(__('<b>CREATED</b>: Taxonomy attribute “%s” have been successfully created.', 'pmxi_plugin'),
|
464 |
|
465 |
// Register the taxonomy now so that the import works!
|
466 |
$domain = $woocommerce->attribute_taxonomy_name( $attr_name );
|
@@ -496,15 +530,15 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
496 |
foreach ($values as $key => $value) {
|
497 |
$term_founded = false;
|
498 |
if ( count($terms) > 0 ){
|
499 |
-
foreach ( $terms as $term ) {
|
500 |
-
|
501 |
if ( strtolower($term->name) == trim(strtolower($value)) ) {
|
502 |
-
$attr_values[] = $term->slug;
|
503 |
$term_founded = true;
|
|
|
504 |
}
|
505 |
}
|
506 |
}
|
507 |
-
if ( ! $term_founded and intval($attr_data['is_create_taxonomy_terms'][$i]) ){
|
508 |
$term = wp_insert_term(
|
509 |
$value, // the term
|
510 |
$woocommerce->attribute_taxonomy_name( $attr_name ) // the taxonomy
|
@@ -512,7 +546,7 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
512 |
if ( ! is_wp_error($term) ){
|
513 |
$term = get_term_by( 'id', $term['term_id'], $woocommerce->attribute_taxonomy_name( $attr_name ));
|
514 |
$attr_values[] = $term->slug;
|
515 |
-
}
|
516 |
|
517 |
}
|
518 |
}
|
@@ -529,10 +563,10 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
529 |
}
|
530 |
|
531 |
}
|
532 |
-
|
533 |
// Update post terms
|
534 |
-
if ( taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attr_name ) ))
|
535 |
-
wp_set_object_terms( $pid, $values, $woocommerce->attribute_taxonomy_name( $attr_name ) );
|
536 |
|
537 |
if ( $values ) {
|
538 |
|
@@ -555,12 +589,12 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
555 |
wp_set_object_terms( $pid, NULL, $woocommerce->attribute_taxonomy_name( $attr_name ) );
|
556 |
|
557 |
// Text based, separate by pipe
|
558 |
-
|
559 |
|
560 |
// Custom attribute - Add attribute to array and set the values
|
561 |
$attributes[ sanitize_title( $attr_name ) ] = array(
|
562 |
'name' => sanitize_text_field( $attr_name ),
|
563 |
-
'value' => $
|
564 |
'position' => $attribute_position,
|
565 |
'is_visible' => $is_visible,
|
566 |
'is_variation' => $is_variation,
|
@@ -665,7 +699,21 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
665 |
// Stock Data
|
666 |
if ( $product_manage_stock[$i] == 'yes' ) {
|
667 |
|
668 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
|
670 |
// Manage stock
|
671 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', (int) $product_stock_qty[$i] );
|
@@ -756,12 +804,12 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
756 |
$_download_expiry = absint( $product_download_expiry[$i] );
|
757 |
if ( ! $_download_expiry )
|
758 |
$_download_expiry = ''; // 0 or blank = unlimited
|
759 |
-
|
760 |
// file paths will be stored in an array keyed off md5(file path)
|
761 |
-
if ( !empty( $
|
762 |
$_file_paths = array();
|
763 |
|
764 |
-
$file_paths = explode( $import->options['product_files_delim'] , $
|
765 |
|
766 |
foreach ( $file_paths as $file_path ) {
|
767 |
$file_path = trim( $file_path );
|
@@ -777,67 +825,102 @@ class PMWI_Import_Record extends PMWI_Model_Record {
|
|
777 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_download_limit')) update_post_meta( $pid, '_download_limit', esc_attr( $_download_limit ) );
|
778 |
if ( isset( $product_download_expiry[$i] ) )
|
779 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_download_expiry')) update_post_meta( $pid, '_download_expiry', esc_attr( $_download_expiry ) );
|
780 |
-
}
|
781 |
|
782 |
// Do action for product type
|
783 |
-
do_action( 'woocommerce_process_product_meta_' . $product_type, $pid );
|
784 |
|
785 |
// Clear cache/transients
|
786 |
-
$woocommerce->clear_product_transients( $pid );
|
787 |
|
788 |
-
}
|
789 |
|
790 |
public function _filter_has_cap_unfiltered_html($caps)
|
791 |
{
|
792 |
$caps['unfiltered_html'] = true;
|
793 |
return $caps;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
}
|
795 |
-
|
796 |
-
/**
|
797 |
-
* Find duplicates according to settings
|
798 |
-
*/
|
799 |
-
public function findDuplicates($articleData, $custom_duplicate_name = '', $custom_duplicate_value = '', $duplicate_indicator = 'title')
|
800 |
-
{
|
801 |
-
if ('custom field' == $duplicate_indicator){
|
802 |
-
$duplicate_ids = array();
|
803 |
-
$args = array(
|
804 |
-
'post_type' => $articleData['post_type'],
|
805 |
-
'meta_query' => array(
|
806 |
-
array(
|
807 |
-
'key' => $custom_duplicate_name,
|
808 |
-
'value' => $custom_duplicate_value,
|
809 |
-
)
|
810 |
-
)
|
811 |
-
);
|
812 |
-
$query = new WP_Query( $args );
|
813 |
-
|
814 |
-
if ( $query->have_posts() ) $duplicate_ids[] = $query->post->ID;
|
815 |
|
816 |
-
|
|
|
817 |
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
$
|
822 |
-
|
823 |
-
|
824 |
-
WHERE
|
825 |
-
post_type = %s
|
826 |
-
AND ID != %s
|
827 |
-
AND REPLACE(REPLACE(REPLACE($field, ' ', ''), '\\t', ''), '\\n', '') = %s
|
828 |
-
",
|
829 |
-
$articleData['post_type'],
|
830 |
-
isset($articleData['ID']) ? $articleData['ID'] : 0,
|
831 |
-
preg_replace('%[ \\t\\n]%', '', $articleData[$field])
|
832 |
-
));
|
833 |
-
}
|
834 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
835 |
|
836 |
-
|
|
|
|
|
|
|
|
|
|
|
837 |
|
838 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
|
840 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
841 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
842 |
}
|
843 |
}
|
86 |
}
|
87 |
else{
|
88 |
$count and $this->data['product_sku'] = array_fill(0, $count, "");
|
89 |
+
}
|
90 |
|
91 |
if ("" != $import->options['single_product_url']){
|
92 |
$this->data['product_url'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_url'], $file)->parse($records); $tmp_files[] = $file;
|
103 |
}
|
104 |
|
105 |
if ("" != $import->options['single_product_regular_price']){
|
106 |
+
$this->data['product_regular_price'] = array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_regular_price'], $file)->parse($records)); $tmp_files[] = $file;
|
107 |
}
|
108 |
else{
|
109 |
$count and $this->data['product_regular_price'] = array_fill(0, $count, "");
|
124 |
}
|
125 |
|
126 |
if ("" != $import->options['single_product_sale_price']){
|
127 |
+
$this->data['product_sale_price'] = array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_sale_price'], $file)->parse($records)); $tmp_files[] = $file;
|
128 |
}
|
129 |
else{
|
130 |
$count and $this->data['product_sale_price'] = array_fill(0, $count, "");
|
131 |
}
|
132 |
|
133 |
+
if ("" != $import->options['single_product_whosale_price']){
|
134 |
+
$this->data['product_whosale_price'] = array_map(array($this, 'prepare_price'), XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_whosale_price'], $file)->parse($records)); $tmp_files[] = $file;
|
135 |
+
}
|
136 |
+
else{
|
137 |
+
$count and $this->data['product_whosale_price'] = array_fill(0, $count, "");
|
138 |
+
}
|
139 |
+
|
140 |
if ("" != $import->options['single_product_files']){
|
141 |
$this->data['product_files'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_files'], $file)->parse($records); $tmp_files[] = $file;
|
142 |
}
|
143 |
else{
|
144 |
$count and $this->data['product_files'] = array_fill(0, $count, "");
|
145 |
+
}
|
146 |
|
147 |
if ("" != $import->options['single_product_download_limit']){
|
148 |
$this->data['product_download_limit'] = XmlImportParser::factory($xml, $import->xpath, $import->options['single_product_download_limit'], $file)->parse($records); $tmp_files[] = $file;
|
321 |
);
|
322 |
}
|
323 |
}
|
324 |
+
}
|
325 |
+
|
326 |
remove_filter('user_has_cap', array($this, '_filter_has_cap_unfiltered_html')); kses_init(); // return any filtering rules back if they has been disabled for import procedure
|
327 |
|
328 |
foreach ($tmp_files as $file) { // remove all temporary files created
|
330 |
}
|
331 |
|
332 |
return $this->data;
|
333 |
+
}
|
334 |
+
|
335 |
+
public function filtering($var){
|
336 |
+
return ("" == $var) ? false : true;
|
337 |
+
}
|
338 |
|
339 |
public function import($pid, $i, $import, $articleData, $xml, $is_cron = false){
|
340 |
|
341 |
$logger = create_function('$m', 'echo "<div class=\\"progress-msg\\">$m</div>\\n"; if ( "" != strip_tags(pmxi_strip_tags_content($m))) { PMXI_Plugin::$session[\'pmxi_import\'][\'log\'] .= "<p>".strip_tags(pmxi_strip_tags_content($m))."</p>"; flush(); }');
|
342 |
|
343 |
+
global $woocommerce;
|
344 |
|
345 |
extract($this->data);
|
346 |
|
348 |
add_post_meta( $pid, 'total_sales', '0', true );
|
349 |
|
350 |
// Get types
|
351 |
+
$product_type = empty( $product_types[$i] ) ? 'simple' : sanitize_title( stripslashes( $product_types[$i] ) );
|
352 |
$is_downloadable = $product_downloadable[$i];
|
353 |
$is_virtual = $product_virtual[$i];
|
354 |
$is_featured = $product_featured[$i];
|
355 |
|
356 |
+
if ( class_exists('woocommerce_wholesale_pricing') ):
|
357 |
+
if ($product_type == "simple") add_action( 'woocommerce_process_product_meta_simple', array( &$this, 'process_product_meta' ), 2, 1 );
|
358 |
+
if ($product_type == "variable") add_action( 'woocommerce_save_product_variation', array( &$this, 'process_product_meta_variable' ), 1000, 1 );
|
359 |
+
endif;
|
360 |
+
|
361 |
$existing_meta_keys = array();
|
362 |
foreach (get_post_meta($pid, '') as $cur_meta_key => $cur_meta_val) $existing_meta_keys[] = $cur_meta_key;
|
363 |
|
369 |
// Update post meta
|
370 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_regular_price')) update_post_meta( $pid, '_regular_price', stripslashes( $product_regular_price[$i] ) );
|
371 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_sale_price')) update_post_meta( $pid, '_sale_price', stripslashes( $product_sale_price[$i] ) );
|
372 |
+
if ( class_exists('woocommerce_wholesale_pricing') and $this->keep_custom_fields($existing_meta_keys, $import->options, 'wholesale_price')) update_post_meta( $pid, 'pmxi_wholesale_price', stripslashes( $product_whosale_price[$i] ) );
|
373 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_tax_status')) update_post_meta( $pid, '_tax_status', stripslashes( $product_tax_status[$i] ) );
|
374 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_tax_class')) update_post_meta( $pid, '_tax_class', stripslashes( $product_tax_class[$i] ) );
|
375 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_visibility')) update_post_meta( $pid, '_visibility', stripslashes( $product_visibility[$i] ) );
|
389 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_height')) update_post_meta( $pid, '_height', '' );
|
390 |
}
|
391 |
|
392 |
+
// Enable reviews
|
393 |
+
wp_update_post(array(
|
394 |
+
'ID' => $pid,
|
395 |
+
'comment_status' => ($product_enable_reviews[$i] == 'yes') ? 'open' : 'closed',
|
396 |
+
'menu_order' => ($product_menu_order[$i] != '') ? $product_menu_order[$i] : 0
|
397 |
+
));
|
398 |
+
|
399 |
// Save shipping class
|
400 |
+
$product_shipping_class = is_numeric($product_shipping_class[$i]) && $product_shipping_class[$i] > 0 && $product_type != 'external' ? absint( $product_shipping_class[$i] ) : $product_shipping_class[$i];
|
401 |
wp_set_object_terms( $pid, $product_shipping_class, 'product_shipping_class');
|
402 |
|
403 |
// Unique SKU
|
404 |
$sku = get_post_meta($pid, '_sku', true);
|
405 |
$new_sku = esc_html( trim( stripslashes( $product_sku[$i] ) ) );
|
406 |
|
407 |
+
if ( $new_sku == '' and $import->options['disable_auto_sku_generation'] ) {
|
408 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_sku'))
|
409 |
+
update_post_meta( $pid, '_sku', '' );
|
410 |
+
}
|
411 |
+
elseif ( $new_sku == '' and ! $import->options['disable_auto_sku_generation'] ) {
|
412 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_sku')){
|
413 |
+
$unique_keys = XmlImportParser::factory($xml, $import->xpath, $import->options['unique_key'], $file)->parse($records); $tmp_files[] = $file;
|
414 |
+
foreach ($tmp_files as $file) { // remove all temporary files created
|
415 |
+
unlink($file);
|
416 |
+
}
|
417 |
+
$new_sku = substr(md5($unique_keys[$i]), 0, 12);
|
418 |
+
}
|
419 |
+
}
|
420 |
+
if ( $new_sku != '' and $new_sku !== $sku ) {
|
421 |
if ( ! empty( $new_sku ) ) {
|
422 |
if (
|
423 |
$this->wpdb->get_var( $this->wpdb->prepare("
|
446 |
|
447 |
$attribute_position = 0;
|
448 |
|
449 |
+
foreach ($serialized_attributes as $attr_name => $attr_data) { $attr_name = strtolower($attr_name);
|
450 |
|
451 |
$is_visible = intval( $attr_data['is_visible'][$i] );
|
452 |
$is_variation = intval( $attr_data['in_variation'][$i] );
|
453 |
$is_taxonomy = intval( $attr_data['in_taxonomy'][$i] );
|
454 |
|
|
|
455 |
if ( $is_taxonomy ) {
|
456 |
|
457 |
if ( isset( $attr_data['value'][$i] ) ) {
|
459 |
$values = array_map( 'stripslashes', array_map( 'strip_tags', explode( '|', $attr_data['value'][$i] ) ) );
|
460 |
|
461 |
// Remove empty items in the array
|
462 |
+
$values = array_filter( $values, array($this, "filtering") );
|
463 |
+
|
464 |
if ( ! taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attr_name ) ) and intval($attr_data['is_create_taxonomy_terms'][$i])) {
|
465 |
|
466 |
+
// Grab the submitted data
|
467 |
$attribute_name = ( isset( $attr_name ) ) ? woocommerce_sanitize_taxonomy_name( stripslashes( (string) $attr_name ) ) : '';
|
468 |
+
$attribute_label = ucwords( stripslashes( (string) $attr_name ));
|
469 |
$attribute_type = 'select';
|
470 |
$attribute_orderby = 'menu_order';
|
471 |
|
477 |
'post', 'post__in', 'post__not_in', 'post_format', 'post_mime_type', 'post_status', 'post_tag', 'post_type',
|
478 |
'posts', 'posts_per_archive_page', 'posts_per_page', 'preview', 'robots', 's', 'search', 'second', 'sentence',
|
479 |
'showposts', 'static', 'subpost', 'subpost_id', 'tag', 'tag__and', 'tag__in', 'tag__not_in', 'tag_id',
|
480 |
+
'tag_slug__and', 'tag_slug__in', 'taxonomy', 'tb', 'term', 'w', 'withcomments', 'withoutcomments', 'year',
|
481 |
);
|
482 |
|
483 |
if ( in_array( $attribute_name, $reserved_terms ) ) {
|
494 |
)
|
495 |
);
|
496 |
|
497 |
+
$logger and call_user_func($logger, sprintf(__('<b>CREATED</b>: Taxonomy attribute “%s” have been successfully created.', 'pmxi_plugin'), $attribute_label));
|
498 |
|
499 |
// Register the taxonomy now so that the import works!
|
500 |
$domain = $woocommerce->attribute_taxonomy_name( $attr_name );
|
530 |
foreach ($values as $key => $value) {
|
531 |
$term_founded = false;
|
532 |
if ( count($terms) > 0 ){
|
533 |
+
foreach ( $terms as $term ) {
|
|
|
534 |
if ( strtolower($term->name) == trim(strtolower($value)) ) {
|
535 |
+
$attr_values[] = $term->slug;
|
536 |
$term_founded = true;
|
537 |
+
break;
|
538 |
}
|
539 |
}
|
540 |
}
|
541 |
+
if ( ! $term_founded and intval($attr_data['is_create_taxonomy_terms'][$i]) ){
|
542 |
$term = wp_insert_term(
|
543 |
$value, // the term
|
544 |
$woocommerce->attribute_taxonomy_name( $attr_name ) // the taxonomy
|
546 |
if ( ! is_wp_error($term) ){
|
547 |
$term = get_term_by( 'id', $term['term_id'], $woocommerce->attribute_taxonomy_name( $attr_name ));
|
548 |
$attr_values[] = $term->slug;
|
549 |
+
}
|
550 |
|
551 |
}
|
552 |
}
|
563 |
}
|
564 |
|
565 |
}
|
566 |
+
|
567 |
// Update post terms
|
568 |
+
if ( taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attr_name ) ))
|
569 |
+
wp_set_object_terms( $pid, $values, $woocommerce->attribute_taxonomy_name( $attr_name ) );
|
570 |
|
571 |
if ( $values ) {
|
572 |
|
589 |
wp_set_object_terms( $pid, NULL, $woocommerce->attribute_taxonomy_name( $attr_name ) );
|
590 |
|
591 |
// Text based, separate by pipe
|
592 |
+
//$values = implode( ' | ', array_map( 'sanitize_text_field', explode( '|', $attr_data['value'][$i] ) ) );
|
593 |
|
594 |
// Custom attribute - Add attribute to array and set the values
|
595 |
$attributes[ sanitize_title( $attr_name ) ] = array(
|
596 |
'name' => sanitize_text_field( $attr_name ),
|
597 |
+
'value' => $attr_data['value'][$i],
|
598 |
'position' => $attribute_position,
|
599 |
'is_visible' => $is_visible,
|
600 |
'is_variation' => $is_variation,
|
699 |
// Stock Data
|
700 |
if ( $product_manage_stock[$i] == 'yes' ) {
|
701 |
|
702 |
+
if ( $product_type == 'grouped' ) {
|
703 |
+
|
704 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', stripslashes( $product_stock_status[$i] ) );
|
705 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', '' );
|
706 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_manage_stock')) update_post_meta( $pid, '_manage_stock', 'no' );
|
707 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_backorders')) update_post_meta( $pid, '_backorders', 'no' );
|
708 |
+
|
709 |
+
} elseif ( $product_type == 'external' ) {
|
710 |
+
|
711 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_stock_status')) update_post_meta( $pid, '_stock_status', 'instock' );
|
712 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', '' );
|
713 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_manage_stock')) update_post_meta( $pid, '_manage_stock', 'no' );
|
714 |
+
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_backorders')) update_post_meta( $pid, '_backorders', 'no' );
|
715 |
+
|
716 |
+
} elseif ( ! empty( $product_manage_stock[$i] ) ) {
|
717 |
|
718 |
// Manage stock
|
719 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_stock')) update_post_meta( $pid, '_stock', (int) $product_stock_qty[$i] );
|
804 |
$_download_expiry = absint( $product_download_expiry[$i] );
|
805 |
if ( ! $_download_expiry )
|
806 |
$_download_expiry = ''; // 0 or blank = unlimited
|
807 |
+
|
808 |
// file paths will be stored in an array keyed off md5(file path)
|
809 |
+
if ( !empty( $product_files[$i] ) ) {
|
810 |
$_file_paths = array();
|
811 |
|
812 |
+
$file_paths = explode( $import->options['product_files_delim'] , $product_files[$i] );
|
813 |
|
814 |
foreach ( $file_paths as $file_path ) {
|
815 |
$file_path = trim( $file_path );
|
825 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_download_limit')) update_post_meta( $pid, '_download_limit', esc_attr( $_download_limit ) );
|
826 |
if ( isset( $product_download_expiry[$i] ) )
|
827 |
if ($this->keep_custom_fields($existing_meta_keys, $import->options, '_download_expiry')) update_post_meta( $pid, '_download_expiry', esc_attr( $_download_expiry ) );
|
828 |
+
}
|
829 |
|
830 |
// Do action for product type
|
831 |
+
do_action( 'woocommerce_process_product_meta_' . $product_type, $pid );
|
832 |
|
833 |
// Clear cache/transients
|
834 |
+
$woocommerce->clear_product_transients( $pid );
|
835 |
|
836 |
+
}
|
837 |
|
838 |
public function _filter_has_cap_unfiltered_html($caps)
|
839 |
{
|
840 |
$caps['unfiltered_html'] = true;
|
841 |
return $caps;
|
842 |
+
}
|
843 |
+
|
844 |
+
function keep_custom_fields($existing_meta_keys, $options, $meta_key){
|
845 |
+
|
846 |
+
$keep_custom_fields_specific = ( ! $options['keep_custom_fields'] and ! empty($options['keep_custom_fields_specific'])) ? array_map('trim', explode(',', $options['keep_custom_fields_specific'])) : array();
|
847 |
+
$keep_custom_fields_except = ($options['keep_custom_fields'] and !empty($options['keep_custom_fields_except'])) ? array_map('trim', explode(',', $options['keep_custom_fields_except'])) : array();
|
848 |
+
|
849 |
+
return (($options['keep_custom_fields'] and in_array($meta_key, $existing_meta_keys) and !in_array($meta_key, $keep_custom_fields_except)) or (in_array($meta_key, $existing_meta_keys) and ! $options['keep_custom_fields'] and in_array($meta_key, $keep_custom_fields_specific))) ? false : true;
|
850 |
+
|
851 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
852 |
|
853 |
+
// process simple product meta
|
854 |
+
function process_product_meta( $post_id, $post = '' ) {
|
855 |
|
856 |
+
$wholesale_price = get_post_meta($post_id, 'pmxi_wholesale_price', true);
|
857 |
+
|
858 |
+
if ( '' !== $wholesale_price )
|
859 |
+
update_post_meta( $post_id, 'wholesale_price', stripslashes( $wholesale_price ) );
|
860 |
+
else
|
861 |
+
delete_post_meta( $post_id, 'pmxi_wholesale_price' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
}
|
863 |
+
|
864 |
+
// process variable product meta
|
865 |
+
function process_product_meta_variable( $post_id ) {
|
866 |
+
|
867 |
+
$product = get_post($post_id);
|
868 |
+
|
869 |
+
if ( $product->post_type == 'product_variation' ) {
|
870 |
+
|
871 |
+
$wholesale_price = get_post_meta($post_id, 'pmxi_wholesale_price', true);
|
872 |
+
|
873 |
+
if ( '' !== $wholesale_price )
|
874 |
+
update_post_meta( $post_id, 'wholesale_price', stripslashes( $wholesale_price ) );
|
875 |
+
else
|
876 |
+
delete_post_meta( $post_id, 'pmxi_wholesale_price' );
|
877 |
+
|
878 |
+
$post_parent = $product->post_parent;
|
879 |
+
|
880 |
+
}
|
881 |
+
else $post_parent = $post_id;
|
882 |
|
883 |
+
$children = get_posts( array(
|
884 |
+
'post_parent' => $post_parent,
|
885 |
+
'posts_per_page'=> -1,
|
886 |
+
'post_type' => 'product_variation',
|
887 |
+
'fields' => 'ids'
|
888 |
+
) );
|
889 |
|
890 |
+
$lowest_price = '';
|
891 |
+
|
892 |
+
$highest_price = '';
|
893 |
+
|
894 |
+
if ( $children ) {
|
895 |
+
|
896 |
+
foreach ( $children as $child ) {
|
897 |
|
898 |
+
$child_price = get_post_meta($child, 'pmxi_wholesale_price', true);
|
899 |
+
|
900 |
+
|
901 |
+
if ( !$child_price ) continue;
|
902 |
+
|
903 |
+
// Low price
|
904 |
+
if ( !is_numeric( $lowest_price ) || $child_price < $lowest_price ) $lowest_price = $child_price;
|
905 |
+
|
906 |
+
|
907 |
+
// High price
|
908 |
+
if ( $child_price > $highest_price )
|
909 |
+
$highest_price = $child_price;
|
910 |
|
911 |
+
}
|
912 |
+
|
913 |
+
|
914 |
+
}
|
915 |
+
|
916 |
+
update_post_meta( $post_parent, 'wholesale_price', $lowest_price );
|
917 |
+
update_post_meta( $post_parent, 'min_variation_wholesale_price', $lowest_price );
|
918 |
+
update_post_meta( $post_parent, 'max_variation_wholesale_price', $highest_price );
|
919 |
+
|
920 |
+
|
921 |
+
}
|
922 |
+
|
923 |
+
function prepare_price( $price ){
|
924 |
+
return preg_replace("/[^0-9\.,]/","",$price);
|
925 |
}
|
926 |
}
|
plugin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP All Import - WooCommerce Add-On
|
4 |
Plugin URI: http://www.wpallimport.com/
|
5 |
Description: Free edition. An extremely easy, drag & drop importer to import WooCommerce simple products. Works with WP All Import free or paid editions.
|
6 |
-
Version: 0.
|
7 |
Author: Soflyy
|
8 |
*/
|
9 |
/**
|
@@ -24,7 +24,7 @@ define('PMWI_FREE_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
|
|
24 |
*/
|
25 |
define('PMWI_PREFIX', 'pmwi_');
|
26 |
|
27 |
-
define('PMWI_FREE_VERSION', '1.0');
|
28 |
|
29 |
define('PMWI_EDITION', 'free');
|
30 |
|
@@ -371,7 +371,7 @@ final class PMWI_Plugin {
|
|
371 |
/**
|
372 |
* Plugin activation logic
|
373 |
*/
|
374 |
-
public function __activation() {
|
375 |
|
376 |
// uncaught exception doesn't prevent plugin from being activated, therefore replace it with fatal error so it does
|
377 |
set_exception_handler(create_function('$e', 'trigger_error($e->getMessage(), E_USER_ERROR);'));
|
@@ -445,7 +445,10 @@ final class PMWI_Plugin {
|
|
445 |
'is_product_enable_reviews' => 'no',
|
446 |
'single_product_enable_reviews' => '',
|
447 |
'single_product_id' => '',
|
448 |
-
'single_product_parent_id' => '',
|
|
|
|
|
|
|
449 |
'_virtual' => 0,
|
450 |
'_downloadable' => 0,
|
451 |
'is_regular_price_shedule' => 0,
|
@@ -509,9 +512,15 @@ final class PMWI_Plugin {
|
|
509 |
'single_variable_product_tax_class_use_parent' => 0,
|
510 |
'single_variable_product_downloadable_use_parent' => 0,
|
511 |
'variable_download_limit_use_parent' => 0,
|
512 |
-
'variable_download_expiry_use_parent' => 0
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
);
|
514 |
}
|
515 |
}
|
516 |
|
517 |
-
PMWI_Plugin::getInstance();
|
3 |
Plugin Name: WP All Import - WooCommerce Add-On
|
4 |
Plugin URI: http://www.wpallimport.com/
|
5 |
Description: Free edition. An extremely easy, drag & drop importer to import WooCommerce simple products. Works with WP All Import free or paid editions.
|
6 |
+
Version: 1.0.1
|
7 |
Author: Soflyy
|
8 |
*/
|
9 |
/**
|
24 |
*/
|
25 |
define('PMWI_PREFIX', 'pmwi_');
|
26 |
|
27 |
+
define('PMWI_FREE_VERSION', '1.0.1');
|
28 |
|
29 |
define('PMWI_EDITION', 'free');
|
30 |
|
371 |
/**
|
372 |
* Plugin activation logic
|
373 |
*/
|
374 |
+
public function __activation() {
|
375 |
|
376 |
// uncaught exception doesn't prevent plugin from being activated, therefore replace it with fatal error so it does
|
377 |
set_exception_handler(create_function('$e', 'trigger_error($e->getMessage(), E_USER_ERROR);'));
|
445 |
'is_product_enable_reviews' => 'no',
|
446 |
'single_product_enable_reviews' => '',
|
447 |
'single_product_id' => '',
|
448 |
+
'single_product_parent_id' => '',
|
449 |
+
'single_product_id_first_is_parent_id' => '',
|
450 |
+
'single_product_id_first_is_parent_title' => '',
|
451 |
+
'single_product_id_first_is_variation' => '',
|
452 |
'_virtual' => 0,
|
453 |
'_downloadable' => 0,
|
454 |
'is_regular_price_shedule' => 0,
|
512 |
'single_variable_product_tax_class_use_parent' => 0,
|
513 |
'single_variable_product_downloadable_use_parent' => 0,
|
514 |
'variable_download_limit_use_parent' => 0,
|
515 |
+
'variable_download_expiry_use_parent' => 0,
|
516 |
+
'first_is_parent' => 'yes',
|
517 |
+
'single_product_whosale_price' => '',
|
518 |
+
'variable_whosale_price' => '',
|
519 |
+
'variable_whosale_price_use_parent' => 0,
|
520 |
+
'disable_auto_sku_generation' => 0,
|
521 |
+
'is_default_attributes' => 1
|
522 |
);
|
523 |
}
|
524 |
}
|
525 |
|
526 |
+
PMWI_Plugin::getInstance();
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Import Products from any XML or CSV to WooCommerce ===
|
2 |
Contributors: soflyy
|
3 |
Requires at least: 3.5
|
4 |
-
Tested up to: 3.
|
5 |
-
Stable tag: 0.
|
6 |
License: GPLv2 or later
|
7 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
Tags: woocommerce xml import, woocommerce csv import, woocommerce, import, xml, csv, wp all import
|
@@ -11,7 +11,7 @@ Easily import products from any XML or CSV file to WooCommerce with the WooComme
|
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
**Bulk import your products to WooCommerce in less than 10 minutes with the WooCommerce add-on.**
|
15 |
|
16 |
The left side of the plugin looks just like WooCommerce, and the right side displays a product from your XML/CSV file.
|
17 |
|
@@ -22,7 +22,7 @@ It is so intuitive it is almost like manually adding a product in WooCommerce.
|
|
22 |
Why use the WooCommerce add-on for WP All Import?
|
23 |
|
24 |
- Supports files in any format and structure. There are no requirements that the data in your file be organized in a certain way.
|
25 |
-
- Supports files of practically unlimited size by automatically splitting them into chunks. Import
|
26 |
|
27 |
[youtube http://www.youtube.com/watch?v=7xL4RGT-JRc]
|
28 |
*demo video shows some pro version only features*
|
@@ -66,8 +66,17 @@ The WooCommerce add-on will appear in the Step 4 of WP All Import.
|
|
66 |
|
67 |
== Changelog ==
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 0.9 =
|
70 |
-
* Initial release.
|
71 |
|
72 |
== Support ==
|
73 |
|
@@ -78,4 +87,3 @@ We do try to handle support for our free version users at the following e-mail a
|
|
78 |
E-mail: support@soflyy.com
|
79 |
|
80 |
Support for free version customers is not guaranteed and based on ability. For premium support, [purchase WP All Import and the WooCommerce add-on.](http://www.wpallimport.com/upgrade-to-pro)
|
81 |
-
|
1 |
=== Import Products from any XML or CSV to WooCommerce ===
|
2 |
Contributors: soflyy
|
3 |
Requires at least: 3.5
|
4 |
+
Tested up to: 3.7
|
5 |
+
Stable tag: 1.0.1
|
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
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
**Bulk import your products to WooCommerce in less than 10 minutes with the WooCommerce add-on for WP All Import.**
|
15 |
|
16 |
The left side of the plugin looks just like WooCommerce, and the right side displays a product from your XML/CSV file.
|
17 |
|
22 |
Why use the WooCommerce add-on for WP All Import?
|
23 |
|
24 |
- Supports files in any format and structure. There are no requirements that the data in your file be organized in a certain way.
|
25 |
+
- Supports files of practically unlimited size by automatically splitting them into chunks. Import 200Mb+ product catalogs with ease, even on shared hosting.
|
26 |
|
27 |
[youtube http://www.youtube.com/watch?v=7xL4RGT-JRc]
|
28 |
*demo video shows some pro version only features*
|
66 |
|
67 |
== Changelog ==
|
68 |
|
69 |
+
= 1.0.1 =
|
70 |
+
* Fixed import product shipping class
|
71 |
+
* Fixed import attributes;
|
72 |
+
* Added SKU auto generation options;
|
73 |
+
* Updated parsing price, now plugin will delect price correctly even it present with currency symbol, like $100.20
|
74 |
+
|
75 |
+
= 1.0 =
|
76 |
+
* Official release on WP.org. Enhanced session handling.
|
77 |
+
|
78 |
= 0.9 =
|
79 |
+
* Initial release on WP.org.
|
80 |
|
81 |
== Support ==
|
82 |
|
87 |
E-mail: support@soflyy.com
|
88 |
|
89 |
Support for free version customers is not guaranteed and based on ability. For premium support, [purchase WP All Import and the WooCommerce add-on.](http://www.wpallimport.com/upgrade-to-pro)
|
|
static/css/admin.css
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
}
|
12 |
.pmxi_plugin .options_group{
|
13 |
padding-bottom: 10px;
|
14 |
-
overflow: hidden
|
15 |
}
|
16 |
.pmxi_plugin .options_group .input{
|
17 |
padding-left: 8px;
|
@@ -91,7 +91,7 @@
|
|
91 |
.pmxi_plugin .variations_tag {
|
92 |
background-color: #fff;
|
93 |
/*position: fixed; */
|
94 |
-
margin
|
95 |
border-top: 1px solid #DFDFDF;
|
96 |
-moz-border-radius-topleft: 4px;
|
97 |
-webkit-border-top-left-radius: 4px;
|
@@ -99,6 +99,9 @@
|
|
99 |
-moz-border-radius-topright: 4px;
|
100 |
-webkit-border-top-right-radius: 4px;
|
101 |
border-top-right-radius: 4px;
|
|
|
|
|
|
|
102 |
}
|
103 |
.pmxi_plugin .options .variations_tag{
|
104 |
margin-top: 0px;
|
@@ -111,7 +114,7 @@
|
|
111 |
font-size: 12px;
|
112 |
}
|
113 |
.pmxi_plugin .variations_tag .xml {
|
114 |
-
max-height:
|
115 |
overflow: auto;
|
116 |
border: 1px solid #DFDFDF;
|
117 |
border-top:none;
|
@@ -135,24 +138,71 @@
|
|
135 |
|
136 |
@media screen and (max-height: 700px) {
|
137 |
.pmxi_plugin .variations_tag {
|
138 |
-
height:300px;
|
139 |
}
|
140 |
.pmxi_plugin .variations_tag .xml {
|
141 |
max-height: 265px;
|
142 |
}
|
143 |
}
|
144 |
-
.use_parent{
|
145 |
display: inline-block;
|
146 |
position: relative;
|
147 |
}
|
148 |
|
149 |
-
#woocommerce_attributes label{
|
150 |
font-size: 12px;
|
151 |
position: relative;
|
152 |
top:-2px;
|
153 |
left: 3px;
|
154 |
}
|
155 |
|
156 |
-
#variations_tag{
|
157 |
clear: both;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
11 |
}
|
12 |
.pmxi_plugin .options_group{
|
13 |
padding-bottom: 10px;
|
14 |
+
/*overflow: hidden;*/
|
15 |
}
|
16 |
.pmxi_plugin .options_group .input{
|
17 |
padding-left: 8px;
|
91 |
.pmxi_plugin .variations_tag {
|
92 |
background-color: #fff;
|
93 |
/*position: fixed; */
|
94 |
+
margin: 5px;
|
95 |
border-top: 1px solid #DFDFDF;
|
96 |
-moz-border-radius-topleft: 4px;
|
97 |
-webkit-border-top-left-radius: 4px;
|
99 |
-moz-border-radius-topright: 4px;
|
100 |
-webkit-border-top-right-radius: 4px;
|
101 |
border-top-right-radius: 4px;
|
102 |
+
-webkit-box-shadow: 0px 0px 15px #ccc;
|
103 |
+
-moz-box-shadow: 0px 0px 15px #ccc;
|
104 |
+
box-shadow: 0px 0px 15px #ccc;
|
105 |
}
|
106 |
.pmxi_plugin .options .variations_tag{
|
107 |
margin-top: 0px;
|
114 |
font-size: 12px;
|
115 |
}
|
116 |
.pmxi_plugin .variations_tag .xml {
|
117 |
+
max-height: 300px;
|
118 |
overflow: auto;
|
119 |
border: 1px solid #DFDFDF;
|
120 |
border-top:none;
|
138 |
|
139 |
@media screen and (max-height: 700px) {
|
140 |
.pmxi_plugin .variations_tag {
|
141 |
+
max-height:300px;
|
142 |
}
|
143 |
.pmxi_plugin .variations_tag .xml {
|
144 |
max-height: 265px;
|
145 |
}
|
146 |
}
|
147 |
+
.pmxi_plugin .use_parent{
|
148 |
display: inline-block;
|
149 |
position: relative;
|
150 |
}
|
151 |
|
152 |
+
.pmxi_plugin #woocommerce_attributes label{
|
153 |
font-size: 12px;
|
154 |
position: relative;
|
155 |
top:-2px;
|
156 |
left: 3px;
|
157 |
}
|
158 |
|
159 |
+
.pmxi_plugin #variations_tag{
|
160 |
clear: both;
|
161 |
+
position: fixed;
|
162 |
+
top:335px;
|
163 |
+
right:30%;
|
164 |
+
width:300px;
|
165 |
+
display: none;
|
166 |
+
z-index: 1;
|
167 |
+
}
|
168 |
+
.pmxi_plugin .variations_tag .title{
|
169 |
+
cursor: move;
|
170 |
+
}
|
171 |
+
.pmxi_plugin .variations_tag{
|
172 |
+
z-index: 999;
|
173 |
+
}
|
174 |
+
.pmxi_plugin .load_options{
|
175 |
+
float: right;
|
176 |
+
height: 0;
|
177 |
+
position: relative;
|
178 |
+
right: 10px;
|
179 |
+
top: -35px;
|
180 |
+
}
|
181 |
+
.pmxi_plugin #dialog, .pmxi_plugin .ui-dialog{
|
182 |
+
padding: 0px;
|
183 |
+
}
|
184 |
+
.pmxi_plugin #variations_console{
|
185 |
+
margin: 0px 15px;
|
186 |
+
}
|
187 |
+
.pmxi_plugin #toggle_xml_tree{
|
188 |
+
margin: 0px 5px;
|
189 |
+
}
|
190 |
+
.pmxi_plugin #close_xml_tree{
|
191 |
+
display: block;
|
192 |
+
position: absolute;
|
193 |
+
top: -16px;
|
194 |
+
right: -10px;
|
195 |
+
background: url("../img/ico-remove.png") no-repeat scroll 0 0 transparent;
|
196 |
+
width:16px;
|
197 |
+
height:16px;
|
198 |
+
|
199 |
+
}
|
200 |
+
.pmxi_plugin #variable_product_options img{
|
201 |
+
margin: 4px;
|
202 |
+
}
|
203 |
+
.pmxi_plugin .highlight{
|
204 |
+
background: none repeat scroll 0 0 #CAD2DF;
|
205 |
+
padding: 5px;
|
206 |
+
margin-right: 20px;
|
207 |
+
text-align: center;
|
208 |
}
|
static/img/data-example-1.png
ADDED
Binary file
|
static/img/data-example-2.png
ADDED
Binary file
|
static/img/data-example-3.png
ADDED
Binary file
|
static/img/data-example-4.png
ADDED
Binary file
|
static/img/ico-remove.png
ADDED
Binary file
|
static/js/admin.js
CHANGED
@@ -75,7 +75,9 @@
|
|
75 |
|
76 |
if ($('input[name=is_product_manage_stock]:checked').val() == 'no') $('.stock_fields').hide(); else $('.stock_fields').show();
|
77 |
|
78 |
-
if ($('#link_all_variations').is(':checked')) $('.variations_tab').hide(); else if (is_variable) $('.variations_tab').show();
|
|
|
|
|
79 |
|
80 |
if ( ! is_simple ) {
|
81 |
$('.woocommerce_options_panel').find('input, select').attr('disabled','disabled');
|
@@ -85,8 +87,6 @@
|
|
85 |
$('.woocommerce_options_panel').find('input, select').removeAttr('disabled');
|
86 |
$('.upgrade_template').hide();
|
87 |
}
|
88 |
-
|
89 |
-
if ($('#xml_matching_parent').is(':checked')) $('#variations_tag').show(); else $('#variations_tag').hide();
|
90 |
}
|
91 |
|
92 |
$('input[name=matching_parent]').click(function(){
|
@@ -94,7 +94,7 @@
|
|
94 |
if ($(this).val() == "xml") $('#variations_tag').show(); else $('#variations_tag').hide();
|
95 |
|
96 |
});
|
97 |
-
|
98 |
change_depencies();
|
99 |
|
100 |
$('#product-type').change(function(){
|
@@ -150,7 +150,98 @@
|
|
150 |
$('#_variable_downloadable').click(function(){
|
151 |
if ($(this).is(':checked')) $('#variable_downloadable').show(); else $('#variable_downloadable').hide();
|
152 |
});
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
$('.variation_attributes, #woocommerce_attributes').find('label').live({
|
155 |
mouseenter:
|
156 |
function()
|
@@ -168,6 +259,14 @@
|
|
168 |
}
|
169 |
});
|
170 |
|
171 |
-
$('#variations_tag').
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
});})(jQuery);
|
75 |
|
76 |
if ($('input[name=is_product_manage_stock]:checked').val() == 'no') $('.stock_fields').hide(); else $('.stock_fields').show();
|
77 |
|
78 |
+
if ($('#link_all_variations').is(':checked')) $('.variations_tab').hide(); else if (is_variable) $('.variations_tab').show();
|
79 |
+
|
80 |
+
if ($('#xml_matching_parent').is(':checked') && is_variable) $('#variations_tag').show(); else $('#variations_tag').hide();
|
81 |
|
82 |
if ( ! is_simple ) {
|
83 |
$('.woocommerce_options_panel').find('input, select').attr('disabled','disabled');
|
87 |
$('.woocommerce_options_panel').find('input, select').removeAttr('disabled');
|
88 |
$('.upgrade_template').hide();
|
89 |
}
|
|
|
|
|
90 |
}
|
91 |
|
92 |
$('input[name=matching_parent]').click(function(){
|
94 |
if ($(this).val() == "xml") $('#variations_tag').show(); else $('#variations_tag').hide();
|
95 |
|
96 |
});
|
97 |
+
|
98 |
change_depencies();
|
99 |
|
100 |
$('#product-type').change(function(){
|
150 |
$('#_variable_downloadable').click(function(){
|
151 |
if ($(this).is(':checked')) $('#variable_downloadable').show(); else $('#variable_downloadable').hide();
|
152 |
});
|
153 |
+
|
154 |
+
var variation_xpath = $('#variations_xpath').val();
|
155 |
+
|
156 |
+
$('#variations_xpath').blur(function(){
|
157 |
+
if (variation_xpath == ""){
|
158 |
+
$(this).val($(this).val().replace(/(\[\d\]})$/, '[*]'));
|
159 |
+
}
|
160 |
+
variation_xpath = $(this).val();
|
161 |
+
});
|
162 |
+
|
163 |
+
$('#variations_xpath').mousemove(function(){
|
164 |
+
if (variation_xpath == ""){
|
165 |
+
$(this).val($(this).val().replace(/(\[\d\]})$/, '[*]}'));
|
166 |
+
}
|
167 |
+
variation_xpath = $(this).val();
|
168 |
+
});
|
169 |
+
|
170 |
+
$('#variations_xpath').each(function () {
|
171 |
+
|
172 |
+
var $input = $('#variations_xpath');
|
173 |
+
var $xml = $('#variations_xml');
|
174 |
+
var $next_element = $('#next_variation_element');
|
175 |
+
var $prev_element = $('#prev_variation_element');
|
176 |
+
var $goto_element = $('#goto_variation_element');
|
177 |
+
var $variation_tagno = 0;
|
178 |
+
// tag preview
|
179 |
+
$.fn.variation_tag = function () {
|
180 |
+
this.each(function () {
|
181 |
+
var $tag = $(this);
|
182 |
+
$tag.xml('dragable');
|
183 |
+
var tagno = parseInt($tag.find('input[name="tagno"]').val());
|
184 |
+
$tag.find('.navigation a').click(function () {
|
185 |
+
tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
|
186 |
+
$tag.addClass('loading').css('opacity', 0.7);
|
187 |
+
|
188 |
+
$('#variations_console').load('admin.php?page=pmxi-admin-import&action=evaluate_variations', {xpath: $input.val(), tagno: tagno}, function () {
|
189 |
+
var $indicator = $('<span />').insertBefore($tag);
|
190 |
+
$xml.variation_tag();
|
191 |
+
});
|
192 |
+
|
193 |
+
$.post('admin.php?page=pmxi-admin-import&action=evaluate_variations', {xpath: $input.val(), tagno: tagno}, function (data) {
|
194 |
+
var $indicator = $('<span />').insertBefore($tag);
|
195 |
+
$tag.replaceWith(data);
|
196 |
+
$indicator.next().tag().prevObject.remove();
|
197 |
+
}, 'html');
|
198 |
+
return false;
|
199 |
+
});
|
200 |
+
});
|
201 |
+
return this;
|
202 |
+
};
|
203 |
+
|
204 |
+
var variationsXPathChanged = function () {
|
205 |
+
|
206 |
+
if ($input.val() == $input.data('checkedValue')) return;
|
207 |
+
|
208 |
+
// request server to return elements which correspond to xpath entered
|
209 |
+
$input.attr('readonly', true).unbind('change', variationsXPathChanged).data('checkedValue', $input.val());
|
210 |
+
|
211 |
+
$('#variations_console').load('admin.php?page=pmxi-admin-import&action=evaluate_variations', {xpath: $input.val(), tagno: $variation_tagno}, function () {
|
212 |
+
$input.attr('readonly', false);
|
213 |
+
$xml.xml('dragable');
|
214 |
+
if ($('.error').length){
|
215 |
+
$xml.html('');
|
216 |
+
$('#close_xml_tree').hide();
|
217 |
+
}
|
218 |
+
else $('#close_xml_tree').show();
|
219 |
+
});
|
220 |
+
};
|
221 |
+
|
222 |
+
$xml.find('.navigation a').live('click', function () {
|
223 |
+
$variation_tagno += '#variation_prev' == $(this).attr('href') ? -1 : 1;
|
224 |
+
$input.data('checkedValue', '');
|
225 |
+
variationsXPathChanged();
|
226 |
+
});
|
227 |
+
|
228 |
+
$('#variations_xpath').change(function(){$variation_tagno = 0; variationsXPathChanged();});
|
229 |
+
|
230 |
+
$('#variations_xpath').blur(function(){$variation_tagno = 0; variationsXPathChanged();});
|
231 |
+
|
232 |
+
$('#variations_xpath').keyup(function (e) {
|
233 |
+
if (13 == e.keyCode) {$variation_tagno = 0; $(this).change();}
|
234 |
+
});
|
235 |
+
|
236 |
+
if ($input.val() != "")
|
237 |
+
variationsXPathChanged();
|
238 |
+
|
239 |
+
$('#variations_xpath').mousemove(function(){
|
240 |
+
variationsXPathChanged();
|
241 |
+
});
|
242 |
+
});
|
243 |
+
|
244 |
+
|
245 |
$('.variation_attributes, #woocommerce_attributes').find('label').live({
|
246 |
mouseenter:
|
247 |
function()
|
259 |
}
|
260 |
});
|
261 |
|
262 |
+
$('#variations_tag').draggable({ containment: "#wpwrap", zIndex: 100 }).hide();
|
263 |
|
264 |
+
$('#toggle_xml_tree').click(function(){
|
265 |
+
$('#variations_tag').show();
|
266 |
+
});
|
267 |
+
|
268 |
+
$('#close_xml_tree').click(function(){
|
269 |
+
$('#variations_tag').hide();
|
270 |
+
});
|
271 |
+
|
272 |
});})(jQuery);
|
views/admin/import/index.php
CHANGED
@@ -59,7 +59,7 @@
|
|
59 |
|
60 |
<li class="options_tab advanced_options"><a title="Variations for variable products are defined here." href="javascript:void(0);" rel="add_on_options"><?php _e('Add-On Options', 'pmxi_plugin');?></a></li>
|
61 |
|
62 |
-
</ul>
|
63 |
|
64 |
<div class="panel woocommerce_options_panel" id="general_product_data">
|
65 |
|
@@ -105,6 +105,12 @@
|
|
105 |
<a id="cancel_regular_price_shedule" href="javascript:void(0);"><?php _e('cancel');?></a>
|
106 |
</span>
|
107 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
</div>
|
109 |
<div class="options_group show_if_virtual">
|
110 |
<div class="input" style="padding-left:0px;">
|
@@ -155,7 +161,7 @@
|
|
155 |
<label><?php _e("File paths"); ?></label>
|
156 |
<input type="text" class="short" name="single_product_files" value="<?php echo esc_attr($post['single_product_files']) ?>" style="margin-right:5px;"/>
|
157 |
<input type="text" class="small" name="product_files_delim" value="<?php echo esc_attr($post['product_files_delim']) ?>" style="width:5%; text-align:center;"/>
|
158 |
-
<a href="#help" class="help" title="<?php _e('File paths/URLs, comma separated. The delimiter
|
159 |
</p>
|
160 |
<p class="form-field">
|
161 |
<label><?php _e("Download Limit"); ?></label>
|
@@ -234,7 +240,7 @@
|
|
234 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
235 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
236 |
</p>
|
237 |
-
<div class="options_group show_if_simple show_if_variable">
|
238 |
<p class="form-field">Manage stock?</p>
|
239 |
<div class="input" style="margin-top:-10px;">
|
240 |
<div class="input fleft">
|
@@ -345,7 +351,7 @@
|
|
345 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
346 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
347 |
</p>
|
348 |
-
<div class="options_group">
|
349 |
<p class="form-field">
|
350 |
<label><?php _e("Weight (kg)"); ?></label>
|
351 |
<input type="text" class="short" placeholder="0.00" name="single_product_weight" style="" value="<?php echo esc_attr($post['single_product_weight']) ?>"/>
|
@@ -406,7 +412,7 @@
|
|
406 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
407 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
408 |
</p>
|
409 |
-
<div class="options_group">
|
410 |
<p class="form-field">
|
411 |
<label><?php _e("Up-Sells"); ?></label>
|
412 |
<input type="text" class="" placeholder="Products SKU, comma separated" name="single_product_up_sells" style="" value="<?php echo esc_attr($post['single_product_up_sells']) ?>"/>
|
@@ -469,7 +475,7 @@
|
|
469 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
470 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
471 |
</p>
|
472 |
-
<div class="input">
|
473 |
<table class="form-table custom-params" id="attributes_table" style="max-width:95%;">
|
474 |
<thead>
|
475 |
<tr>
|
@@ -484,7 +490,7 @@
|
|
484 |
<tr class="form-field">
|
485 |
<td><input type="text" name="attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:100%;"/></td>
|
486 |
<td>
|
487 |
-
<textarea name="attribute_value[]"><?php echo esc_html($post['attribute_value'][$i]) ?></textarea>
|
488 |
<br>
|
489 |
<span class='in_variations'>
|
490 |
<input type="checkbox" name="in_variations[]" id="in_variations_<?php echo $i; ?>" <?php echo ($post['in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
@@ -513,7 +519,7 @@
|
|
513 |
<tr class="form-field">
|
514 |
<td><input type="text" name="attribute_name[]" value="" style="width:100%;"/></td>
|
515 |
<td>
|
516 |
-
<textarea name="attribute_value[]"></textarea>
|
517 |
<br>
|
518 |
<span class='in_variations'>
|
519 |
<input type="checkbox" name="in_variations[]" id="in_variations_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
@@ -537,7 +543,7 @@
|
|
537 |
<tr class="form-field template">
|
538 |
<td><input type="text" name="attribute_name[]" value="" style="width:100%;"/></td>
|
539 |
<td>
|
540 |
-
<textarea name="attribute_value[]"></textarea>
|
541 |
<br>
|
542 |
<span class='in_variations'>
|
543 |
<input type="checkbox" name="in_variations[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
@@ -568,7 +574,7 @@
|
|
568 |
<input type="hidden" name="link_all_variations" value="0" />
|
569 |
<input type="checkbox" id="link_all_variations" name="link_all_variations" value="1" <?php echo $post['link_all_variations'] ? 'checked="checked"' : '' ?> style="width:25px; position:relative; top:-1px;"/>
|
570 |
<label for="link_all_variations"><?php _e('Link all variations', 'pmxi_plugin') ?></label>
|
571 |
-
<a href="#help" class="help" title="<?php _e('This option will create all
|
572 |
</div>
|
573 |
</div>
|
574 |
</div><!-- End Product Panel -->
|
@@ -579,7 +585,7 @@
|
|
579 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
580 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
581 |
</p>
|
582 |
-
<div class="options_group hide_if_external" style="padding-bottom:0px;">
|
583 |
<p class="form-field">
|
584 |
<label><?php _e("Purchase Note"); ?></label>
|
585 |
<input type="text" class="short" placeholder="" name="single_product_purchase_note" style="" value="<?php echo esc_attr($post['single_product_purchase_note']) ?>"/>
|
@@ -653,7 +659,7 @@
|
|
653 |
<label for="product_visibility_search"><?php _e("Search"); ?></label>
|
654 |
</div>
|
655 |
<div class="input fleft">
|
656 |
-
<input type="radio" id="product_visibility_hidden" class="switcher" name="
|
657 |
<label for="product_visibility_hidden"><?php _e("Hidden"); ?></label>
|
658 |
</div>
|
659 |
<div class="input fleft" style="position:relative; width:220px;">
|
@@ -677,50 +683,87 @@
|
|
677 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
678 |
</p>
|
679 |
<div class="options_group" style="padding-bottom:0px;">
|
680 |
-
<div class="input" style="padding-bottom:10px;">
|
681 |
-
<input type="radio" id="auto_matching_parent" class="switcher" name="matching_parent" value="auto" <?php echo '
|
682 |
-
<label for="auto_matching_parent"><?php _e('
|
683 |
-
<div class="switcher-target-auto_matching_parent" style="padding-left:17px;">
|
684 |
<p class="form-field">
|
685 |
-
<label style="width:
|
686 |
<input type="text" class="short" placeholder="" name="single_product_id" value="<?php echo esc_attr($post['single_product_id']) ?>"/>
|
|
|
687 |
</p>
|
688 |
<p class="form-field">
|
689 |
-
<label style="width:
|
690 |
<input type="text" class="short" placeholder="" name="single_product_parent_id" value="<?php echo esc_attr($post['single_product_parent_id']) ?>"/>
|
|
|
691 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
692 |
</div>
|
693 |
<div class="clear" style="margin-top:5px;"></div>
|
694 |
-
|
695 |
-
<
|
696 |
-
<
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
<
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
<input type="text" name="custom_parent_indicator_name" value="<?php echo esc_attr($post['custom_parent_indicator_name']) ?>" style="float:none; margin:1px;" /><br>
|
709 |
-
<?php _e('Value', 'pmxi_plugin') ?>
|
710 |
-
<input type="text" name="custom_parent_indicator_value" value="<?php echo esc_attr($post['custom_parent_indicator_value']) ?>" style="float:none; margin:1px;" />
|
711 |
-
</span>
|
712 |
-
</div>
|
713 |
</div>
|
714 |
<div class="clear" style="margin-top:5px;"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
715 |
|
716 |
<input type="radio" id="xml_matching_parent" class="switcher" name="matching_parent" value="xml" <?php echo 'xml' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
717 |
-
<label for="xml_matching_parent"><?php _e('
|
718 |
<a href="#help" class="help" title="<?php _e('This allows you to set variations that are stored as children XML elements.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
719 |
-
<div class="switcher-target-xml_matching_parent" style="padding-left:17px;">
|
720 |
<div class="input">
|
|
|
721 |
<p class="form-field">
|
722 |
<label style="width:150px;"><?php _e("Variations XPath", "pmxi_plugin"); ?></label>
|
723 |
-
<input type="text" class="short" placeholder="" id="variations_xpath" name="variations_xpath" value="<?php echo esc_attr($post['variations_xpath']) ?>" style="width:370px !important;"/>
|
|
|
724 |
</p>
|
725 |
<p class="form-field">
|
726 |
<label style="border-right:none;" for="_variable_virtual"><?php _e('Virtual', 'woocommerce');?> </label>
|
@@ -777,12 +820,23 @@
|
|
777 |
<label for="variable_sale_price_use_parent">XPath Is From Parent</label>
|
778 |
</span>
|
779 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
780 |
</div>
|
781 |
<div class="options_group" <?php if ( ! $post['is_variable_sale_price_shedule']):?>style="display:none;"<?php endif; ?> id="variable_sale_price_range">
|
782 |
<p class="form-field">
|
783 |
<span style="vertical-align:middle">
|
784 |
<label style="width:150px;"><?php _e("Variable Sale Price Dates", "woocommerce"); ?></label>
|
785 |
-
<span class="use_parent"
|
786 |
<input type="hidden" name="variable_sale_dates_use_parent" value="0"/>
|
787 |
<input type="checkbox" name="variable_sale_dates_use_parent" id="variable_sale_dates_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['variable_sale_dates_use_parent']) ? 'checked="checked"' : ''; ?>>
|
788 |
<label for="variable_sale_dates_use_parent">XPath Is From Parent</label>
|
@@ -835,7 +889,7 @@
|
|
835 |
</p>
|
836 |
<p class="form-field">
|
837 |
<label for"product_length"=""><?php _e('Dimensions (L×W×H)','woocommerce');?></label>
|
838 |
-
<span class="use_parent"
|
839 |
<input type="hidden" name="variable_dimensions_use_parent" value="0"/>
|
840 |
<input type="checkbox" name="variable_dimensions_use_parent" id="variable_dimensions_use_parent" style="position:relative; top:3px; margin-left:5px;" <?php echo ($post['variable_dimensions_use_parent']) ? 'checked="checked"' : ''; ?>>
|
841 |
<label for="variable_dimensions_use_parent">XPath Is From Parent</label>
|
@@ -1003,7 +1057,7 @@
|
|
1003 |
</div>
|
1004 |
</div>
|
1005 |
</div>
|
1006 |
-
</div>
|
1007 |
|
1008 |
</div>
|
1009 |
|
@@ -1024,8 +1078,8 @@
|
|
1024 |
<?php if (!empty($post['variable_attribute_name'][0])):?>
|
1025 |
<?php foreach ($post['variable_attribute_name'] as $i => $name): if ("" == $name) continue; ?>
|
1026 |
<tr class="form-field">
|
1027 |
-
<td><input type="text" name="variable_attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:
|
1028 |
-
<td><textarea name="variable_attribute_value[]"><?php echo esc_html($post['variable_attribute_value'][$i]) ?></textarea>
|
1029 |
<br>
|
1030 |
<span class='in_variations' style="margin-left:0px;">
|
1031 |
<input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_<?php echo $i; ?>" <?php echo ($post['variable_in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
@@ -1055,8 +1109,8 @@
|
|
1055 |
<?php endforeach ?>
|
1056 |
<?php else: ?>
|
1057 |
<tr class="form-field">
|
1058 |
-
<td><input type="text" name="variable_attribute_name[]" value="" style="width:
|
1059 |
-
<td><textarea name="variable_attribute_value[]"></textarea>
|
1060 |
<br>
|
1061 |
<span class='in_variations' style="margin-left:0px;">
|
1062 |
<input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
@@ -1078,8 +1132,8 @@
|
|
1078 |
</tr>
|
1079 |
<?php endif;?>
|
1080 |
<tr class="form-field template">
|
1081 |
-
<td><input type="text" name="variable_attribute_name[]" value="" style="width:
|
1082 |
-
<td><textarea name="variable_attribute_value[]"></textarea>
|
1083 |
<br>
|
1084 |
<span class='in_variations' style="margin-left:0px;">
|
1085 |
<input type="checkbox" name="variable_in_variations[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
@@ -1107,11 +1161,48 @@
|
|
1107 |
</div>
|
1108 |
</div>
|
1109 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1110 |
</div>
|
1111 |
</div>
|
1112 |
</div>
|
1113 |
</div>
|
1114 |
-
<div class="options_group">
|
1115 |
<p class="form-field"><?php _e('Variable Enabled','pmxi_plugin');?></p>
|
1116 |
<div class="input" style="margin-top:-10px;">
|
1117 |
<div class="input fleft">
|
@@ -1133,6 +1224,18 @@
|
|
1133 |
</div>
|
1134 |
</div>
|
1135 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1136 |
</div>
|
1137 |
</div><!-- End Product Panel -->
|
1138 |
|
@@ -1151,6 +1254,12 @@
|
|
1151 |
<label for="missing_records_stock_status"><?php _e('Set out of stock status for missing records', 'pmxi_plugin') ?></label>
|
1152 |
<a href="#help" class="help" title="<?php _e('Option to set the stock status to out of stock instead of deleting the product entirely. This option doesn\'t work when \'Delete missing records\' option is enabled.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
1153 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
1154 |
</div>
|
1155 |
</div>
|
1156 |
</div>
|
59 |
|
60 |
<li class="options_tab advanced_options"><a title="Variations for variable products are defined here." href="javascript:void(0);" rel="add_on_options"><?php _e('Add-On Options', 'pmxi_plugin');?></a></li>
|
61 |
|
62 |
+
</ul>
|
63 |
|
64 |
<div class="panel woocommerce_options_panel" id="general_product_data">
|
65 |
|
105 |
<a id="cancel_regular_price_shedule" href="javascript:void(0);"><?php _e('cancel');?></a>
|
106 |
</span>
|
107 |
</p>
|
108 |
+
<?php if ( class_exists('woocommerce_wholesale_pricing') ):?>
|
109 |
+
<p class="form-field">
|
110 |
+
<label><?php _e("Wholesale Price (".get_woocommerce_currency_symbol().")"); ?></label>
|
111 |
+
<input type="text" class="short" name="single_product_whosale_price" value="<?php echo esc_attr($post['single_product_whosale_price']) ?>"/>
|
112 |
+
</p>
|
113 |
+
<?php endif; ?>
|
114 |
</div>
|
115 |
<div class="options_group show_if_virtual">
|
116 |
<div class="input" style="padding-left:0px;">
|
161 |
<label><?php _e("File paths"); ?></label>
|
162 |
<input type="text" class="short" name="single_product_files" value="<?php echo esc_attr($post['single_product_files']) ?>" style="margin-right:5px;"/>
|
163 |
<input type="text" class="small" name="product_files_delim" value="<?php echo esc_attr($post['product_files_delim']) ?>" style="width:5%; text-align:center;"/>
|
164 |
+
<a href="#help" class="help" title="<?php _e('File paths/URLs, comma separated. The delimiter is used when an XML element contains multiple URLs/paths - i.e. <code>http://files.com/1.doc, http://files.com/2.doc</code>.', 'pmxi_plugin') ?>">?</a>
|
165 |
</p>
|
166 |
<p class="form-field">
|
167 |
<label><?php _e("Download Limit"); ?></label>
|
240 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
241 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
242 |
</p>
|
243 |
+
<div class="options_group show_if_simple show_if_variable">
|
244 |
<p class="form-field">Manage stock?</p>
|
245 |
<div class="input" style="margin-top:-10px;">
|
246 |
<div class="input fleft">
|
351 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
352 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
353 |
</p>
|
354 |
+
<div class="options_group">
|
355 |
<p class="form-field">
|
356 |
<label><?php _e("Weight (kg)"); ?></label>
|
357 |
<input type="text" class="short" placeholder="0.00" name="single_product_weight" style="" value="<?php echo esc_attr($post['single_product_weight']) ?>"/>
|
412 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
413 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
414 |
</p>
|
415 |
+
<div class="options_group">
|
416 |
<p class="form-field">
|
417 |
<label><?php _e("Up-Sells"); ?></label>
|
418 |
<input type="text" class="" placeholder="Products SKU, comma separated" name="single_product_up_sells" style="" value="<?php echo esc_attr($post['single_product_up_sells']) ?>"/>
|
475 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
476 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
477 |
</p>
|
478 |
+
<div class="input">
|
479 |
<table class="form-table custom-params" id="attributes_table" style="max-width:95%;">
|
480 |
<thead>
|
481 |
<tr>
|
490 |
<tr class="form-field">
|
491 |
<td><input type="text" name="attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:100%;"/></td>
|
492 |
<td>
|
493 |
+
<textarea name="attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."><?php echo esc_html($post['attribute_value'][$i]) ?></textarea>
|
494 |
<br>
|
495 |
<span class='in_variations'>
|
496 |
<input type="checkbox" name="in_variations[]" id="in_variations_<?php echo $i; ?>" <?php echo ($post['in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
519 |
<tr class="form-field">
|
520 |
<td><input type="text" name="attribute_name[]" value="" style="width:100%;"/></td>
|
521 |
<td>
|
522 |
+
<textarea name="attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
|
523 |
<br>
|
524 |
<span class='in_variations'>
|
525 |
<input type="checkbox" name="in_variations[]" id="in_variations_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
543 |
<tr class="form-field template">
|
544 |
<td><input type="text" name="attribute_name[]" value="" style="width:100%;"/></td>
|
545 |
<td>
|
546 |
+
<textarea name="attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
|
547 |
<br>
|
548 |
<span class='in_variations'>
|
549 |
<input type="checkbox" name="in_variations[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
574 |
<input type="hidden" name="link_all_variations" value="0" />
|
575 |
<input type="checkbox" id="link_all_variations" name="link_all_variations" value="1" <?php echo $post['link_all_variations'] ? 'checked="checked"' : '' ?> style="width:25px; position:relative; top:-1px;"/>
|
576 |
<label for="link_all_variations"><?php _e('Link all variations', 'pmxi_plugin') ?></label>
|
577 |
+
<a href="#help" class="help" title="<?php _e('This option will create all possible variations for the presented attributes. Works just like the Link All Variations option inside WooCommerce.', 'pmxi_plugin') ?>" style="position:relative; top:-3px;">?</a>
|
578 |
</div>
|
579 |
</div>
|
580 |
</div><!-- End Product Panel -->
|
585 |
<p class="upgrade_template" style='display:none; font-size: 1.3em; font-weight: bold;'>
|
586 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
587 |
</p>
|
588 |
+
<div class="options_group hide_if_external" style="padding-bottom:0px;">
|
589 |
<p class="form-field">
|
590 |
<label><?php _e("Purchase Note"); ?></label>
|
591 |
<input type="text" class="short" placeholder="" name="single_product_purchase_note" style="" value="<?php echo esc_attr($post['single_product_purchase_note']) ?>"/>
|
659 |
<label for="product_visibility_search"><?php _e("Search"); ?></label>
|
660 |
</div>
|
661 |
<div class="input fleft">
|
662 |
+
<input type="radio" id="product_visibility_hidden" class="switcher" name="is_product_visibility" value="hidden" <?php echo 'hidden' == $post['is_product_visibility'] ? 'checked="checked"': '' ?>/>
|
663 |
<label for="product_visibility_hidden"><?php _e("Hidden"); ?></label>
|
664 |
</div>
|
665 |
<div class="input fleft" style="position:relative; width:220px;">
|
683 |
<a href="http://www.wpallimport.com/upgrade-to-pro?utm_source=wordpress.org&utm_medium=wooco&utm_campaign=free+plugin+wooco" target="_blank" class="upgrade_link">Upgrade to the pro version of the WooCommerce Add-On to import to grouped, affiliate/external, and variable products.</a>
|
684 |
</p>
|
685 |
<div class="options_group" style="padding-bottom:0px;">
|
686 |
+
<div class="input" style="padding-bottom:10px;">
|
687 |
+
<input type="radio" id="auto_matching_parent" class="switcher" name="matching_parent" value="auto" <?php echo 'auto' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
688 |
+
<label for="auto_matching_parent" style="width:95%"><?php _e('All my variable products have SKUs or some other unique identifier. Each variation is linked to its parent with its parent\'s SKU or other unique identifier.', 'pmxi_plugin' )?></label><br>
|
689 |
+
<div class="switcher-target-auto_matching_parent" style="padding-left:17px;">
|
690 |
<p class="form-field">
|
691 |
+
<label style="width:185px;"><?php _e("SKU element for parent", "pmxi_plugin"); ?></label>
|
692 |
<input type="text" class="short" placeholder="" name="single_product_id" value="<?php echo esc_attr($post['single_product_id']) ?>"/>
|
693 |
+
<a href="#help" class="help" title="<?php _e('SKU column in the below example.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
694 |
</p>
|
695 |
<p class="form-field">
|
696 |
+
<label style="width:185px;"><?php _e("Parent SKU element for variation", "pmxi_plugin"); ?></label>
|
697 |
<input type="text" class="short" placeholder="" name="single_product_parent_id" value="<?php echo esc_attr($post['single_product_parent_id']) ?>"/>
|
698 |
+
<a href="#help" class="help" title="<?php _e('Parent SKU column in the below example.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
699 |
</p>
|
700 |
+
<p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/variations-data/data-example-1.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
|
701 |
+
<img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-1.png"/>
|
702 |
+
<p class="highlight">
|
703 |
+
<strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
704 |
+
</p>
|
705 |
+
<?php if ( ! $id ): ?>
|
706 |
+
<p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
|
707 |
+
<?php endif; ?>
|
708 |
</div>
|
709 |
<div class="clear" style="margin-top:5px;"></div>
|
710 |
+
<input type="radio" id="auto_matching_parent_first_is_parent_id" class="switcher" name="matching_parent" value="first_is_parent_id" <?php echo 'first_is_parent_id' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
711 |
+
<label for="auto_matching_parent_first_is_parent_id" style="width:95%"><?php _e('All products with variations are grouped with a unique identifier that is the same for each variation and unique for each product.', 'pmxi_plugin' )?></label><br>
|
712 |
+
<div class="switcher-target-auto_matching_parent_first_is_parent_id" style="padding-left:17px;">
|
713 |
+
<p class="form-field">
|
714 |
+
<label style="width:95px;"><?php _e("Unique Identifier", "pmxi_plugin"); ?></label>
|
715 |
+
<input type="text" class="short" placeholder="" name="single_product_id_first_is_parent_id" value="<?php echo esc_attr($post['single_product_id_first_is_parent_id']) ?>"/>
|
716 |
+
<a href="#help" class="help" title="<?php _e('Group ID column in the below example.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
717 |
+
</p>
|
718 |
+
<p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/variations-data/data-example-2.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
|
719 |
+
<img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-2.png"/>
|
720 |
+
<p class="highlight"><strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a></p>
|
721 |
+
<?php if ( ! $id ): ?>
|
722 |
+
<p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
|
723 |
+
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
724 |
</div>
|
725 |
<div class="clear" style="margin-top:5px;"></div>
|
726 |
+
<input type="radio" id="auto_matching_parent_first_is_parent_title" class="switcher" name="matching_parent" value="first_is_parent_title" <?php echo 'first_is_parent_title' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
727 |
+
<label for="auto_matching_parent_first_is_parent_title"><?php _e('All variations for a particular product have the same title as the parent product.', 'pmxi_plugin' )?></label><br>
|
728 |
+
<div class="switcher-target-auto_matching_parent_first_is_parent_title" style="padding-left:17px;">
|
729 |
+
<p class="form-field">
|
730 |
+
<label style="width:75px;"><?php _e("Product Title", "pmxi_plugin"); ?></label>
|
731 |
+
<input type="text" class="short" placeholder="" name="single_product_id_first_is_parent_title" value="<?php echo ($post['single_product_id_first_is_parent_title']) ? esc_attr($post['single_product_id_first_is_parent_title']) : ((!empty(PMXI_Plugin::$session->data['pmxi_import']['template']['title'])) ? esc_attr(PMXI_Plugin::$session->data['pmxi_import']['template']['title']) : ''); ?>"/>
|
732 |
+
</p>
|
733 |
+
<p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/variations-data/data-example-3.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
|
734 |
+
<img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-3.png"/>
|
735 |
+
<p class="highlight"><strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a></p>
|
736 |
+
<?php if ( ! $id ): ?>
|
737 |
+
<p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
|
738 |
+
<?php endif; ?>
|
739 |
+
</div>
|
740 |
+
<div class="clear" style="margin-top:5px;"></div>
|
741 |
+
<input type="radio" id="auto_matching_parent_first_is_variation" class="switcher" name="matching_parent" value="first_is_variation" <?php echo 'first_is_variation' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
742 |
+
<label for="auto_matching_parent_first_is_variation"><?php _e('All variations for a particular product have the same title. There are no parent products.', 'pmxi_plugin' )?></label><br>
|
743 |
+
<div class="switcher-target-auto_matching_parent_first_is_variation" style="padding-left:17px;">
|
744 |
+
<p class="form-field">
|
745 |
+
<label style="width:75px;"><?php _e("Product Title"); ?></label>
|
746 |
+
<input type="text" class="short" placeholder="" name="single_product_id_first_is_variation" value="<?php echo ($post['single_product_id_first_is_variation']) ? esc_attr($post['single_product_id_first_is_variation']) : ((!empty(PMXI_Plugin::$session->data['pmxi_import']['template']['title'])) ? esc_attr(PMXI_Plugin::$session->data['pmxi_import']['template']['title']) : ''); ?>"/>
|
747 |
+
</p>
|
748 |
+
<p><strong><?php _e("Example Data For Use With This Option","pmxi_plugin");?> </strong> - <a href="http://www.wpallimport.com/variations-data/data-example-4.csv" tatger="_blank"><?php _e("download","pmxi_plugin");?></a></p>
|
749 |
+
<img src="<?php echo PMWI_FREE_ROOT_URL; ?>/static/img/data-example-4.png"/>
|
750 |
+
<p class="highlight"><strong><?php _e("Important: Your Unique Key must be unique for each variation.","pmxi_plugin");?></strong> <a href="#help" class="help" title="<?php _e('If each variation doesn’t have a unique ID/SKU, it is recommended that you construct your Unique Key using your variation attribute values. You can set your Unique Key at the top of the Record Matching section below.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a></p>
|
751 |
+
<?php if ( ! $id ): ?>
|
752 |
+
<p style="text-align:center;"><a href="javascript:void(0);" class="auto_generate_unique_key"><?php _e("Auto-Append Variation Attributes To Unique Key", "pmxi_plugin");?></a></p>
|
753 |
+
<?php endif; ?>
|
754 |
+
</div>
|
755 |
+
<div class="clear" style="margin-top:5px;"></div>
|
756 |
|
757 |
<input type="radio" id="xml_matching_parent" class="switcher" name="matching_parent" value="xml" <?php echo 'xml' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
758 |
+
<label for="xml_matching_parent"><?php _e('I\'m importing XML and my variations are child XML elements', 'pmxi_plugin' )?> </label>
|
759 |
<a href="#help" class="help" title="<?php _e('This allows you to set variations that are stored as children XML elements.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
760 |
+
<div class="switcher-target-xml_matching_parent" style="padding-left:17px; position:relative;">
|
761 |
<div class="input">
|
762 |
+
<p class="form-field"><a href="http://youtu.be/7xL4RGT-JRc?t=1m40s" target="_blank"><?php _e("Video Example", "pmxi_plugin");?></a></p>
|
763 |
<p class="form-field">
|
764 |
<label style="width:150px;"><?php _e("Variations XPath", "pmxi_plugin"); ?></label>
|
765 |
+
<input type="text" class="short" placeholder="" id="variations_xpath" name="variations_xpath" value="<?php echo esc_attr($post['variations_xpath']) ?>" style="width:370px !important;"/> <a href="javascript:void(0);" id="toggle_xml_tree">Open XML Tree</a>
|
766 |
+
<div id="variations_console"></div>
|
767 |
</p>
|
768 |
<p class="form-field">
|
769 |
<label style="border-right:none;" for="_variable_virtual"><?php _e('Virtual', 'woocommerce');?> </label>
|
820 |
<label for="variable_sale_price_use_parent">XPath Is From Parent</label>
|
821 |
</span>
|
822 |
</p>
|
823 |
+
<?php if ( class_exists('woocommerce_wholesale_pricing') ):?>
|
824 |
+
<p class="form-field">
|
825 |
+
<label style="width:150px;"><?php _e("Wholesale Price (".get_woocommerce_currency_symbol().")"); ?></label>
|
826 |
+
<input type="text" class="short" name="variable_whosale_price" value="<?php echo esc_attr($post['variable_whosale_price']) ?>"/>
|
827 |
+
<span class="use_parent">
|
828 |
+
<input type="hidden" name="variable_whosale_price_use_parent" value="0"/>
|
829 |
+
<input type="checkbox" name="variable_whosale_price_use_parent" id="variable_whosale_price_use_parent" style="position:relative; top:3px; margin-left:5px;" <?php echo ($post['variable_whosale_price_use_parent']) ? 'checked="checked"' : ''; ?>>
|
830 |
+
<label for="variable_whosale_price_use_parent">XPath Is From Parent</label>
|
831 |
+
</span>
|
832 |
+
</p>
|
833 |
+
<?php endif; ?>
|
834 |
</div>
|
835 |
<div class="options_group" <?php if ( ! $post['is_variable_sale_price_shedule']):?>style="display:none;"<?php endif; ?> id="variable_sale_price_range">
|
836 |
<p class="form-field">
|
837 |
<span style="vertical-align:middle">
|
838 |
<label style="width:150px;"><?php _e("Variable Sale Price Dates", "woocommerce"); ?></label>
|
839 |
+
<span class="use_parent">
|
840 |
<input type="hidden" name="variable_sale_dates_use_parent" value="0"/>
|
841 |
<input type="checkbox" name="variable_sale_dates_use_parent" id="variable_sale_dates_use_parent" style="position:relative; top:4px; margin-left:5px;" <?php echo ($post['variable_sale_dates_use_parent']) ? 'checked="checked"' : ''; ?>>
|
842 |
<label for="variable_sale_dates_use_parent">XPath Is From Parent</label>
|
889 |
</p>
|
890 |
<p class="form-field">
|
891 |
<label for"product_length"=""><?php _e('Dimensions (L×W×H)','woocommerce');?></label>
|
892 |
+
<span class="use_parent">
|
893 |
<input type="hidden" name="variable_dimensions_use_parent" value="0"/>
|
894 |
<input type="checkbox" name="variable_dimensions_use_parent" id="variable_dimensions_use_parent" style="position:relative; top:3px; margin-left:5px;" <?php echo ($post['variable_dimensions_use_parent']) ? 'checked="checked"' : ''; ?>>
|
895 |
<label for="variable_dimensions_use_parent">XPath Is From Parent</label>
|
1057 |
</div>
|
1058 |
</div>
|
1059 |
</div>
|
1060 |
+
</div>
|
1061 |
|
1062 |
</div>
|
1063 |
|
1078 |
<?php if (!empty($post['variable_attribute_name'][0])):?>
|
1079 |
<?php foreach ($post['variable_attribute_name'] as $i => $name): if ("" == $name) continue; ?>
|
1080 |
<tr class="form-field">
|
1081 |
+
<td><input type="text" name="variable_attribute_name[]" value="<?php echo esc_attr($name) ?>" style="width:95% !important;"/></td>
|
1082 |
+
<td><textarea name="variable_attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."><?php echo esc_html($post['variable_attribute_value'][$i]) ?></textarea>
|
1083 |
<br>
|
1084 |
<span class='in_variations' style="margin-left:0px;">
|
1085 |
<input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_<?php echo $i; ?>" <?php echo ($post['variable_in_variations'][$i]) ? 'checked="checked"' : ''; ?> style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
1109 |
<?php endforeach ?>
|
1110 |
<?php else: ?>
|
1111 |
<tr class="form-field">
|
1112 |
+
<td><input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/></td>
|
1113 |
+
<td><textarea name="variable_attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
|
1114 |
<br>
|
1115 |
<span class='in_variations' style="margin-left:0px;">
|
1116 |
<input type="checkbox" name="variable_in_variations[]" id="variable_in_variations_0" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
1132 |
</tr>
|
1133 |
<?php endif;?>
|
1134 |
<tr class="form-field template">
|
1135 |
+
<td><input type="text" name="variable_attribute_name[]" value="" style="width:95% !important;"/></td>
|
1136 |
+
<td><textarea name="variable_attribute_value[]" placeholder="Enter some text, or some attributes by pipe (|) separating values."></textarea>
|
1137 |
<br>
|
1138 |
<span class='in_variations' style="margin-left:0px;">
|
1139 |
<input type="checkbox" name="variable_in_variations[]" checked="checked" style="width: auto; position: relative; top: 1px; left: 0px;" value="1"/>
|
1161 |
</div>
|
1162 |
</div>
|
1163 |
</div>
|
1164 |
+
<div id="variations_tag" class="options_group show_if_variable">
|
1165 |
+
<a href="javascript:void(0)" id="close_xml_tree"></a>
|
1166 |
+
<div class="variations_tree">
|
1167 |
+
<div id="variations_xml">
|
1168 |
+
<div class="variations_tag">
|
1169 |
+
<input type="hidden" name="variations_tagno" value="<?php echo $tagno ?>" />
|
1170 |
+
<div class="title">
|
1171 |
+
<?php printf(__('No matching elements found for XPath expression specified', 'pmxi_plugin'), $tagno, $variation_list_count); ?>
|
1172 |
+
</div>
|
1173 |
+
<div class="clear"></div>
|
1174 |
+
<div class="xml resetable"></div>
|
1175 |
+
</div>
|
1176 |
+
</div>
|
1177 |
+
</div>
|
1178 |
+
</div>
|
1179 |
+
</div>
|
1180 |
+
</div>
|
1181 |
+
|
1182 |
+
<div class="clear" style="margin-top:5px;"></div>
|
1183 |
+
|
1184 |
+
<input type="radio" id="manual_matching_parent" class="switcher" name="matching_parent" value="manual" <?php echo 'manual' == $post['matching_parent'] ? 'checked="checked"': '' ?>/>
|
1185 |
+
<label for="manual_matching_parent"><?php _e('I\'m an advanced user and will match my variations with my parent products manually. (Advanced)', 'pmxi_plugin' )?></label>
|
1186 |
+
<a href="#help" class="help" title="<?php _e('This allows you to match products as you would in the Manual Record Matching section of WP All Import.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
1187 |
+
<div class="switcher-target-manual_matching_parent" style="padding-left:17px;">
|
1188 |
+
<div class="input">
|
1189 |
+
<input type="radio" id="duplicate_indicator_title_parent" class="switcher" name="parent_indicator" value="title" <?php echo 'title' == $post['parent_indicator'] ? 'checked="checked"': '' ?>/>
|
1190 |
+
<label for="duplicate_indicator_title_parent"><?php _e('title', 'pmxi_plugin' )?> </label>
|
1191 |
+
<input type="radio" id="duplicate_indicator_content_parent" class="switcher" name="parent_indicator" value="content" <?php echo 'content' == $post['parent_indicator'] ? 'checked="checked"': '' ?>/>
|
1192 |
+
<label for="duplicate_indicator_content_parent"><?php _e('content', 'pmxi_plugin' )?> </label>
|
1193 |
+
<input type="radio" id="duplicate_indicator_custom_field_parent" class="switcher" name="parent_indicator" value="custom field" <?php echo 'custom field' == $post['parent_indicator'] ? 'checked="checked"': '' ?>/>
|
1194 |
+
<label for="duplicate_indicator_custom_field_parent"><?php _e('custom field', 'pmxi_plugin' )?></label><br>
|
1195 |
+
<span class="switcher-target-duplicate_indicator_custom_field_parent" style="vertical-align:middle" style="padding-left:17px;">
|
1196 |
+
<?php _e('Name', 'pmxi_plugin') ?>
|
1197 |
+
<input type="text" name="custom_parent_indicator_name" value="<?php echo esc_attr($post['custom_parent_indicator_name']) ?>" style="float:none; margin:1px;" /><br>
|
1198 |
+
<?php _e('Value', 'pmxi_plugin') ?>
|
1199 |
+
<input type="text" name="custom_parent_indicator_value" value="<?php echo esc_attr($post['custom_parent_indicator_value']) ?>" style="float:none; margin:1px; margin-left:3px;" />
|
1200 |
+
</span>
|
1201 |
</div>
|
1202 |
</div>
|
1203 |
</div>
|
1204 |
</div>
|
1205 |
+
<div class="options_group">
|
1206 |
<p class="form-field"><?php _e('Variable Enabled','pmxi_plugin');?></p>
|
1207 |
<div class="input" style="margin-top:-10px;">
|
1208 |
<div class="input fleft">
|
1224 |
</div>
|
1225 |
</div>
|
1226 |
</div>
|
1227 |
+
<div class="clear"></div>
|
1228 |
+
<p class="form-field"><?php _e('Automaticaly set default selections','pmxi_plugin');?></p>
|
1229 |
+
<div class="input" style="margin-top:-10px;">
|
1230 |
+
<div class="input fleft">
|
1231 |
+
<input type="radio" id="set_default_yes" name="is_default_attributes" value="1" <?php echo $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
|
1232 |
+
<label for="set_default_yes"><?php _e("Yes"); ?></label>
|
1233 |
+
</div>
|
1234 |
+
<div class="input fleft">
|
1235 |
+
<input type="radio" id="set_default_no" name="is_default_attributes" value="0" <?php echo ! $post['is_default_attributes'] ? 'checked="checked"': '' ?>/>
|
1236 |
+
<label for="set_default_no"><?php _e("No"); ?></label>
|
1237 |
+
</div>
|
1238 |
+
</div>
|
1239 |
</div>
|
1240 |
</div><!-- End Product Panel -->
|
1241 |
|
1254 |
<label for="missing_records_stock_status"><?php _e('Set out of stock status for missing records', 'pmxi_plugin') ?></label>
|
1255 |
<a href="#help" class="help" title="<?php _e('Option to set the stock status to out of stock instead of deleting the product entirely. This option doesn\'t work when \'Delete missing records\' option is enabled.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
1256 |
</div>
|
1257 |
+
<div class="input" style="padding-left:20px;">
|
1258 |
+
<input type="hidden" name="disable_auto_sku_generation" value="0" />
|
1259 |
+
<input type="checkbox" id="disable_auto_sku_generation" name="disable_auto_sku_generation" value="1" <?php echo $post['disable_auto_sku_generation'] ? 'checked="checked"' : '' ?> />
|
1260 |
+
<label for="disable_auto_sku_generation"><?php _e('Disable auto SKU generation', 'pmxi_plugin') ?></label>
|
1261 |
+
<a href="#help" class="help" title="<?php _e('Plugin will NOT automaticaly generate the SKU for each product based on md5 algorithm, if SKU option is empty.', 'pmxi_plugin') ?>" style="position:relative; top:-2px;">?</a>
|
1262 |
+
</div>
|
1263 |
</div>
|
1264 |
</div>
|
1265 |
</div>
|