Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.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 如何使用marketplace多供应商扩展在magento的销售订单网格中创建自定义列_Php_Mysql_Magento - Fatal编程技术网

Php 如何使用marketplace多供应商扩展在magento的销售订单网格中创建自定义列

Php 如何使用marketplace多供应商扩展在magento的销售订单网格中创建自定义列,php,mysql,magento,Php,Mysql,Magento,我正在尝试在我的销售订单网格中添加列。我的专栏将是产品的卖家名称。我有一个多供应商市场扩展。 我找到了卖方id,即客户id,但我可以在卖方id的帮助下找到全名 我试图解决它,这是我使用的代码 protected function _prepareCollection() { $collection = Mage::getResourceModel($this->_getCollectionClass()); $collection->getS

我正在尝试在我的销售订单网格中添加列。我的专栏将是产品的卖家名称。我有一个多供应商市场扩展。 我找到了卖方id,即客户id,但我可以在卖方id的帮助下找到全名

我试图解决它,这是我使用的代码

 protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->join('marketplace_saleslist', 'main_table.entity_id = marketplace_saleslist.mageorderid',array('mageproownerid'));
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }
现在我添加以下列

    $this->addColumn('mageproownerid', array(
        'header' => Mage::helper('sales')->__('Seller ID'),
        'index' => 'mageproownerid',
    ));
Grid.php是:

}

我想使用“marketplace\u saleslist”字段“mageproownerid”上的联接将上表与“customer\u account”表关联起来

我们如何找到客户全名

请告诉我解决办法


谢谢大家。

您可以在grid.php文件中创建helper函数并更改列

$this->addColumn('mageproownerid', array(
    'header' => Mage::helper('sales')->__('Seller ID'),
    'index' => 'mageproownerid',
    'type'  =>  'options',  
    'options'   =>  Mage::helper('yourmodule')->getCustomerName(),
));
$this->addColumn('mageproownerid', array(
    'header' => Mage::helper('sales')->__('Seller ID'),
    'index' => 'mageproownerid',
    'type'  =>  'options',  
    'options'   =>  Mage::helper('yourmodule')->getCustomerName(),
));