Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

in admin "Products Attributes", how to sort the products by ID


prettyswan

Recommended Posts

Posted

the products is sorted by Product Name in admin pinewbjoy/products_attributes.php.

i want to sort the products by ID.

Can someboy help me how to do this?

 

1zwem1h.jpg

Posted

I think this will change the order in the attributes (PLEASE KEEP A BACKUP JUST IN CASE IT DOESNT WORK SO YOU CAN REVERT BACK TO OLD ONE!)

 

in /catalog/admin/product_attributes.php around line 542 change this

 

<?php
 $attributes = "select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pa.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name";

 

TO THIS:

 

<?php
 $attributes = "select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pa.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_id";

 

Havn't tested it as I dont have product attributes set up ... so please make backup before trying it

Posted
sLaV, thanks. it will save me lots of time.

it almost works.

but it still has some strange behaviors.

can you figure it out?

c514cea7c247737264786bbb8835cc6e.jpg

 

Try

 

<?php
 $attributes = "select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pa.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_id DESC";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...