| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- /**
- * Product Import page view
- *
- * @since 1.4.0
- * @package Studiou_WC_Product_Cat_Manage
- * @subpackage Studiou_WC_Product_Cat_Manage/views
- */
- // If this file is called directly, abort.
- if (!defined('WPINC')) {
- die;
- }
- ?>
- <div class="wrap studiou-wcpcm-wrap">
- <h1><?php echo esc_html(__('Product Import', 'studiou-wc-product-cat-manage')); ?></h1>
- <!-- Notice Area -->
- <div class="studiou-wcpcm-notice-area"></div>
- <!-- Import Form -->
- <div class="studiou-wcpcm-card">
- <h2><?php _e('Import Products from CSV', 'studiou-wc-product-cat-manage'); ?></h2>
- <p><?php _e('Upload a CSV file to import products. The CSV file must follow the required format with the following columns:', 'studiou-wc-product-cat-manage'); ?></p>
- <ul>
- <li><strong>ID</strong> - <?php _e('Product ID (0 for new products)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Typ</strong> - <?php _e('Product type (only "variable" or "variation" allowed)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Katalogové číslo</strong> - <?php _e('SKU (must be unique)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Jméno</strong> - <?php _e('Product name', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Nadřazené</strong> - <?php _e('Parent product SKU (for variations only)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Krátký popis</strong> - <?php _e('Short description', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Popis</strong> - <?php _e('Description', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Název 1 vlastnosti</strong> - <?php _e('Attribute 1 name', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Hodnota(y) 1 vlastnosti</strong> - <?php _e('Attribute 1 value(s) (pipe-separated)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Kategorie</strong> - <?php _e('Categories (pipe-separated)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Obrázky</strong> - <?php _e('Image URL (must be valid)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Běžná cena</strong> - <?php _e('Regular price (required for variations)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Vlastnost 1 viditelnost</strong> - <?php _e('Attribute 1 visibility (1 or 0)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Vlastnost 1 globální</strong> - <?php _e('Attribute 1 global (1 or 0)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Vlastnost 1 varianta</strong> - <?php _e('Attribute 1 used for variations (1 or 0)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Povolit zákaznické recenze?</strong> - <?php _e('Enable reviews (1 or 0)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Minimum Quantity</strong> - <?php _e('Minimum order quantity', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong>Maximum Quantity</strong> - <?php _e('Maximum order quantity', 'studiou-wc-product-cat-manage'); ?></li>
- </ul>
- <form id="studiou-wcpcm-product-import-form" method="post" enctype="multipart/form-data">
- <div class="form-field">
- <label for="import_file"><?php _e('Select Import File', 'studiou-wc-product-cat-manage'); ?></label>
- <input type="file" id="import_file" name="import_file" accept=".csv" required />
- <p class="description"><?php _e('Select a CSV file to import (UTF-8 encoding)', 'studiou-wc-product-cat-manage'); ?></p>
- </div>
- <div class="submit-buttons">
- <button type="submit" id="studiou-wcpcm-product-import-button" class="button button-primary">
- <?php _e('Process Import File', 'studiou-wc-product-cat-manage'); ?>
- </button>
- <span class="spinner"></span>
- </div>
- </form>
- <!-- Progress bar -->
- <div class="studiou-wcpcm-product-import-progress" style="display: none;">
- <h3><?php _e('Import Progress', 'studiou-wc-product-cat-manage'); ?></h3>
- <div class="studiou-wcpcm-progress-bar-container">
- <div id="studiou-wcpcm-product-import-progress-bar" class="studiou-wcpcm-progress-bar" style="width: 0%;" data-progress="0%"></div>
- </div>
- <div id="studiou-wcpcm-product-import-progress-text" class="studiou-wcpcm-progress-text">
- <?php _e('Initializing...', 'studiou-wc-product-cat-manage'); ?>
- </div>
- </div>
- <!-- Import Results -->
- <div class="studiou-wcpcm-product-import-results" style="display: none;">
- <h3><?php _e('Import Results', 'studiou-wc-product-cat-manage'); ?></h3>
- <div id="studiou-wcpcm-product-import-message"></div>
- <div id="studiou-wcpcm-product-import-details" style="margin-top: 20px;">
- <h4><?php _e('Import Details', 'studiou-wc-product-cat-manage'); ?></h4>
- <div id="studiou-wcpcm-product-import-details-content"></div>
- </div>
- </div>
- <!-- Save Failed Products Button -->
- <div class="studiou-wcpcm-product-import-failed" style="display: none; margin-top: 20px;">
- <button id="studiou-wcpcm-save-failed-products" class="button button-secondary">
- <?php _e('Save Failed Products', 'studiou-wc-product-cat-manage'); ?>
- </button>
- <p class="description"><?php _e('Download a CSV file with failed products to fix and re-import', 'studiou-wc-product-cat-manage'); ?></p>
- </div>
- </div>
- <!-- Import Rules -->
- <div class="studiou-wcpcm-card">
- <h2><?php _e('Import Rules', 'studiou-wc-product-cat-manage'); ?></h2>
- <ul>
- <li><strong><?php _e('Rule 1:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('All operations are performed via WooCommerce API (not direct SQL)', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong><?php _e('Rule 2:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('If ID = 0, item will be created; otherwise updated', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong><?php _e('Rule 3:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('Only "variable" or "variation" types are allowed', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong><?php _e('Rule 4:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('SKU (Katalogové číslo) must be unique', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong><?php _e('Rule 5:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('Image URL must be valid and accessible', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong><?php _e('Rule 6:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('Parent reference (Nadřazené) must point to an existing variable product SKU', 'studiou-wc-product-cat-manage'); ?></li>
- <li><strong><?php _e('Rule 7:', 'studiou-wc-product-cat-manage'); ?></strong> <?php _e('Variations must have a regular price (Běžná cena)', 'studiou-wc-product-cat-manage'); ?></li>
- </ul>
- </div>
- </div>
|