Cant Sort Column After Searching For Customer

Description

When you search for a customer in the admin panel then try to sort a column of the results, you are taken back to the full list of customers.

A quick fix for this is to check if a search term has been passed to the page, if so add that into the link to sort the column.

To apply this, open /catalog/admin/customers.php
Find around line 1103;
<td class="dataTableHeadingContent" valign="top"><?php echo "$PHP_SELF?listing=company"; ?><br><?php echo ENTRY_COMPANY; ?></td>
<td class="dataTableHeadingContent" valign="top"><?php echo "$PHP_SELF?listing=lastname"; ?><br><?php echo TABLE_HEADING_LASTNAME; ?></td>
<td class="dataTableHeadingContent" valign="top"><?php echo "$PHP_SELF?listing=firstname"; ?><br><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
<td class="dataTableHeadingContent" valign="top"><?php echo "$PHP_SELF?listing=cg_name"; ?><br><?php echo TABLE_HEADING_CUSTOMERS_GROUPS; ?></td>
<td class="dataTableHeadingContent" align="right" valign="top"><?php echo "$PHP_SELF?listing=id-asc"; ?><br><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
<td class="dataTableHeadingContent" align="center" valign="top"><?php echo "$PHP_SELF?listing=ra"; ?><br><?php echo TABLE_HEADING_REQUEST_AUTHENTICATION; ?>&nbsp;</td>

Replace with;
<td class="dataTableHeadingContent" valign="top"><?php echo $PHP_SELF . ((isset($_GET['search'])) ? '?search=' . $_GET['search'] . '&' : '?') . 'listing=company'; ?><br><?php echo ENTRY_COMPANY; ?></td>
<td class="dataTableHeadingContent" valign="top"><?php echo $PHP_SELF . ((isset($_GET['search'])) ? '?search=' . $_GET['search'] . '&' : '?') . 'listing=lastname'; ?><br><?php echo TABLE_HEADING_LASTNAME; ?></td>
<td class="dataTableHeadingContent" valign="top"><?php echo $PHP_SELF . ((isset($_GET['search'])) ? '?search=' . $_GET['search'] . '&' : '?') . 'listing=firstname'; ?><br><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
<td class="dataTableHeadingContent" valign="top"><?php echo $PHP_SELF . ((isset($_GET['search'])) ? '?search=' . $_GET['search'] . '&' : '?') . 'listing=cg_name'; ?><br><?php echo TABLE_HEADING_CUSTOMERS_GROUPS; ?></td>
<td class="dataTableHeadingContent" align="right" valign="top"><?php echo $PHP_SELF . ((isset($_GET['search'])) ? '?search=' . $_GET['search'] . '&' : '?') . 'listing=id-asc'; ?><br><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
<td class="dataTableHeadingContent" align="center" valign="top"><?php echo $PHP_SELF . ((isset($_GET['search'])) ? '?search=' . $_GET['search'] . '&' : '?') . 'listing=ra'; ?><br><?php echo TABLE_HEADING_REQUEST_AUTHENTICATION; ?>&nbsp;</td>

Environment

None

Steps to reproduce

None

Assignee

Giles Marshall

Reporter

Scott Murphy

Labels

None

Severity

Minor

Components

Fix versions

Affects versions

Priority

Configure