我想知道我需要编辑哪些文件才能在创建新订单时向新产品列表中添加新列。
具体来说,我希望按照属性集名称进行过滤,就像您在目录>上一样。经理产品页面。
答案 0 :(得分:0)
您必须覆盖自定义模块中的adminhtml / default / default / template / sales / order / create / items / grid.phtml文件。对于这个自定义模块的开放管理布局xml,并写下代码:
<adminhtml_sales_order_create_index>
<reference name="items_grid">
<action method="setTemplate"><template>companyname/modulename/sales/order/create/items/grid.phtml</template></action>
</reference>
</adminhtml_sales_order_create_index>
<adminhtml_sales_order_create_load_block_data>
<reference name="items_grid">
<action method="setTemplate"><template>companyname/modulename/sales/order/create/items/grid.phtml</template></action>
</reference>
</adminhtml_sales_order_create_load_block_data>
<adminhtml_sales_order_create_load_block_items>
<reference name="items_grid">
<action method="setTemplate"><template>companyname/modulename/sales/order/create/items/grid.phtml</template></action>
</reference>
</adminhtml_sales_order_create_load_block_items>
然后将adminhtml / default / default / template / sales / order / create / items / grid.phtml复制到adminhtml / default / default / template / companyname / modulename / sales / order / create / items / grid.phtml
在grid.phtml thead和tbody中写下以添加新列:
<thead>
<tr class="headings">
<th><?php echo $this->__('My custom column title') ?></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php echo $this->getLayout()->createBlock('companyname_modulename/adminhtml_blockname', '', array('item' => $_item))->setTemplate('companyname/modulename/sales/order/create/blocktemplate.phtml')->toHtml(); ?>
</td>
</tr>
</tbody>
希望这会有所帮助!!