Questions tagged «column»

1
将varchar列添加到订单地址
我正在尝试将一些varchar字段添加到sales / order_address表中,但是遇到列定义错误。 我有以下代码: $oInstaller->getConnection() ->addColumn( $oInstaller->getTable('sales/order_address'), 'address_email', array( 'nullable' => false, 'length' => 255, 'type' => Varien_Db_Ddl_Table::TYPE_VARCHAR, 'comment' => 'Company Email Address' ) ); 这将返回错误: [message:protected] => Invalid column definition data 如果我更改要使用的代码,Varien_Db_Ddl_Table::TYPE_INTEGER则代码将运行并添加该列。我试图删除长度和可为空的属性,但无济于事。 编辑 当更新脚本时,如下更新脚本,它将起作用。有人知道导致此错误的原因吗? $oInstaller->getConnection() ->addColumn( $oInstaller->getTable('sales/order_address'), 'address_email', Varien_Db_Ddl_Table::TYPE_VARCHAR . '(255)' );

1
使用Ui组件在销售网格上添加“自定义”列时,Magento 2过滤器不起作用
我已将“自定义”列添加track_number到后端的sales >> Order网格中。 <vendor_name>/Sales/view/adminhtml/ui_component/sales_order_grid.xml <?xml version="1.0" encoding="UTF-8"?> <listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> <columns name="sales_order_columns"> <column name="track_number" class="<vendor_name>\Sales\Ui\Component\Listing\Column\OrderGrid"> <argument name="data" xsi:type="array"> <item name="js_config" xsi:type="array"> <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item> </item> <item name="config" xsi:type="array"> <item name="visible" xsi:type="boolean">true</item> <item name="dataType" xsi:type="string">text</item> <item name="align" xsi:type="string">left</item> <item name="filter" xsi:type="string">text</item> <item name="label" xsi:type="string" translate="true">Tracking #</item> </item> </argument> </column> </columns> </listing> …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.