Has anyone tried to customize the “customer filter” inside the Admin yet? We want to change the filter columns by switching out one of the current columns (phone, email, zip, etc.) and add the “Business” that the customer is associated with.
I don’t believe it should be too much tweaking in order to replace one of those columns to show the “Business Field” - but I’m not familiar enough with the flow of things to be sure yet.
I’ll keep looking into this, though if anyone has any suggestions, I’m sure others in the community would find it helpful as well.
I notice most of the tweaking will take place within the following page:
I noticed the values for “company” are found within the “attribute_id” of the “customer_address_entity_varchar” table. The value associated with “attribute_id” “13” holds the company name.
Can someone mention how to access this inside the Grid.php page I mentioned?
So here’s the snippet of code that needs to be modified to display the “company” from each customer (See below: “Grid.php"), though I’m not sure how to get the correct values to show via the Zend Framework.
class Mage_Adminhtml_Block_Customer_Grid extends Mage_Adminhtml_Block_Widget_Grid {
public function __construct() { parent::__construct(); $this->setId('customerGrid'); $this->setUseAjax(true); $this->setDefaultSort('id'); }
Does anyone know if there are other files that need to be adjusted?
I do see we may need to set configuration up to access another table ("customer_address_entity_varchar") - and then access the correct field.
protected function _prepareCollection() { $collection = Mage::getResourceModel('customer/customer_collection') // ... // ADD THIS TO THE END: ->joinAttribute( 'billing_company', // field alias 'customer_address/company', // field source (entity/attribute) 'default_billing', // original entity binding attribute null, // no additional conditions for the join 'left' // left join to allow non-existing joined records ); // ... }
I’ve been working on the same problem as you nicolas46 today, I finally figured it out after a lot of trial and error, anyway here’s my code that will hopefully help you.
I’ve used a sum expression to get the total but I think there’s an attribute called row_total_with_discount or something but I haven’t looked into how to get it yet. The only thing I need to finish my code is to get the shipped date but that’s proving harder than I thought. If anyone can give any insight into how to get that attribute I’ll really appreciate it.
Did you guys add this straight to the core code or did you overide this somwhere - if you added it to core how will updates/upgrades effect your code -
if you did it via overiding, PLEASE tell me the paths you used in XML config.xml becasue i am trying to override a grid in my module, but i am struggling with the correct path syntax
all i am trying to do is extend a method in a grid class in adminhtml
I have tried so many Combinations I have no idea how to tell the
core/adminhtml/block/sales/order/grid.php that i want to extend it.
I have added the below code in all combinations under <admin> under <global> under and even added extra tags like <global><adminhtml> aaarggggg!!!!!
I see nicolas46 had the same problem as me, he is unsure what the ‘// original entity binding attribute’
looking at moshe’s code and all the following i also cant really understand what you mean by ‘// original entity binding attribute’
I see steve figured it out - but i don’t really know what he did other than call everything parent_id_orig and then call
->setRowIdFieldName(’parent_id_orig’)
->groupByAttribute(’parent_id_orig’);
I am sorry if its obvious to you guys and if i sound really stupid, but i really am struggling to get my head around the whole EAV side of things and was wondering if you could explain it more ie moshs just saying ‘// original entity binding attribute’ may seem really obvious to you - what do you actually mean…