![]() |
Adding New Sort By Option
Is there anyway to add a new sort by option? I want to add sort by (Release Date) which is specified in [extra_field_options] table. Can anyone assist me with this?
Thanks |
Re: Adding New Sort By Option
You could probably duplicate what I did but substitute the field you want to sort by. I wanted to be able to sort by description. This mod was for X-Cart Gold 4.2.2.
Here is what I did: Modify: include/search.php 1. Add description into this array. (about line 40) (note: I had to add the lbl_description label in languages) Code:
$sort_fields = array( Code:
case "description": modify: include/func/func.product.php 1. add description to this array(about line 320) Code:
if (is_null($orderby_rules)) { |
Re: Adding New Sort By Option
Thanks for the input, but if I'm searching an extra field, for some reason when I add the extra_field table the query breaks. :(
|
Re: Adding New Sort By Option
Can you post that query statement.
|
Re: Adding New Sort By Option
What about Sort by Manufacturer?
|
Re: Adding New Sort By Option
well the problem is I want to orderby release date which comes from table 'extra_field_values' where fieldid="6" order by the 'value' for this extra field. When I add this to the orderby then it does just that orderby, but there is no way of defining the where clause without breaking the mysql query. Any advice? thx
|
Re: Adding New Sort By Option
Not seeing the query statement I'll just take a couple stabs here at possible probs.
If your query statement joins multiple tables and those tables have some identical field names then you'll need to include the table name (ex: table_name.field_name). or... You might need to use a "left join" in your query statement. or... orderby should be order by. or... where clause needs to proceed order by clause. Can you post your query statement? |
Re: Adding New Sort By Option
Correct the where clause needs to proceed the orderby clause. But where do I add the where clause for this to proceed it?
|
Re: Adding New Sort By Option
Try this:
SELECT * FROM $sql_tbl[products] JOIN $sql_tbl[extra_field_values] ON $sql_tbl[extra_field_values].productid = $sql_tbl[products].productid WHERE $sql_tbl[extra_field_values].fieldid='6' ORDER BY $sql_tbl[extra_field_values].value |
Re: Adding New Sort By Option
We have a Date Added modification in place, but would like to figure out how to have just one category sort by product name.. is there anyway to alter the code (which is similar to what was posted in previous replies) to have X-Cart sort one category id by product name and all others by date added?
|
Re: Adding New Sort By Option
Hi mrerotic,
I saw on your site you use a dropdown for your sort-by-function. Can you tell me what I have to change in the skin to get a dropdown for this? (I use the BCS Product Sort mod: www.woonwebwinkels.nl - 4.2.3) Thanks |
All times are GMT -8. The time now is 11:51 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.