0

I have a website with multiple stores (One for each country, around 170 countries in total) and each store has two store views. One for the English language and one for the Greek.

Is it possible to set the same value for all stores with the English language?

enter image description here

I'm using the code below to load the current attributes:

// list of attributes
$attributes = [141,142,143];

// get stores using the english language
foreach ($storesList as $storeKey => $storeValues) {

    // get store code information
    $targetLanguageParts = explode("_", $storeValues["code"]);

    // get target language
    $targetLanguage = $targetLanguageParts[1];

    // if store is in english
    if (strpos($targetLanguage, "en")!==false) {

        // add to list of english stores
        $englishStores[] = $storeKey;

        // get values for each attribute
        foreach ($attributes as $attribute) {
            // load attribute
            $attributeData = $eavConfig->getAttribute('catalog_product', $attribute);

            // all attribute options
            $alloptions = $attributeData->getSource()->getAllOptions();

            // for each option
            foreach ($alloptions as $option) {
                // get label
                $label = $option['label'];

                // get value
                $value = $option['value'];

            }
        }
    }
}

Thanks in advance!

  • If you not fill the other stores values then it automatically comes from admin which is in english – Sukumar Gorai Jul 23 '18 at 14:53
  • I know that but it doesn't solve my problem because I want to do the same thing for the Greek language. – Vasilis Jul 23 '18 at 15:03
  • @SukumarGorai, please update me here, facing same issue, magento.stackexchange.com/questions/253672/… – jafar pinjar Dec 14 '18 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.