i want to add a Column in Admin of Udropship Module in Vendors Views.
In the module i find the file:
app/community/Unirgy/Dropship/Block/Adminhtml/Vendor/Grid.php and i write this line:
$this->addColumn('commission_percent', array(
'header' => $hlp->__('Commission Percent'),
'index' => 'commission_percent',
));
after
$this->addColumn('email', array(
'header' => $hlp->__('Email'),
'index' => 'email',
));
but i not see a new column in admin, why ?
It's because i don't have "commission_percent" in Collection ?
I see in DB that "commission_percent" is in the udropship/vendor table inside a row "custom_vars_combined" in an array.
So when you add columns to grids you also need to add the column to the select.
Simply update the function that prepares the collection and add the following call.
$collection->addAttributeToSelect('your_attribute');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.