| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Adding New Sort By Option | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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
__________________
x-cart 4.2.3 AlteredCart Smart Search Auto Featured Products Mod (Personal Mod) BCSE Product Importer Pro & Drop Shipper Pro CDSEO Pro CMS EZRecommends EE slider login (Personal Mod) Next Prev Link Mod (Customized) ShadowBox Detailed Images (Personal Mod) Shop By Price (Customized) Social Media (Personal Mod) Switch Layout View (Personal Mod) Special Offers Testimonials (Personal Mod) Whats New (Customized) |
|||||||
#2
|
|||||||
|
|||||||
![]() 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:
Code:
modify: include/func/func.product.php 1. add description to this array(about line 320) Code:
__________________
X-Cart Gold 4.2.2 - 3.1.19 |
|||||||
|
#3
|
|||||||
|
|||||||
![]() 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.
![]()
__________________
x-cart 4.2.3 AlteredCart Smart Search Auto Featured Products Mod (Personal Mod) BCSE Product Importer Pro & Drop Shipper Pro CDSEO Pro CMS EZRecommends EE slider login (Personal Mod) Next Prev Link Mod (Customized) ShadowBox Detailed Images (Personal Mod) Shop By Price (Customized) Social Media (Personal Mod) Switch Layout View (Personal Mod) Special Offers Testimonials (Personal Mod) Whats New (Customized) |
|||||||
#4
|
|||||||
|
|||||||
![]() Can you post that query statement.
__________________
X-Cart Gold 4.2.2 - 3.1.19 |
|||||||
#5
|
|||||||||
|
|||||||||
![]() What about Sort by Manufacturer?
__________________
X-Cart Next: Business 5.2 (learning and testing) X-Cart Classic: Gold and Gold Plus 4.7 Lots of Modules and Customizations OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions) You can catch my ideas here: http://ideas.x-cart.com |
|||||||||
#6
|
|||||||
|
|||||||
![]() 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
__________________
x-cart 4.2.3 AlteredCart Smart Search Auto Featured Products Mod (Personal Mod) BCSE Product Importer Pro & Drop Shipper Pro CDSEO Pro CMS EZRecommends EE slider login (Personal Mod) Next Prev Link Mod (Customized) ShadowBox Detailed Images (Personal Mod) Shop By Price (Customized) Social Media (Personal Mod) Switch Layout View (Personal Mod) Special Offers Testimonials (Personal Mod) Whats New (Customized) |
|||||||
#7
|
|||||||
|
|||||||
![]() 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?
__________________
X-Cart Gold 4.2.2 - 3.1.19 |
|||||||
#8
|
|||||||
|
|||||||
![]() Correct the where clause needs to proceed the orderby clause. But where do I add the where clause for this to proceed it?
__________________
x-cart 4.2.3 AlteredCart Smart Search Auto Featured Products Mod (Personal Mod) BCSE Product Importer Pro & Drop Shipper Pro CDSEO Pro CMS EZRecommends EE slider login (Personal Mod) Next Prev Link Mod (Customized) ShadowBox Detailed Images (Personal Mod) Shop By Price (Customized) Social Media (Personal Mod) Switch Layout View (Personal Mod) Special Offers Testimonials (Personal Mod) Whats New (Customized) |
|||||||
#9
|
|||||||
|
|||||||
![]() 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
__________________
X-Cart Gold 4.2.2 - 3.1.19 |
|||||||
|
#10
|
|||||||
|
|||||||
![]() 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?
__________________
www.scraporchard.com X-Cart Pro Version 4.5.5 Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters Gahela: Gahela Support System The xCart Store: xBanners, xAccess, xMenus |
|||||||
|
|||
X-Cart forums © 2001-2020
|