Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 多选产品属性_Magento_Export_Custom Attribute - Fatal编程技术网

Magento 多选产品属性

Magento 多选产品属性,magento,export,custom-attribute,Magento,Export,Custom Attribute,我使用管理属性部分从magento中的admin创建了一个新的多选类型属性,并使用后端源模型作为标签和值 现在,当我使用export all data profile从admin导出产品csv时,我的多选属性显示为空。我想在csv中显示选定的值 我的源模型代码: 在foreach之后,我们在admin的multi-select city下拉列表中有了值。我无法发布图像,否则,我将发布图像如果要导出多选属性,请转到系统->导入/导出->数据流-配置文件,然后通过选择您的商店导出产品。 您将在csv

我使用管理属性部分从magento中的admin创建了一个新的多选类型属性,并使用后端源模型作为标签和值

现在,当我使用export all data profile从admin导出产品csv时,我的多选属性显示为空。我想在csv中显示选定的值

我的源模型代码:


在foreach之后,我们在admin的multi-select city下拉列表中有了值。我无法发布图像,否则,我将发布图像

如果要导出多选属性,请转到系统->导入/导出->数据流-配置文件,然后通过选择您的商店导出产品。
您将在csv文件中找到具有产品所选值的multiselect属性

我认为你需要包括更多的细节。请阅读并相应地更新您的问题。请在foreach之后向我们展示您在$customerArr中有什么?我的意思是向我们展示var_dump$customerArr@zhartaunik这是我的var_dump$customerArr:-array715{[0]=>array2{[value]=>string11[label]=>string6 ABOHAR}[1]=>array2{[value]=>string12[label]=>string8阿布路}我没有在csv中获取所选值。我获取的产品的multiselect属性为空。转到“管理”面板“目录”->“属性”->“管理属性”->“选择您的属性和管理标签”->“如果您有多个商店视图,请在那里为所有商店视图添加标签。如果未工作,请创建新的multiselect属性并重试。multiselect属性emagento中的xport功能是默认的。它不能与动态值一起使用。如何在属性中动态添加选项和值。
<?php
    class CityVal_City_Model_Product_Attribute_Unit extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
    {
      public function getAllOptions()
      {
        $connection = Mage::getModel('core/resource')->getConnection('core_read');
        $sql = 'SELECT  city_id,city_name FROM cities';
        $orders = $connection->fetchAll($sql);
        foreach($orders as $ord)
        {
            $customerArr[] = array(
                           'value' => $ord['city_id'],
                           'label' => $ord['city_name'],
                            );
        }
        if (!$this->_options) {
            $this->_options = $customerArr;
        }
        return $this->_options;
      }
    }
    ?>