Example #1
0
 protected function addTranslatedFields(ProductInterface $product, $translatedNames)
 {
     foreach ($translatedNames as $locale => $name) {
         $product->setCurrentLocale($locale);
         $product->setFallbackLocale($locale);
         $product->setName($name);
         $product->setDescription($this->fakers[$locale]->paragraph);
         $product->setShortDescription($this->fakers[$locale]->sentence);
         $product->setMetaKeywords(str_replace(' ', ', ', $this->fakers[$locale]->sentence));
         $product->setMetaDescription($this->fakers[$locale]->sentence);
     }
     $product->setCurrentLocale($this->defaultLocale);
 }