|
|
@@ -28,15 +28,24 @@ Modified the query (lines 55-65 in `includes/class-db-manager.php`) to:
|
|
|
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
|
|
|
|
|
|
+**HPOS Compatibility Declaration**
|
|
|
+
|
|
|
+Added explicit HPOS (High-Performance Order Storage) compatibility declaration to prevent WooCommerce warnings.
|
|
|
+
|
|
|
+**Solution:**
|
|
|
+Added `before_woocommerce_init` hook in the main plugin file to declare compatibility with WooCommerce custom order tables using `FeaturesUtil::declare_compatibility()`.
|
|
|
+
|
|
|
**Files Changed:**
|
|
|
- `includes/class-db-manager.php` - Updated LEFT JOIN logic for product_variations_attr and product_variations_name tables
|
|
|
+- `studiou-wc-ord-print-statuses.php` - Added HPOS compatibility declaration
|
|
|
|
|
|
**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.
|
|
|
+- The `prod_var_type` column in exported CSV files now correctly displays the Format attribute value (e.g., "A4", "A5") for each product variation
|
|
|
+- Plugin no longer shows HPOS incompatibility warnings in WooCommerce
|
|
|
|
|
|
**Tested On:**
|
|
|
- WordPress 6.8.3
|
|
|
-- WooCommerce 10.2.2
|
|
|
+- WooCommerce 10.2.2 (with HPOS enabled)
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
@@ -138,7 +147,11 @@ The plugin supports internationalization:
|
|
|
|
|
|
## Important Considerations
|
|
|
|
|
|
-1. **HPOS Compatibility**: The plugin uses `woocommerce_page_wc-orders` hooks, indicating support for WooCommerce High-Performance Order Storage (HPOS)
|
|
|
+1. **HPOS Compatibility**: The plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS)
|
|
|
+ - Uses `woocommerce_page_wc-orders` hooks for HPOS compatibility
|
|
|
+ - Uses `{$wpdb->prefix}wc_orders` table (HPOS custom table) in SQL queries
|
|
|
+ - Uses `wc_get_order()` which works with both HPOS and legacy systems
|
|
|
+ - Declares compatibility via `FeaturesUtil::declare_compatibility('custom_order_tables', ...)`
|
|
|
|
|
|
2. **Status Slug Naming**: Custom statuses use `wc-` prefix internally but display without prefix (`wc-to-print` vs "Prepare to Printing")
|
|
|
|