Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/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
Php 自定义客户文件属性_Php_Magento_Magento 1.7 - Fatal编程技术网

Php 自定义客户文件属性

Php 自定义客户文件属性,php,magento,magento-1.7,Php,Magento,Magento 1.7,我在magento的“管理”面板的“客户”部分中有一个自定义属性,管理员可以在其中上载每个客户特有的文件 我需要一种方式来显示这个文件在前端,从而允许他们下载它。 启用文件上载的模块是由我的同事使用模块创建者创建的。链接: 如果任何人有任何关于这件事的信息,并能对此提供一些线索。我将非常感激 Magento版本:1.7 问候, Julian您可以加载客户集合,告诉它选择所有属性(或者如果您知道属性代码,请使用该属性),然后按客户id进行筛选 $customerId = 1; $

我在magento的“管理”面板的“客户”部分中有一个自定义属性,管理员可以在其中上载每个客户特有的文件

我需要一种方式来显示这个文件在前端,从而允许他们下载它。 启用文件上载的模块是由我的同事使用模块创建者创建的。链接:

如果任何人有任何关于这件事的信息,并能对此提供一些线索。我将非常感激

Magento版本:1.7

问候,


Julian

您可以加载客户集合,告诉它选择所有属性(或者如果您知道属性代码,请使用该属性),然后按客户id进行筛选

    $customerId = 1;

    $customer = Mage::getModel('customer/customer')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('entity_id', array('eq' => $customerId))
    ->getFirstItem();

    // There may be a better way, but i've found that using the collection method returns all attributes easily.

    var_dump($customer);
    die();
从var_转储中,您应该能够看到您想要看到的属性,然后它只是一个调用

 $myAttributeName = Mage::getModel('customer/customer')->load(185)->getMyAttributeCode()->getName();

你能成功上传文件吗?