Skip to main content

Type Alias: GetProductCarouselImages

GetProductCarouselImages = (viewIds, configurationCode?, backgroundColor?) => Promise<CarouselItem[]>

Function

Retrieves a list of images for the product's carousel views.

This method fetches images for all available views of the current product configuration, optimized for display in a carousel or gallery interface. It can generate images based on a specific configuration code and with custom background colors.

The returned carousel items include both 2D rendered views and a marker for the 3D view, allowing for comprehensive product visualization in custom interfaces.

Parameters​

viewIds​

string[]

Array of view IDs to include in the carousel

configurationCode?​

string

Optional specific configuration code to visualize (uses default configuration if not provided)

backgroundColor?​

string

Optional background color for the images (uses theme default if not provided)

Returns​

Promise<CarouselItem[]>

A promise resolving to an array of carousel items, each containing a viewId and image URL

Example​

// Get images for all available views with default settings
const productViews = await window.mimeeqApp.actions.getProductCarouselImages(
['front', 'side', 'top', '3d'], // Available view IDs
);

// Display the images in a custom carousel
productViews.forEach(view => {
if (view.viewId === '3d') {
// Show 3D view button
carousel.appendChild(create3DViewButton());
} else {
// Add image to carousel
const img = document.createElement('img');
img.src = view.image;
img.dataset.viewId = view.viewId;
carousel.appendChild(img);
}
});