Skip to content

Conversation

fPolic
Copy link
Contributor

@fPolic fPolic commented Sep 29, 2025

What

This PR introduces the ability to associate product images with specific product variants, enabling more granular image management for products with multiple variants.

Scoped Image Management: Images can now be associated with specific variants instead of being global to the product
Bulk Operations: Batch add/remove variant associations for efficient management


API Changes

  • POST /admin/products/:id/variants/:variant_id/images/batch - Batch manage image associations for a variant
  • POST /admin/products/:id/images/:image_id/variants/batch - Batch manage variant associations for an image

Product Module Changes

  1. Data model:
  • ProductVariant model now includes images many-to-many relationship
  • ProductImage model now includes variants many-to-many relationship
  • ProductVariantProductImage pivot entity for managing associations
  • ProductVariant now has thumbnail
  1. Service methods:
  • addImageToVariant() - Associate images with specific variants
  • removeImageFromVariant() - Remove image-variant associations
  • getVariantImages() - Retrieve images for variants - (general product images + variant specific images)

Core Flows Changes

  • variant thumbnail will be used for the line item thumbnail if exists

CLOSES CORE-1214
CLOSES CORE-1215
CLOSES CORE-1216


Related PRs:

Copy link

vercel bot commented Sep 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
api-reference Building Building Preview Comment Oct 14, 2025 1:34pm
7 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
api-reference-v2 Ignored Ignored Preview Oct 14, 2025 1:34pm
cloud-docs Ignored Ignored Preview Oct 14, 2025 1:34pm
docs-ui Ignored Ignored Preview Oct 14, 2025 1:34pm
docs-v2 Ignored Ignored Preview Oct 14, 2025 1:34pm
medusa-docs Ignored Ignored Preview Oct 14, 2025 1:34pm
resources-docs Ignored Ignored Preview Oct 14, 2025 1:34pm
user-guide Ignored Ignored Preview Oct 14, 2025 1:34pm

Copy link

changeset-bot bot commented Sep 29, 2025

⚠️ No Changeset found

Latest commit: 57fd253

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fPolic fPolic changed the title wip(product): variant images feat(core-flows,product,types): variant images Oct 2, 2025
@fPolic fPolic changed the title feat(core-flows,product,types): variant images feat(core-flows,product,types): scoped variant images Oct 2, 2025
@fPolic fPolic marked this pull request as ready for review October 8, 2025 17:28
@fPolic fPolic requested a review from a team as a code owner October 8, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants