Add Customer State to admin/customers/list

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I would like to pull up customers by USA states in admin. How would I add this functionality to the form which comes up when you first bring up the customer list from admin. It has roles, email, UN, FN, LN, company, phone, and zip, but it would be nice to sort by state as well.  
I assume this can be done by simple edit to List.cshtml?
Help would be appreciated.
Thanks!
7 years ago
You should also change CustomerController.cs and implement required business logic there. You need to modify List and CustomerList methods there. You should also add state property to CustomerListModel class.
7 years ago
No, you can not directly by modified list.cshtml

you need to add new State property on CustomerListModel model and you need to fill State propertly on PrepareCustomerModelForList method on Nop.Admin/CustomerController.cs.

then you need to add that on List.cshtml to show states on grids.
7 years ago
Well, that is a bit more work than I had anticipated.
Seems like this feature should be implemented out of box.
Filtering customers by zip is not very useful for me, unless you could use wildcard characters.
Why do the percent and underscore characters used as wildcards in SQL not work?
For example, if I want to search on customers with California zip codes using, 9%
If I just put in 9 in the zip field, I get every zip that has 9 in it.

Seems like the SQL queries could be parsed better so to be able to use wildcards...

BUMP!
7 years ago
Some simple options: You could export your customers base and process it in Excel or get a reporting plugin to do the job
7 years ago
Tecnofin wrote:
Some simple options: You could export your customers base and process it in Excel or get a reporting plugin to do the job

Yes, just adds extra steps (and more work for me). Store has regional affiliates by state, and one level of affiliates under them. Would be nice to just query customers by state and send customer list to affiliates.
7 years ago
Would be nice if Nop handled affiliates better as well, and provided for more tiers...
Maybe 4.0  :-)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.