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?
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!