瀏覽代碼

Change version of plugin from 1.3.1 to 1.3.2

Dalibor Votruba 8 月之前
父節點
當前提交
efc9088060

+ 31 - 4
studiou-wc-ord-print-statuses/CLAUDE.md

@@ -8,8 +8,35 @@ This is a WordPress plugin that extends WooCommerce functionality to manage prin
 
 **Plugin Details:**
 - Text Domain: `studiou-wc-ord-print-statuses`
-- Current Version: 1.3.1
+- Current Version: 1.3.2
 - Requires: WordPress 5.8+, WooCommerce 3.0+, PHP 7.2+
+- Tested with: WordPress 6.8.3, WooCommerce 10.2.2
+
+## Recent Changes
+
+### Version 1.3.2 (2025-10-18)
+**Bug Fix: Empty prod_var_type column in CSV export**
+
+Fixed an issue where the `prod_var_type` column was always empty in the "Prepare to Printing Export" CSV file.
+
+**Root Cause:**
+The SQL query in `Studiou_DB_Manager::get_orders_for_printing()` was incorrectly using the `wc_product_attributes_lookup` table to retrieve product variation attributes. This table stores product-level attribute data (for parent products), not the specific attribute values for individual variations.
+
+**Solution:**
+Modified the query (lines 55-65 in `includes/class-db-manager.php`) to:
+1. Join with `wp_postmeta` table instead of `wc_product_attributes_lookup`
+2. Look for meta_key = 'attribute_pa_format' which stores the variation's format attribute value
+3. Join with `wp_terms` using the slug field (matching against meta_value) instead of term_id
+
+**Files Changed:**
+- `includes/class-db-manager.php` - Updated LEFT JOIN logic for product_variations_attr and product_variations_name tables
+
+**Impact:**
+The `prod_var_type` column in exported CSV files now correctly displays the Format attribute value (e.g., "A4", "A5") for each product variation.
+
+**Tested On:**
+- WordPress 6.8.3
+- WooCommerce 10.2.2
 
 ## Architecture
 
@@ -52,9 +79,9 @@ The export query in `Studiou_DB_Manager::get_orders_for_printing()` performs a c
 - `wp_wc_orders` (order data)
 - `wp_wc_order_product_lookup` (order products)
 - `wp_posts` (products and variations)
-- `wp_wc_product_attributes_lookup` (product attributes, specifically 'pa_format')
-- `wp_terms` and `wp_term_taxonomy` (product categories)
-- `wp_postmeta` and `wp_posts` (product images)
+- `wp_postmeta` (product variation attributes - specifically 'attribute_pa_format')
+- `wp_terms` and `wp_term_taxonomy` (product categories and variation attribute values)
+- `wp_postmeta` (product images via '_thumbnail_id' meta)
 
 This query extracts: order number, product category, product name, variation name, variation type, image URL, quantity, and customer email.
 

+ 14 - 2
studiou-wc-ord-print-statuses/readme.md

@@ -64,13 +64,25 @@ Two import buttons are added to the orders page:
 
 ## Requirements
 
-- WordPress 5.0 or higher
-- WooCommerce 3.0 or higher
+- WordPress 5.8 or higher (tested up to 6.8.3)
+- WooCommerce 3.0 or higher (tested up to 10.2.2)
+- PHP 7.2 or higher
 
 ## Support
 
 For support, please contact the plugin author at https://www.quadarax.com
 
+## Changelog
+
+### Version 1.3.2 (2025-10-18)
+- **Fixed:** Empty `prod_var_type` column in CSV export when using "Prepare to Printing Export" bulk action
+- **Changed:** Updated database query to correctly retrieve product variation format attribute from `wp_postmeta` table
+- **Impact:** CSV exports now properly display Format attribute values (e.g., A4, A5) for product variations
+- **Tested:** WordPress 6.8.3, WooCommerce 10.2.2
+
+### Version 1.3.1
+- Previous stable version
+
 ## License
 
 This plugin is licensed under the GPL v2 or later.

+ 4 - 1
studiou-wc-ord-print-statuses/studiou-wc-ord-print-statuses.php

@@ -3,9 +3,12 @@
  * Plugin Name: QDR - Studiou WC Order Print Statuses
  * Plugin URI: https://www.quadarax.com/plugins/studiou-wc-ord-print-statuses
  * Description: Adds custom order statuses (wc-to-print, wc-in-print), bulk actions, and status change timestamps to WooCommerce for print orders to third party providers
- * Version: 1.3.1
+ * Version: 1.3.2
  * Requires at least: 5.8
+ * Tested up to: 6.8.3
  * Requires PHP: 7.2
+ * WC requires at least: 3.0
+ * WC tested up to: 10.2.2
  * Author: Dalibor Votruba
  * Author URI: https://www.quadarax.com
  * License: GPL v2 or later