A variant images plugin for Medusa V2.
To use this plugin, you need to have the minimum versions of the following dependencies:
"@medusajs/admin-sdk": "^2.8.2","@medusajs/cli": "^2.8.2","@medusajs/framework": "^2.8.2","@medusajs/icons": "^2.8.2","@medusajs/js-sdk": "^2.8.2","@medusajs/medusa": "^2.8.2",
plugins: [{resolve: ' @meduline/medusa-plugin-variant-images',options: {},},],
fields: "+metadata";// Examplesdk.client.fetch(`/store/products`, {query: {fields: "{other fields},+metadata", // <-- ADD +metadata HERE},});
Once you have done all of the above, you will be able to access the variant images from each product variant's metadata.
type Images = {url: string;};// Exampleconst thumbnail: string | null | undefined = variant.metadata.thumbnail;const images: Images[] | undefined = variant.metadata?.images;
See a bug? Please raise an issue on the GitHub repository.
Want something to change? Feel free to clone the repository and open a PR once you have added your feature, or please open a feature request.
This plugin has been forked from https://github.com/Betanoir/medusa-variant-images to work with Medusa 2.10.1 and above.