overrideVariantTranslations example

$product = $this->get('models')->find(Product::class$productId);
        $mainDetail = $product->getMainDetail();
        $mainData = $this->getMappingData($mainDetail$data);
        $variants = $this->getVariantsForMapping($productId$mainDetail$data);
        if (!empty($variants)) {
            foreach ($variants as $variant) {
                $variant->fromArray($mainData);
                $this->get('models')->persist($variant);
            }
            $this->get('models')->flush();
            if ($data['translations']) {
                $this->overrideVariantTranslations($productId$variants);
            }
        }
        $this->View()->assign(['success' => true]);
    }

    /** * Event listener function of the product backend module. Fired when the user clicks the "duplicate product" button * on the detail page to duplicate the whole product configuration for a new product. */
    public function duplicateArticleAction()
    {
        
Home | Imprint | This part of the site doesn't use cookies.