Jump to content
Patronbutiken

Sort by productcode on page Assign to Category

Recommended Posts

Please try this edit:

In the file /admin/sources/products.assign.inc.php, near line 131, find:

## Product list
if (($products = $GLOBALS['db']->select('CubeCart_inventory', array('product_id', 'name', 'product_code'), false, array('name' => 'ASC'))) !== false) {

Change to:

## Product list
if (($products = $GLOBALS['db']->select('CubeCart_inventory', array('product_id', 'name', 'product_code'), false, array($GLOBALS['config']->get('config', 'product_sort_column') => $GLOBALS['config']->get('config', 'product_sort_direction')))) !== false) {


This change will have the query use the default product sort setting (in admin, Store Settings, Layout tab, Product List Sorting).

Share this post


Link to post
Share on other sites

Since the edit means that the listing will be according to this setting, one will need to visit that setting and change what column with which you want the products to be sorted.

So, if you want to sort by Product ID, make the settings change, save, then see if the Assign to Category shows the products sorted by that column.

Share this post


Link to post
Share on other sites

Be advised that this setting applies also to the storefront. So, once you finish with Assign to Category, if necessary, reset the default sort back to what you want the customer to see.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...