Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.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
使用XML连接表并在Magento网格中显示数据_Magento - Fatal编程技术网

使用XML连接表并在Magento网格中显示数据

使用XML连接表并在Magento网格中显示数据,magento,Magento,我正试图通过添加列来显示数据来定制Magento Sales/Order/Grid 客户识别码 帐单地址 送货地址 我在前面的帖子之后创建了一个模块 我现在正试图加入这些表,但还没有弄清楚如何使用XML来实现这一点 <gridcontrol> <grids> <sales_order_grid> <!-- remove order id --> <shipping_add

我正试图通过添加列来显示数据来定制Magento Sales/Order/Grid

客户识别码 帐单地址 送货地址

我在前面的帖子之后创建了一个模块

我现在正试图加入这些表,但还没有弄清楚如何使用XML来实现这一点

<gridcontrol>
    <grids>
        <sales_order_grid>
            <!-- remove order id -->
            <shipping_address>
                <add>
                    <header>Shipping Address</header>
                    <!-- join shipping address from sales/order table -->
                    <join table="sales_flat_order_address" condition="sales_flat_order_address.entity_id={{table}}.street" field="street"/>
                </add>
                <after>status</after>
            </shipping_address>
            <billing_address>
                <add>
                    <header>Billing Address</header>
                    <!-- join shipping address from sales/order table -->
                    <join table="sales_flat_order_address" condition="sales_flat_order_address.entity_id={{table}}.street" field="street"/>
                </add>
                <after>status</after>
            </billing_address>
            <customer_id>
                <add>
                    <header>Customer Id</header>
                    <!-- join shipping address from sales/order table -->
                    <join table="sales_flat_order" condition="main_table.cutomer_id={{table}}.customer_id" field="customer_id"/>
                </add>
                <after>status</after>
            </customer_id>            
        </sales_order_grid>
    </grids>
</gridcontrol>

送货地址
地位
帐单地址
地位
客户Id
地位

我的表格中显示了新的列,但这些列是空的,所以我知道我做了一些不正确的事情,我认为这是非常简单的事情。如果有人能告诉我如何使用此方法联接正确的表,我将不胜感激。

为什么不试试,\u prepareCollection()


我知道你正在努力完成一项艰巨的任务。你为什么不用分机呢。请检查@SAM我使用了此扩展,但它不允许我向销售/订单网格添加列。其他任何地方都可以,包括Manage products网格,但扩展仍在Alpha中,因此还需要添加一些功能。
$collection->getSelect()->columns(array('filename' => new Zend_Db_Expr ("(SELECT 
filename FROM table_name WHERE customer_id =e.entity_id)")));
        $this->setCollection($collection);