=== Product Bulk Editor for WooCommerce ===
Donate link: https://buymeacoffee.com/maurosparvt
Tags: woocommerce, bulk edit, products, inventory, spreadsheet
Requires at least: 5.4
Requires PHP: 7.3
Tested up to: 7.0
Stable tag: 1.12.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Bulk edit WooCommerce products quickly with inline editing, AJAX updates, undo/redo, and more — all from a simple, fast, and intuitive interface.

== Description ==

Effortlessly create and update nearly all WooCommerce product data in one intuitive interface with this powerful bulk product editor.

Save valuable time and resources by editing multiple products at once using AJAX-powered updates — no page reloads required. Whether you need to change prices, names, stock quantities, or categories, everything is right at your fingertips.

Create or update ATUM purchase orders if you have ATUM Inventory Management plugin installed

Key Features:

💡 Inline Editing – Update product fields directly in a spreadsheet-like layout.

🧩 Product Type Support – Works with simple, variable, external, and grouped products.

🔍 Product Filters – Quickly filter products to work only on what you need.

🔁 Undo & Redo – Instantly reverse or reapply changes with smart history tracking.

🔢 Math Operations – Perform calculations on numeric fields like prices and stock.

💬 String Operations – Modify text values with replace, prepend, or append actions.

🧩 Toggle Columns – Customize your view by showing or hiding only the columns you need.

↔️ Resizable Columns – Drag to resize columns for better visibility.

🎨 Visual Feedback – Instantly see which fields were modified with intuitive color cues.

🏷️ Manage Categories & Tags – Create or remove them without leaving the editor.

🧹 Trash, Delete & Duplicate – Perform common actions in bulk with ease.

🖨️ Print Product Tags - Easily print product tags in different sizes and formats

🛠️ Hooks for Developers – Extend and personalize the editor with your own custom columns or logic.

🫂 Integrations - ATUM Inventory Management and WooCommerce Cost of Goods

The plugin is designed for productivity and simplicity, making it the perfect companion for any store owner or manager who needs to manage large product catalogs effortlessly.

== Installation ==

1. Upload `mds-product-bulk-editor.php` to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress

== Frequently Asked Questions ==

= How do I add a column to manage a metadata field? =

function mdspbe_product_attributes( $attributes ) {

    $new_attributes = [
        'print_section' => [
            'id' => 'print_section', 
            'name' => esc_html( 'Print section', 'mds-pos' ),
            'allow_edit' => true,
            'is_meta' => true, // We tell the plugin is a meta column
            'meta_key' => '_printing_section',
            'type' => 'select', 
            'options' => get_option( 'mds_printing_sections', [] ),
            'edit_options' => [ // This is for dropdown lists (html5 or tom-select) so options can be added or removed from the same plugin page
                'add' => [
                    'callback' => 'mds_add_print_section', // Replace with the function that will create the option
                    'fields' => [ // Fields that you want to render and collect info in the form
                        'name' => [
                            'type' => 'input_text',
                            'name' => 'name',
                            'label' => esc_html__( 'Name', 'mds-pos' ),
                            'required' => true,
                            'sanitize' => 'sanitize_text_field',
                        ],
                    ]
                ],
                'remove' => [ // Replace with the function that will remove the options
                    'callback' => 'mds_remove_print_sections',
                ]
            ],
            'required' => true,
            'allowed_types' => ['simple', 'variable'],
        ],  
    ];
    
    $attributes = array_merge( $attributes, $new_attributes );

    return $attributes;
}

add_filter( 'mdspbe_product_attributes', 'mdspbe_product_attributes' );


== Screenshots ==

1. 
2. 

== Changelog ==

= 1.12.0 =
* Added: option to manage trashed products
* Fixed: load WP media and WP editor scripts properly

= 1.11.1 =
* Updated: show "no attributes" notice when user clicks on "More filters" if there are no global attributes

= 1.11.0 =
* Added: global attribute compatibility

= 1.10.2 = 
* Added: compatibility check up to WP 6.9
* Added: search products by SKU and ATUM supplier SKU

= 1.10.1 =
* Fixed: error when displaying fields with quotation marks " as value

= 1.10.0 =
* Added: option to filter products by its catalog visibility

= 1.9.3 = 
* Fixed: Tom multiple select not working well where the selected values were not numeric

= 1.9.2 =
* Fixed: some bulk actions where not working

= 1.9.1 =
* Fixed: some fields where disabled, when they should not, for new product rows

= 1.9.0 =
* Removed: filter for ATUM Purchase Order list, as ATUM fixed the REST API issue
* Updated: clear value when disabling elements because of a not met condition (ie. stock quantity when manage stock is off)

= 1.8.3 =
* Fixed: JS error when setting product categories and tags to none
* Fixed: JS error when assigning a category or tag to a just-created-and-saved product

= 1.8.2 =
* Fixed: ATUM installation could not be detected in some cases

= 1.8.1 =
* Fixed: some files were missing

= 1.8.0 =
* Fixed: issue when doing bulk action over a just-created product
* Added: compatibility with ATUM purchase orders and suppliers
* Added: hooks to be able to add custom product filters
* Added: descriptions for most product attributes
* Added: enable/disable fields dynamically based on conditions. Ie. stock qty enabled if manage stock is true
* Added: view, edit and add variations hyperlinks added for created products
* Updated: bulk actions and product filter positions

= 1.7.1 =
* Fixed: javascript file was not updated

= 1.7.0 =
* Fixed: pass the attribute 'edit' to the get methods. It was defaulting to 'view' before
* Added: Import and Export options

= 1.6.0 =
* Added: group product attributes. Ie. "stock status", "manage stock" and "stock quantity"

= 1.5.0 =
* Fixed: step html attribute was not working on type number inputs
* Fixed: "cost of goods" translation
* Updated: support for different meta keys depending on the product type in the product attributes
* Updated: cost of goods and cost of goods (variable) columns, where merged into a single column

= 1.4.1 =
* Fixed: Cost of goods (variable) attribute was not showing for variations

= 1.4.0 =
* Added: WC Cost of Goods plugin compatibility

= 1.3.0 =
* Updated: required user role capabilities for different actions
* Removed: users could select a product by clicking anywhere on the product row. That was confusing and leading to errors

= 1.2.0 =
* Added: search by global unique id
* Updated: default product per page increased to 50

= 1.1.6 =
* Fixed: false values could not be saved

= 1.1.5 =
* Fixed: integer values could not be saved due to an error in mdspbe_intval() function 

= 1.1.4 =
* Fixed: styles were not loading in About page
* Fixed: stock quantity field could not be set to '', it was saving 0 instead
* Updated: improved table header stickiness
* Updated: improved table style

= 1.1.3 =
* Fixed: some html content was not hidden on the main page load

= 1.1.2 =
* Fixed: error when loading the plugin

= 1.1.1 =
* Fixed: page selector were not showing if not filters were applied

= 1.1.0 =
* Fixed: remove console.log() left by mistake
* Fixed: '' was saved as '0' in numeric fields
* Fixed: add Global Unique ID field to variations
* Added: create product tags
* Updated: change prefix in some functions and hooks

= 1.0.0 =
* First plugin release
