| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- /**
- * Import page view
- *
- * @since 1.0.0
- * @package Studiou_WC_Product_Cat_Manage
- */
- // If this file is called directly, abort.
- if (!defined('WPINC')) {
- die;
- }
- ?>
- <div class="wrap studiou-wcpcm-wrap">
- <h1><?php echo esc_html__('Import Product Categories', 'studiou-wc-product-cat-manage'); ?></h1>
-
- <div class="studiou-wcpcm-notice-area">
- <!-- Area for displaying notices -->
- </div>
-
- <div class="studiou-wcpcm-card">
- <h2><?php echo esc_html__('Import from CSV', 'studiou-wc-product-cat-manage'); ?></h2>
-
- <p><?php echo esc_html__('Import product categories from a CSV file. The file should have the following columns:', 'studiou-wc-product-cat-manage'); ?></p>
-
- <ul>
- <li><strong>name</strong> - <?php echo esc_html__('Product Category Name', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>url-name</strong> - <?php echo esc_html__('Product Category URL part name (slug)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>parent-name</strong> - <?php echo esc_html__('Reference to parent Product Category Name (If has no parent, value is empty)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>description</strong> - <?php echo esc_html__('Product Category description', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>display-type</strong> - <?php echo esc_html__('Product Category display type (values: \'default\', \'products\', \'subcategories\', \'both\')', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>visibility</strong> - <?php echo esc_html__('Product Category visibility (values: \'public\', \'protected\')', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>protected-passwords</strong> - <?php echo esc_html__('Pipe (|) separated list of passwords if visibility is set to \'protected\'', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>operation</strong> - <?php echo esc_html__('Record operation, \'A\' - add new, \'D\' - delete, \'U\' - update', 'studiou-wc-product-cat-manage'); ?></li>
- </ul>
-
- <p><?php echo esc_html__('The CSV file should use commas (,) as separators and double quotes (") around text values. The file encoding must be UTF-8.', 'studiou-wc-product-cat-manage'); ?></p>
-
- <form id="studiou-wcpcm-import-form" method="post" enctype="multipart/form-data">
- <div class="form-field">
- <label for="import_file"><?php echo esc_html__('Choose CSV file', 'studiou-wc-product-cat-manage'); ?></label>
- <input type="file" name="import_file" id="import_file" accept=".csv" required>
- </div>
-
- <div class="submit-buttons">
- <button type="submit" class="button button-primary" id="studiou-wcpcm-import-button">
- <?php echo esc_html__('Import Product Categories', 'studiou-wc-product-cat-manage'); ?>
- </button>
- <span class="spinner"></span>
- </div>
- </form>
-
- <div class="studiou-wcpcm-import-results" style="display: none;">
- <h3><?php echo esc_html__('Import Results', 'studiou-wc-product-cat-manage'); ?></h3>
- <pre id="studiou-wcpcm-import-results"></pre>
- </div>
- </div>
-
- <div class="studiou-wcpcm-card studiou-wcpcm-sample-csv">
- <h2><?php echo esc_html__('Sample CSV Format', 'studiou-wc-product-cat-manage'); ?></h2>
-
- <pre>name,url-name,parent-name,description,display-type,visibility,protected-passwords,operation
- "Clothing","clothing","","Top quality clothing","default","public","","A"
- "Men","men","Clothing","Men's clothing","products","public","","A"
- "Women","women","Clothing","Women's clothing","products","protected","password123","A"
- "Kids","kids","Clothing","Kids clothing","products","public","","U"
- "Accessories","accessories","","All accessories","default","public","","D"</pre>
-
- <p>
- <a href="#" id="studiou-wcpcm-download-sample" class="button">
- <?php echo esc_html__('Download Sample CSV', 'studiou-wc-product-cat-manage'); ?>
- </a>
- </p>
- </div>
- </div>
|