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:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Sweeper\PlatformMiddleware\Services\Mirakl;
|
||||
|
||||
use Mirakl\MMP\Shop\Request\Shipping\GetShippingCarriersRequest;
|
||||
use Sweeper\GuzzleHttpRequest\Response;
|
||||
|
||||
/**
|
||||
* Mirakl - Catch 平台配置相关接口
|
||||
* Created by Sweeper PhpStorm.
|
||||
* Author: Sweeper <wili.lixiang@gmail.com>
|
||||
* DateTime: 2024/2/26 13:16
|
||||
* @Package \Sweeper\PlatformMiddleware\Services\Mirakl\PlatformSetting
|
||||
*/
|
||||
class PlatformSetting extends Request
|
||||
{
|
||||
|
||||
/**
|
||||
* 列出所有承运商信息
|
||||
* Author: Sweeper <wili.lixiang@gmail.com>
|
||||
* DateTime: 2024/2/26 13:17
|
||||
* @param array $params
|
||||
* @return Response
|
||||
*/
|
||||
public function carriers(array $params = []): Response
|
||||
{
|
||||
return $this->execute($this->clientMMP(), new GetShippingCarriersRequest($params));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user