Revision 2dccaf7a
Von Cem Aydin vor 2 Monaten hinzugefügt
- ID 2dccaf7abd69c210031a9d84a33c9980172754ea
- Vorgänger de68b5b2
SL/ShopConnector/Shopware6.pm | ||
---|---|---|
374 | 374 |
|
375 | 375 |
# 2.1 no image with this title, create metadata for media and upload image |
376 | 376 |
if (!$current_image_id) { |
377 |
# get media folder id |
|
378 |
$ret = $self->connector->GET('api/media-folder'); |
|
379 |
$response_code = $ret->responseCode(); |
|
380 |
die "Request failed, response code was: $response_code\n" . $ret->responseContent() unless $response_code == 200; |
|
381 |
my $media_folder_id; |
|
382 |
try { |
|
383 |
$media_folder_id = from_json($ret->responseContent())->{data}->[0]->{id}; |
|
384 |
} catch { die "Malformed JSON Data: $_ " . $ret->responseContent(); }; |
|
385 |
|
|
377 | 386 |
# not yet uploaded, create media entry |
378 |
$ret = $self->connector->POST("/api/media?_response=true"); |
|
387 |
$ret = $self->connector->POST("/api/media?_response=true", to_json({"mediaFolderId" => $media_folder_id}));
|
|
379 | 388 |
$response_code = $ret->responseCode(); |
380 | 389 |
die "Request failed, response code was: $response_code\n" . $ret->responseContent() unless $response_code == 200; |
381 | 390 |
try { |
Auch abrufbar als: Unified diff
FIX: shopware6 connector: Bilder Upload für Shopware >= v6.6 Beheben
Siehe auch:
https://forum.shopware.com/t/produkt-bilder-uber-api-hochladen/60780/5
Behebt: Fehler #686