| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How TO Order Products List By Field | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How TO Order Products List By Field
Hello, i have a lot of products on my site and i wish to organize them. How to i arrange them by price...with out having to do it one by one? Thanks.
|
|||||||
#2
|
|||||||
|
|||||||
There is a fair amount of info on this on this thread. http://forum.x-cart.com/viewtopic.php?t=677&highlight=
The file to amend is the the customer/products.php file Line 61 is: Code:
Change this to: Code:
I have left this with the product order reversed bit in so that you can set to increase or decrease through the admin centre. You will also need to amend the featured products php file in the same way if you want that to display in a similar way. Enjoy.
__________________
ex x-cart guru |
|||||||
#3
|
|||||||
|
|||||||
thanks funkydunk, but i can't find the customer/products.php file. step by step how do i get to that template? Thanks for your patience.
|
|||||||
#4
|
|||||||
|
|||||||
Sorry,
You cant get to it through the admin area in x-cart, you need to open up the products.php file (either your local version or the one on the server) in a text editor. I use ultraedit (it highlights the php code very well). You can then make any amendments needed.
__________________
ex x-cart guru |
|||||||
#5
|
|||||||
|
|||||||
I posted a similar question in the MySQL forum, and just found the solution overhere.
Nevertheless, I tried this code in the products.php file and I received this error: INVALID SQL: 1064 : You have an error in your SQL syntax near 'group by xcart_products.productid limit 45' at line 1 SQL QUERY FAILURE: select xcart_products.*, xcart_categories.category, min(xcart_pricing.price) as price from xcart_products, xcart_pricing, xcart_categories where xcart_pricing.productid=xcart_products.productid and xcart_pricing.quantity=1 and xcart_products.categoryid=xcart_categories.categor yid AND (xcart_categories.membership='' OR xcart_categories.membership='') and (xcart_pricing.membership='' or xcart_pricing.membership='') and (xcart_products.categoryid='46' or xcart_products.categoryid1='46' or xcart_products.categoryid2='46' or xcart_products.categoryid3='46') and xcart_products.forsale='Y' group by xcart_products.productid order by xcart_pricing.price asc limit 0, group by xcart_products.productid limit 45 Please can anybody help me out, cause I am pulling my hair out for the last couple of days! I really would like to have my products sorted by price!! thx! |
|||||||
#6
|
|||||||
|
|||||||
what version are you using?
the code posted above was for a really old version and may not work with newer xcarts.
__________________
ex x-cart guru |
|||||||
#7
|
|||||||
|
|||||||
Hi Funkydunk,
Currently I am upgrading form 2.3.0 to 3.4.3 Better to say that I am installing a complete new cart.... My line in teh products.php looks like: Code:
I added at the end: Code:
but this will result in the error previously described. First I thought it was the " that was missing at the end...But I received a parse error when adding the quotationmark. It's puzzling me... |
|||||||
#8
|
|||||||
|
|||||||
Little known secret shhhh...
but you can get it do do an ascending sort by price by adding a link to the product page with additional variable of: Code:
same goes with alphabetically Code:
Now for one site I just added a table into the top of the products.tpl such as: Code:
You will also need to add: Code:
into the bottom of customer/products.php and change navigation.tpl to the following so that the orderby variable is carried over to the next page: Code:
__________________
ex x-cart guru |
|||||||
#9
|
|||||||
|
|||||||
He Funkydunk,
a million, man! I placed the code in the proper files. I started with Code:
I did not really get it where to place it. What I did is the following: Code:
As you can see I put it at the end as an argument. Not sure if that's ok....Well I am sure that it is nog OK, because it is not working.... The order by price argument doesn't bring up any errormessage but no products will show up. I reckon I made a mistake here, ah... What did I do wrong??? The rest of your mods seem to be fine. Thanks a lot...very usefull mods! [/quote] |
|||||||
#10
|
|||||||
|
|||||||
OK...I got a little bit further....
Now I changed the query in products.php into: Code:
This seems to work.... Products will show up alphabetically. When I leave "&orderby=products"... I'll get no searchresults. The same happens when I skip "&orderby=price"....No results... I am running bazurk! |
|||||||
|
|||
X-Cart forums © 2001-2020
|