createImageMappingForOptions example


                $image = $this->getArticleResource()->createNewArticleImage($article$media);
            } else {
                throw new CustomValidationException("One of the passed variant images doesn't contain a mediaId or link property!");
            }

            $variantImage = $this->createVariantImage(
                $image,
                $variant
            );

            $this->createImageMappingForOptions(
                $variant->getConfiguratorOptions(),
                $image
            );

            $images->add($variantImage);
        }

        $data['images'] = $images;
        $variant->setImages($images);

        return $data;
    }
$property = $option['id'] ?: $option['name'];
                    throw new CustomValidationException(sprintf('Passed option "%s" does not exist in the configurator set of the product', $property));
                }

                $options->add($available);
            }

            if ($options->count() === 0) {
                throw new CustomValidationException('No available option exists');
            }

            $this->getVariantResource()->createImageMappingForOptions(
                $options,
                $image
            );
        }
    }

    /** * Translate the whole product array. * * @return array */
    
Home | Imprint | This part of the site doesn't use cookies.