Jump to content

Sort by gender in backoffice


Recommended Posts

Hello

 

I would like to know how could sort orders by genders in backoffice. 
 
I consider that sort by "New Customers" as it is by default don´t is necessary then is good option for replace it by Genders
 
Do you know what php files are necessary to modify?
 
 
best regards
Link to comment
Share on other sites

try this (not tested)

 

controllers/admin/AdminCustomersController.php

(code from 1.5.6.2)

find this code

			'id_gender' => array(
				'title' => $this->l('Title'),
				'width' => 70,
				'align' => 'center',
				'icon' => $genders_icon,
				'orderby' => false,
				'type' => 'select',
				'list' => $genders,
				'filter_key' => 'a!id_gender',

change 'orderby' true

'orderby' => true,
Link to comment
Share on other sites

Hola El Patron

 

Thank you for your code but this file is to modify sort by genders in "Customers"

I want add sort by genders in "Orders" replacing it for the unnecessary code of sort by "customers new (Yes or No)" 

 

I believe that file to modify is AdminOrdersController.php and code to change is around line 74.

 

'new' => array(
'title' => $this->l('New'),
'width' => 25,
'align' => 'center',
'type' => 'bool',
'tmpTableFilter' => true,
'icon' => array(
0 => 'blank.gif',
1 => array(
'src' => 'note.png',
'alt' => $this->l('First customer order'),
)
),
'orderby' => false

If I change this code for this:

'id_gender' => array(
'title' => $this->l('Title'),
'width' => 70,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'list' => $genders,
'filter_key' => 'a!id_gender',
),

 Then backoffice says:

 

Consulta de MySQL incorrecta
Unknown column 'a.id_gender' in 'field list'
 
 
 
Best regards
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...