![]() |
The sort mechanism is already built by xcart just they haven't switched it on.
Just add a link to the top of the products.tpl Sort this list by Price And amend the navigation.tpl as shown Then amend products.php by adding the assign to smarty code at the bottom. You dont need to amend the sql query in any way. |
Thanks Funkydunk for being so helpfull!
Forgot to mention that I did this aswell. I kept the SQL query as it was initially brought by XCart. Then I amended the products.tpl with (like you proposed earlier) Code:
* custom mod *} which is basically the same as amending : When clicking; the list remains in the same sequence. So probably in my version sorting by price isn't switched on.... :( Where can I do that...? :oops: |
Sorry my mistake :oops: forgot what I did now... it was a while back
Code for func.php search for the func_search_products and replace the first line of that function declaration with Code:
// function func_search_products($query, $membership,$first=0,$count_all=-1,$get_all=0, $orderby="orderby") { |
we are dealing here with a persistent little bastard..... :twisted:
Amending the func.php, will result in: Warning: Missing argument 6 for func_search_products() in c:\program files\apache group\apache\htdocs\shop\include\func.php on line 977 Warning: Missing argument 6 for func_search_products() in c:\program files\apache group\apache\htdocs\shop\include\func.php on line 977 However, changing the passage into: Code:
function func_search_products($query, $membership,$first=0,$count_all=-1,$get_all=0, $orderby="price") { Makes sure that every single category is sorted by price (ascending) by default! YEAHAAAAAAAAAAA! :D :D This is what I initially wanted.... Thank you funkydunk! Other amendmends are not necessary anymore. However when you want the customer to choose his own sorting method, there is still one error as mentioned above. Anyway...Funkydunk, you made a sunnyday out of myday today! :D |
I replaced the code
Code:
function func_search_products($query, $membership,$first=0,$count_all=-1,$get_all=0, $orderby="price") { in func.php and my products are sorted by price DESCENDING when I really want them ascending. How come yours are ascending and mine are descending?! By the way this is in v3.4.5 |
Have you tried ticking or unticking the list products in reverse order in admin?
|
That works now, thanks Funkydunk
Should have spotted that one :roll: |
:lol:
|
How would you sort by alphabetized in version 3.5.0
you had talked about being able to list the items via alphabetizing them from the data base instead of placing positions next to each item. what code do you have to implement and where?
I also need to do this for the items, but also for a subcatagories of names. I have artists first and last names and want them to show up alphabetized. Do I have to list them with their last name first or with a comma between first and last in order for this to work? |
In version 3.5 the facility exists in admin to change the order of the products on the page by going into general settings.
The categories will need to be put into order by using the position field unless you want to list them all by last name then first name. hth |
All times are GMT -8. The time now is 08:02 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.