Last active
February 5, 2024 09:18
-
-
Save magefast/4c00f55d63190c6e569c6320e70de2da to your computer and use it in GitHub Desktop.
Revisions
-
magefast renamed this gist
Feb 5, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
magefast renamed this gist
Feb 5, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
magefast created this gist
Feb 5, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ <pre> <?php error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('time_limit', 180); set_time_limit(180); require_once dirname(__FILE__) . '/app/Mage.php'; $app = Mage::app('admin'); umask(0); $mageCsv = new Varien_File_Csv(); $mageCsv->setDelimiter(','); $mageCsv->setEnclosure('"'); $data = $mageCsv->getData('/var/www/' . DS . 'attr-label-ua.csv'); foreach ($data as $d) { addAttributeLabel($d[0], $d[1]); echo '+' . $d[0] . ' '; } function addAttributeLabel($attributeCode, $value) { $uaStoreId = 5; $ruStoreId = 1; $adminStoreId = 0; $value = trim($value); $attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', $attributeCode); $labels = []; $labels[$adminStoreId] = $attribute->getFrontendLabel(); $labels[$uaStoreId] = $value; $labels[$ruStoreId] = $attribute->getFrontendLabel(); $attribute->setStoreLabels($labels)->save(); }