Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Sorting Products alphabetically

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-14-2002, 05:16 AM
 
Gilbert Meyer-Gauen Gilbert Meyer-Gauen is offline
 

Newbie
  
Join Date: Sep 2002
Posts: 1
 

Default Sorting Products alphabetically

Hello,

Is there a way of sorting subcategories and products alphabetically by Subcategory or Product Name (rather than by Subcategory or Product ID)? We have a lot of subcategories that use manufacters names, and sorting the products by the invisible Product ID really doesn't make much sense...

Thanks for any help,
Gil
Reply With Quote
  #2  
Old 09-16-2002, 12:15 PM
 
ryan ryan is offline
 

Advanced Member
  
Join Date: Sep 2002
Location: Philly
Posts: 38
 

Default

I was able to do this for searches, but have not figured out how to do it with the catagory views.

For searches you just change the only GROUP BY in search.php.

I tried changing the "group by" in config.php, but it didn't fix the problem and I haven't seen what effect it did have.
Reply With Quote
  #3  
Old 09-17-2002, 08:03 AM
 
Anonymous Anonymous is offline
 

eXpert
  
Join Date: Sep 2002
Posts: 222
 

Default

Hi Ryan,

Yeah, I could fix it for the search as well which, as you said, was pretty easy. However, subcategories and products seem to be a lot harder to sort.

Well, if I should find a fix I'll post it here.

Thanks again,
Gil
Reply With Quote
  #4  
Old 09-22-2002, 03:01 PM
 
martinp martinp is offline
 

Newbie
  
Join Date: Sep 2002
Location: USA
Posts: 4
 

Default

I had the same problem, and ended up deleting the items, and re-importing them in the order I wanted them to appear. They seem to be sorted by their product_code.
Martin
Reply With Quote
  #5  
Old 09-22-2002, 04:57 PM
 
Anonymous Anonymous is offline
 

eXpert
  
Join Date: Sep 2002
Posts: 222
 

Default

Hi,

I think this might help you:

http://forum.x-cart.com/viewtopic.php?t=76



ATKOgirl
Reply With Quote
  #6  
Old 09-22-2002, 07:54 PM
 
martinp martinp is offline
 

Newbie
  
Join Date: Sep 2002
Location: USA
Posts: 4
 

Default

It certainly does help! Thank you. I see the point. I have not modified any of the php files before. I am using a PC. Can I move the file to my PC, edit the text with a text editor, and ftp it right back? Won't I mess something else up?
Martin
Reply With Quote
  #7  
Old 09-23-2002, 09:17 AM
 
Anonymous Anonymous is offline
 

eXpert
  
Join Date: Sep 2002
Posts: 222
 

Default

Hi martinp,

You should have no problem editing the file on a pc. I am on a pc and use Wordpad to edit the php files. Just remember to upload in ASCII mode rather than binary mode when re-uploading the file.That should do it!

ATKOgirl
Reply With Quote
  #8  
Old 11-29-2004, 06:15 PM
 
clydefrog clydefrog is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 61
 

Default

I do not see the line that tkogirl changed. I looked in my product.php file and all I came up with was this:

$search_query = "($sql_tbl[products].categoryid='$cat' or $sql_tbl[products].categoryid1='$cat' or $sql_tbl[products].categoryid2='$cat' or $sql_tbl[products].categoryid3='$cat') and $sql_tbl[products].forsale='Y'";

$total_products_in_search = $current_category["product_count"];

$products = func_search_products($search_query, !empty($user_account['membership'])?$user_account['membership']:"", $first_page,$current_category["product_count"]);
if (count($products) ==0) $products="";

if(!empty($active_modules["Subscriptions"])) {
include $xcart_dir."/modules/Subscriptions/subscription.php";
}

$smarty->assign("products",$products);
$smarty->assign("navigation_script","home.php?cat=$cat") ;
?>

Is this similar code to what you changed? and what version xcart are you using?
__________________
X-Cart Gold 4.1.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:09 PM.

   

 
X-Cart forums © 2001-2020