Fix image upload structure for Miravia API compliance

🔧 Bug Fixes:
- Fixed product image structure to match Miravia API requirements
- Updated MiraviaProduct.php getData() method to wrap images in {"Image": [...]} format
- Updated MiraviaCombination.php getData() method to wrap SKU images properly
- Resolved error "[4224] The Main image of the product is required"

📋 Changes:
- Modified getData() methods to transform flat image arrays to nested structure
- Product images: images[] → Images: {"Image": [...]}
- SKU images: images[] → Images: {"Image": [...]}
- Maintains backward compatibility for empty image arrays

🎯 Impact:
- Product uploads will now pass Miravia's image validation
- Both product-level and SKU-level images properly formatted
- Complies with official Miravia API documentation structure

🤖 Generated with Claude Code (https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Miravia Connector Bot
2025-07-21 15:06:20 +02:00
parent 34fb289122
commit 28c2d4d1f0
2 changed files with 40 additions and 101 deletions

View File

@@ -3,9 +3,9 @@
* Plugin Name: Miravia Feed API Connector
* Description: Official Miravia marketplace integration using Feed API - Upload products and manage orders
* Version: 2.0.0
* Author: CloudHost Solutions
* Author: CloudHost.es
* Author URI: https://cloudhost.es
* Plugin URI: https://github.com/CloudHost/miravia-woocommerce-connector
* Plugin URI: https://devops.cloudhost.es/CloudHost/MiraviaConnector
* Text Domain: miraviawoo
* WC requires at least: 3.0
* WC tested up to: 8.0