Hi there, I have added a new product field using the code: Am_Di::getInstance()->productTable->customFields()->add(new Am_CustomFieldSelect('product_grouping', "Parent category for product", 'This enables us to provide overall credits for product sets', '', array('options' => array(1=>'Group1', 2=>'Group2')))); and as you expect it all works perfectly. However, I'd like to see the value of this field to be displayed as a custom column on the admin product listing page, i.e. /amember/admin-products page, preferrably with a sort feature. Can anyone point me in the right direction? Many thanks, Steve
Found a good example. Add this into your bootstrap. PHP: function onGridProductInitForm(Am_Event_Grid $event) { $event->getGrid()->getForm()->addInteger('apicredit_count') ->setLabel( ___("API Credit Count\n". "(keep as 0 to give no credits)")); $options = array('' => '-- ' . ___('Please select') . ' --'); foreach ($this->getDi()->db->selectCol("SELECT product_id AS ARRAY_KEY, title FROM ?_product") as $k => $v) $options[$k] = $v; $event->getGrid()->getForm()->addSelect('apicreds_product_id') ->setLabel(___("API Credits Product\n". "(keep empty for non-API credits product)")) ->loadOptions($options); }