|
@@ -1,6 +1,11 @@
|
|
|
<?php
|
|
<?php
|
|
|
/**
|
|
/**
|
|
|
- * Category Manipulations page view
|
|
|
|
|
|
|
+ * Category Manipulations page view (shell)
|
|
|
|
|
+ *
|
|
|
|
|
+ * Renders only the tab bar and an empty content container. Each tab's
|
|
|
|
|
+ * markup and its (potentially expensive) data is fetched on demand via the
|
|
|
|
|
+ * studiou_wcpcm_load_tab AJAX handler. This keeps the page-load request
|
|
|
|
|
+ * lightweight and avoids PHP timeouts on large stores.
|
|
|
*
|
|
*
|
|
|
* @since 1.0.0
|
|
* @since 1.0.0
|
|
|
* @package Studiou_WC_Product_Cat_Manage
|
|
* @package Studiou_WC_Product_Cat_Manage
|
|
@@ -11,397 +16,37 @@ if (!defined('WPINC')) {
|
|
|
die;
|
|
die;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Get categories with counts for select boxes
|
|
|
|
|
-$manipulator = new Studiou_WC_Product_Cat_Manage_Manipulator(new Studiou_WC_Product_Cat_Manage_DB());
|
|
|
|
|
-$categories = $manipulator->get_categories_with_counts();
|
|
|
|
|
-$media_categories = $manipulator->get_media_categories_with_counts();
|
|
|
|
|
-$unassigned_media_count = $manipulator->get_unassigned_unused_media_count();
|
|
|
|
|
|
|
+$tabs = array(
|
|
|
|
|
+ 'move' => __('Move products between categories', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+ 'batch-description' => __('Batch description between categories', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+ 'delete-products' => __('Delete products in category', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+ 'clear-media' => __('Clear Media Categories', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+ 'remove-unassigned' => __('Remove Not Assigned Media', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+ 'upvp' => __('Update product variant prices', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+ 'notes' => __('Important Notes', 'studiou-wc-product-cat-manage'),
|
|
|
|
|
+);
|
|
|
?>
|
|
?>
|
|
|
|
|
|
|
|
<div class="wrap studiou-wcpcm-wrap">
|
|
<div class="wrap studiou-wcpcm-wrap">
|
|
|
<h1><?php echo esc_html__('Category Manipulations', 'studiou-wc-product-cat-manage'); ?></h1>
|
|
<h1><?php echo esc_html__('Category Manipulations', 'studiou-wc-product-cat-manage'); ?></h1>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<div class="studiou-wcpcm-notice-area">
|
|
<div class="studiou-wcpcm-notice-area">
|
|
|
<!-- Area for displaying notices -->
|
|
<!-- Area for displaying notices -->
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <!-- Move Products Between Categories Operation -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Move products between categories', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
- <p><?php echo esc_html__('This operation allows you to move all products from one category to another. Products will be removed from the source category and added to the target category.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
-
|
|
|
|
|
- <form id="studiou-wcpcm-move-form" method="post">
|
|
|
|
|
- <table class="form-table">
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="source_category"><?php echo esc_html__('Source Category', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <select name="source_category" id="source_category" class="regular-text" required>
|
|
|
|
|
- <option value=""><?php echo esc_html__('-- Select Source Category --', 'studiou-wc-product-cat-manage'); ?></option>
|
|
|
|
|
- <?php foreach ($categories as $category): ?>
|
|
|
|
|
- <option value="<?php echo esc_attr($category['id']); ?>">
|
|
|
|
|
- <?php echo esc_html($category['display_name']); ?>
|
|
|
|
|
- </option>
|
|
|
|
|
- <?php endforeach; ?>
|
|
|
|
|
- </select>
|
|
|
|
|
- <p class="description"><?php echo esc_html__('Select the category from which products will be moved.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="target_category"><?php echo esc_html__('Target Category', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <select name="target_category" id="target_category" class="regular-text" required>
|
|
|
|
|
- <option value=""><?php echo esc_html__('-- Select Target Category --', 'studiou-wc-product-cat-manage'); ?></option>
|
|
|
|
|
- <?php foreach ($categories as $category): ?>
|
|
|
|
|
- <option value="<?php echo esc_attr($category['id']); ?>">
|
|
|
|
|
- <?php echo esc_html($category['display_name']); ?>
|
|
|
|
|
- </option>
|
|
|
|
|
- <?php endforeach; ?>
|
|
|
|
|
- </select>
|
|
|
|
|
- <p class="description"><?php echo esc_html__('Select the category to which products will be moved.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </table>
|
|
|
|
|
-
|
|
|
|
|
- <div class="submit-buttons">
|
|
|
|
|
- <button type="submit" class="button button-primary" id="studiou-wcpcm-move-button">
|
|
|
|
|
- <?php echo esc_html__('Do', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <span class="spinner"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-move-results" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Move Results', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div id="studiou-wcpcm-move-message"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- Batch Description Between Categories Operation -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Batch description between categories', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
- <p><?php echo esc_html__('This operation allows you to set the same description for multiple categories at once.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
-
|
|
|
|
|
- <form id="studiou-wcpcm-batch-description-form" method="post">
|
|
|
|
|
- <table class="form-table">
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="categories_list"><?php echo esc_html__('Select Categories', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list-container">
|
|
|
|
|
- <div class="studiou-wcpcm-list-actions">
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-check-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Check All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-uncheck-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Uncheck All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list" id="categories_list">
|
|
|
|
|
- <?php foreach ($categories as $category): ?>
|
|
|
|
|
- <label class="studiou-wcpcm-category-item">
|
|
|
|
|
- <input type="checkbox" name="selected_categories[]" value="<?php echo esc_attr($category['id']); ?>">
|
|
|
|
|
- <span><?php echo esc_html($category['display_name']); ?></span>
|
|
|
|
|
- </label>
|
|
|
|
|
- <?php endforeach; ?>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <p class="description"><?php echo esc_html__('Select the categories for which you want to set the description.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="category_description"><?php echo esc_html__('Product categories description', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <textarea name="category_description" id="category_description" rows="5" cols="50" class="large-text"></textarea>
|
|
|
|
|
- <p class="description"><?php echo esc_html__('Enter the description that will be applied to all selected categories.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </table>
|
|
|
|
|
-
|
|
|
|
|
- <div class="submit-buttons">
|
|
|
|
|
- <button type="submit" class="button button-primary" id="studiou-wcpcm-batch-description-button">
|
|
|
|
|
- <?php echo esc_html__('Do', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <span class="spinner"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-batch-description-results" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Batch Description Results', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div id="studiou-wcpcm-batch-description-message"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- Delete Products in Category Operation -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Delete products in category', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
- <p><?php echo esc_html__('This operation allows you to permanently delete all products and their variants from selected categories. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
-
|
|
|
|
|
- <form id="studiou-wcpcm-delete-products-form" method="post">
|
|
|
|
|
- <table class="form-table">
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="delete_categories_list"><?php echo esc_html__('Select Categories', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list-container">
|
|
|
|
|
- <div class="studiou-wcpcm-list-actions">
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-delete-check-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Check All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-delete-uncheck-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Uncheck All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list" id="delete_categories_list">
|
|
|
|
|
- <?php foreach ($categories as $category): ?>
|
|
|
|
|
- <label class="studiou-wcpcm-category-item">
|
|
|
|
|
- <input type="checkbox" name="delete_categories[]" value="<?php echo esc_attr($category['id']); ?>">
|
|
|
|
|
- <span><?php echo esc_html($category['display_name']); ?></span>
|
|
|
|
|
- </label>
|
|
|
|
|
- <?php endforeach; ?>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <p class="description"><?php echo esc_html__('Select the categories from which all products will be permanently deleted.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </table>
|
|
|
|
|
|
|
|
|
|
- <div class="studiou-wcpcm-warning-message">
|
|
|
|
|
- <p><strong><?php echo esc_html__('WARNING: This operation will permanently delete all products (including variants) in the selected categories. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></strong></p>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <h2 class="nav-tab-wrapper studiou-wcpcm-tabs">
|
|
|
|
|
+ <?php foreach ($tabs as $slug => $label): ?>
|
|
|
|
|
+ <a href="#<?php echo esc_attr($slug); ?>"
|
|
|
|
|
+ class="nav-tab"
|
|
|
|
|
+ data-tab="<?php echo esc_attr($slug); ?>">
|
|
|
|
|
+ <?php echo esc_html($label); ?>
|
|
|
|
|
+ </a>
|
|
|
|
|
+ <?php endforeach; ?>
|
|
|
|
|
+ </h2>
|
|
|
|
|
|
|
|
- <div class="submit-buttons">
|
|
|
|
|
- <button type="submit" class="button button-primary button-danger" id="studiou-wcpcm-delete-products-button">
|
|
|
|
|
- <?php echo esc_html__('Delete', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <span class="spinner"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-delete-progress" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Deletion Progress', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div class="studiou-wcpcm-progress-bar-container">
|
|
|
|
|
- <div class="studiou-wcpcm-progress-bar" id="studiou-wcpcm-delete-progress-bar"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-progress-text" id="studiou-wcpcm-delete-progress-text"></div>
|
|
|
|
|
|
|
+ <div id="studiou-wcpcm-tab-content" class="studiou-wcpcm-tab-content">
|
|
|
|
|
+ <div class="studiou-wcpcm-tab-loading">
|
|
|
|
|
+ <?php echo esc_html__('Loading...', 'studiou-wc-product-cat-manage'); ?>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-delete-results" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Deletion Results', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div id="studiou-wcpcm-delete-message"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- Clear Media Categories Operation -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Clear Media Categories', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
- <p><?php echo esc_html__('This operation allows you to permanently delete all media files from selected media categories. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
-
|
|
|
|
|
- <?php if (empty($media_categories)): ?>
|
|
|
|
|
- <p><em><?php echo esc_html__('No media categories found. Please install a media category plugin (e.g., Media Library Categories) to use this feature.', 'studiou-wc-product-cat-manage'); ?></em></p>
|
|
|
|
|
- <?php else: ?>
|
|
|
|
|
- <form id="studiou-wcpcm-clear-media-form" method="post" onsubmit="return false;">
|
|
|
|
|
- <table class="form-table">
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="clear_media_categories_list"><?php echo esc_html__('Select Media Categories', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list-container">
|
|
|
|
|
- <div class="studiou-wcpcm-list-actions">
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-clear-media-check-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Check All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-clear-media-uncheck-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Uncheck All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list" id="clear_media_categories_list">
|
|
|
|
|
- <?php foreach ($media_categories as $category): ?>
|
|
|
|
|
- <label class="studiou-wcpcm-category-item">
|
|
|
|
|
- <input type="checkbox" name="media_categories[]" value="<?php echo esc_attr($category['id']); ?>">
|
|
|
|
|
- <span><?php echo esc_html($category['display_name']); ?></span>
|
|
|
|
|
- </label>
|
|
|
|
|
- <?php endforeach; ?>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <p class="description"><?php echo esc_html__('Select the media categories from which all files will be permanently deleted.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </table>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-warning-message">
|
|
|
|
|
- <p><strong><?php echo esc_html__('WARNING: This operation will permanently delete all media files in the selected categories. The files will be removed from the server. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></strong></p>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="submit-buttons">
|
|
|
|
|
- <button type="submit" class="button button-primary button-danger" id="studiou-wcpcm-clear-media-button">
|
|
|
|
|
- <?php echo esc_html__('Delete', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <span class="spinner"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-clear-media-progress" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Deletion Progress', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div class="studiou-wcpcm-progress-bar-container">
|
|
|
|
|
- <div class="studiou-wcpcm-progress-bar" id="studiou-wcpcm-clear-media-progress-bar"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-progress-text" id="studiou-wcpcm-clear-media-progress-text"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-clear-media-results" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Deletion Results', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div id="studiou-wcpcm-clear-media-message"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <?php endif; ?>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- Remove Not Assigned Media Operation -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Remove Not Assigned Media', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
- <p><?php echo esc_html__('This operation permanently deletes all media files that are not assigned to any media category and are not used as featured image, product gallery image, or attached to any post.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
-
|
|
|
|
|
- <form id="studiou-wcpcm-remove-unassigned-media-form" method="post" onsubmit="return false;">
|
|
|
|
|
- <div class="studiou-wcpcm-warning-message">
|
|
|
|
|
- <p><strong><?php echo esc_html__('WARNING: This operation will permanently delete all unused uncategorized media files from the server. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></strong></p>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="submit-buttons">
|
|
|
|
|
- <button type="submit" class="button button-primary button-danger" id="studiou-wcpcm-remove-unassigned-media-button">
|
|
|
|
|
- <?php echo esc_html(sprintf(__('Delete unused uncategorized media (%d)', 'studiou-wc-product-cat-manage'), $unassigned_media_count)); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <span class="spinner"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-remove-unassigned-media-progress" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Deletion Progress', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div class="studiou-wcpcm-progress-bar-container">
|
|
|
|
|
- <div class="studiou-wcpcm-progress-bar" id="studiou-wcpcm-remove-unassigned-media-progress-bar"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-progress-text" id="studiou-wcpcm-remove-unassigned-media-progress-text"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-remove-unassigned-media-results" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Deletion Results', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div id="studiou-wcpcm-remove-unassigned-media-message"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- Update Product Variant Prices Operation -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Update product variant prices', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
-
|
|
|
|
|
- <p><?php echo esc_html__('Bulk-update the regular price of product variations matching the selected categories and a chosen variation attribute. Only product records are modified — existing orders and cart contents are not affected.', 'studiou-wc-product-cat-manage'); ?></p>
|
|
|
|
|
-
|
|
|
|
|
- <form id="studiou-wcpcm-upvp-form" method="post" onsubmit="return false;">
|
|
|
|
|
- <table class="form-table">
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="upvp_categories_list"><?php echo esc_html__('Select Categories', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list-container">
|
|
|
|
|
- <div class="studiou-wcpcm-list-actions">
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-upvp-check-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Check All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-upvp-uncheck-all" class="button">
|
|
|
|
|
- <?php echo esc_html__('Uncheck All', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="studiou-wcpcm-categories-list" id="upvp_categories_list">
|
|
|
|
|
- <?php foreach ($categories as $category): ?>
|
|
|
|
|
- <label class="studiou-wcpcm-category-item">
|
|
|
|
|
- <input type="checkbox" name="upvp_categories[]" value="<?php echo esc_attr($category['id']); ?>">
|
|
|
|
|
- <span><?php echo esc_html($category['display_name']); ?></span>
|
|
|
|
|
- </label>
|
|
|
|
|
- <?php endforeach; ?>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="upvp_attribute"><?php echo esc_html__('Variant attribute', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <select id="upvp_attribute" name="upvp_attribute" class="regular-text">
|
|
|
|
|
- <option value=""><?php echo esc_html__('-- Select attribute --', 'studiou-wc-product-cat-manage'); ?></option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="upvp_attribute_value"><?php echo esc_html__('Variant attribute value', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <select id="upvp_attribute_value" name="upvp_attribute_value" class="regular-text" disabled>
|
|
|
|
|
- <option value=""><?php echo esc_html__('-- Select value --', 'studiou-wc-product-cat-manage'); ?></option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <label for="upvp_new_price"><?php echo esc_html__('New Price', 'studiou-wc-product-cat-manage'); ?></label>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <input type="number" step="0.01" min="0" id="upvp_new_price" name="upvp_new_price" class="regular-text">
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th scope="row">
|
|
|
|
|
- <?php echo esc_html__('Affected variations', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </th>
|
|
|
|
|
- <td>
|
|
|
|
|
- <strong id="studiou-wcpcm-upvp-affected-count">0</strong>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </table>
|
|
|
|
|
-
|
|
|
|
|
- <div class="submit-buttons">
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-upvp-dry-run-button" class="button">
|
|
|
|
|
- <?php echo esc_html__('Dry Run', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" id="studiou-wcpcm-upvp-apply-button" class="button button-primary">
|
|
|
|
|
- <?php echo esc_html__('Apply', 'studiou-wc-product-cat-manage'); ?>
|
|
|
|
|
- </button>
|
|
|
|
|
- <span class="spinner"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </form>
|
|
|
|
|
-
|
|
|
|
|
- <div class="studiou-wcpcm-upvp-results" style="display: none;">
|
|
|
|
|
- <h3><?php echo esc_html__('Results', 'studiou-wc-product-cat-manage'); ?></h3>
|
|
|
|
|
- <div id="studiou-wcpcm-upvp-message"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- Important Notes -->
|
|
|
|
|
- <div class="studiou-wcpcm-card">
|
|
|
|
|
- <h2><?php echo esc_html__('Important Notes', 'studiou-wc-product-cat-manage'); ?></h2>
|
|
|
|
|
- <ul>
|
|
|
|
|
- <li><?php echo esc_html__('Products can be assigned to multiple categories. This operation will remove the product from the source category and add it to the target category.', 'studiou-wc-product-cat-manage'); ?></li>
|
|
|
|
|
- <li><?php echo esc_html__('If a product is only assigned to the source category, it will be moved entirely to the target category.', 'studiou-wc-product-cat-manage'); ?></li>
|
|
|
|
|
- <li><?php echo esc_html__('If a product is assigned to multiple categories including the source category, it will remain in the other categories and be moved to the target category.', 'studiou-wc-product-cat-manage'); ?></li>
|
|
|
|
|
- <li><?php echo esc_html__('The operation processes all products regardless of their status (published, draft, private).', 'studiou-wc-product-cat-manage'); ?></li>
|
|
|
|
|
- <li><?php echo esc_html__('The batch description operation will overwrite the existing descriptions for all selected categories.', 'studiou-wc-product-cat-manage'); ?></li>
|
|
|
|
|
- <li><strong><?php echo esc_html__('The delete products operation will permanently delete all products and variants from the selected categories. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></strong></li>
|
|
|
|
|
- <li><strong><?php echo esc_html__('The clear media categories operation will permanently delete all media files from the selected media categories and remove them from the server. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></strong></li>
|
|
|
|
|
- <li><strong><?php echo esc_html__('The remove not assigned media operation will permanently delete all media files that are not categorized and not used anywhere. This action cannot be undone!', 'studiou-wc-product-cat-manage'); ?></strong></li>
|
|
|
|
|
- <li><?php echo esc_html__('The update product variant prices operation only modifies the regular price of product variations. Order line items, cart contents, and historical order data are never modified.', 'studiou-wc-product-cat-manage'); ?></li>
|
|
|
|
|
- </ul>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
-</div>
|
|
|
|
|
|
|
+</div>
|