Add SetProductImagesForAllShop Admin API endpoint - #384
Closed
PrestaEdit wants to merge 1 commit into
Closed
PrestaEdit wants to merge 1 commit into
PrestaEdit wants to merge 1 commit into
Conversation
Adds PUT /products/{productId}/image-shop-associations using CQRSUpdate
with SetProductImagesForAllShopCommand. Body: {productImageSettings:
[{productImageId, shopIds[]}, ...]} — mirrors the ProductImageSetting VO
shape. Each entry maps an image to a set of shops the image should
belong to; images not listed are detached from all shops.
Depends on PrestaShop/PrestaShop#42049 which adds a bulk
setProductImageSettings() to the command. Without that setter the
Symfony denormalizer can't bind the request-body array (only the
per-item addProductSetting() adder is exposed).
Related to PrestaShop/PrestaShop#39630
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tleon
approved these changes
Jul 29, 2026
Contributor
|
Closing in favor of #410, which centralizes all the pending Product-domain endpoints into a single PR: mutualizing the changes makes the review simpler, and it allowed rebuilding the integration tests so that every fixture is created through the API alone (with whole-structure assertions). @PrestaEdit your work is kept and you are co-authored on the commits of #410 — thanks! Note: in #410 the operation becomes PUT /products/{productId}/shop-images, sharing its URI and resource with the read side, and it no longer depends on PrestaShop/PrestaShop#42049: the command is built by a dedicated module denormalizer, so the endpoint works on every supported core version. |
jolelievre
added a commit
to jolelievre/ps_apiresources
that referenced
this pull request
Aug 13, 2026
Centralizes the pending Product-domain endpoint PRs into a single branch, as requested in PrestaShop/PrestaShop#42054 (tracking table: PrestaShop/PrestaShop#39630). Original content authored by PrestaEdit: - PrestaShop#337 GET product attribute groups - PrestaShop#353 GET product supplier options - PrestaShop#354 GET shop product images - PrestaShop#361 GET product stock movements - PrestaShop#374 GET free gift candidates - PrestaShop#383 POST/PATCH virtual product file - PrestaShop#384 PUT product image shop associations - PrestaShop#256 PUT product stock - PrestaShop#268 product suppliers (associate, default, remove all) - PrestaShop#269 PATCH product supplier details - PrestaShop#308 DELETE virtual product file (resource only; its test file collides with PrestaShop#383's and the tests are rewritten in this PR) Endpoints are imported as-is; consolidation, review fixes and test rewrites follow in dedicated commits. Co-Authored-By: Jonathan Danse <j.danse@prestaedit.com>
jolelievre
added a commit
to jolelievre/ps_apiresources
that referenced
this pull request
Sep 15, 2026
Centralizes the pending Product-domain endpoint PRs into a single branch, as requested in PrestaShop/PrestaShop#42054 (tracking table: PrestaShop/PrestaShop#39630). Original content authored by PrestaEdit: - PrestaShop#337 GET product attribute groups - PrestaShop#353 GET product supplier options - PrestaShop#354 GET shop product images - PrestaShop#361 GET product stock movements - PrestaShop#374 GET free gift candidates - PrestaShop#383 POST/PATCH virtual product file - PrestaShop#384 PUT product image shop associations - PrestaShop#256 PUT product stock - PrestaShop#268 product suppliers (associate, default, remove all) - PrestaShop#269 PATCH product supplier details - PrestaShop#308 DELETE virtual product file (resource only; its test file collides with PrestaShop#383's and the tests are rewritten in this PR) Endpoints are imported as-is; consolidation, review fixes and test rewrites follow in dedicated commits. Co-Authored-By: Jonathan Danse <j.danse@prestaedit.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PUT /products/{productId}/image-shop-associationsusingCQRSUpdatewithSetProductImagesForAllShopCommand. Body:{productImageSettings: [{productImageId, shopIds[]}, ...]}— mirrors theProductImageSettingVO shape. Each entry maps an image to a set of shops the image should belong to; images not listed are detached from all shops.setProductImageSettings(array)bulk setter to the command. Today only the per-itemaddProductSetting()adder exists, which Symfony's serializer can't drive from a JSON body. After #42049 lands the endpoint will start denormalizing correctly.