| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Add Extra options to Sort By in products list V4.x.x | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Add Extra options to Sort By in products list V4.x.x
This is done for V4.x.x
Been looking at adding extra sort fields to the options that sit at the top of the products list. here in no particular order is where you need to change things. In this example I added the option to sort by date added. admin/configuration.php starts around line 138 (added line with add_date) Code:
include/func.php starts around line 1930, again added add_date section Code:
include/search.php starts around line 407, again add add_date section, alter the order of the "DESC" : "ASC" bit to alter default order Code:
include/search.php again, around line 47 Code:
if you want to add the Added date to one of the templates you can do so with Code:
or Code:
pretty sure thats about it. you can swap the add_date bit for whatever field you wish to use from the products table or remove any fields you dont want to use. Once your done set the default order by in general settings / appearence / product order
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#2
|
|||||||
|
|||||||
Sort
Hi
I want to add in a alphabetically search so for example A,B,C,D etc customer clicks on A it only returns products which start with a and so on can you advise if this mod you have done with work with this here is a link to a demo if your not sure what i'm on about http://www.play.com/play247.asp?pa=navmain&page=front&r=PS2 Hope you can help Thanks
__________________
Chris Xcart Version 4.13 |
|||||||
#3
|
|||||||
|
|||||||
Re: Add Extra options to Sort By in products list V4.x.x
Hi, new to x-cart, I have made this possible to work with 4.1.9, but i don't know where to add it to the template file to make it show up in the sort options. Or how to add it to the default listing in the admin menus. Can anyone help a bit more with this?
includes/search.php, added add_date line: PHP Code:
Added add_date stuff: PHP Code:
includes/func/func.products.php Added add_date stuff: PHP Code:
Ahhhh i had to add the language file lbl_add_date, done...
__________________
4.1.9 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Add Extra options to Sort By in products list V4.x.x
I just applied this patch as well - it works great - but I am not sure how to add my new Sort Fied as an Option in the Admin Drop Down for:
" Select the order in which products should be displayed within a category:" Any Ideas?
__________________
------ Brian Portland web design / development X-Cart 4.1.9 (a few carts) X-Cart 4.2.0 (1 cart so far) |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Add Extra options to Sort By in products list V4.x.x
Ok - I read another thread and found the SQL table that contains the Admin Drop Down information for sorting products.
just add your new 'add_date' to the "xcart_config" table - sort by 'title' field - look for the row "product_order" -> look for the field 'varients' -> edit this content to include our new date field. ex: add_date: adddate: lbl_add_date productcode:lbl_sku title:lbl_product orderby: lbl_default price:lbl_price this should now show up in the Admin drop down.
__________________
------ Brian Portland web design / development X-Cart 4.1.9 (a few carts) X-Cart 4.2.0 (1 cart so far) |
|||||||||
#6
|
|||||||
|
|||||||
Re: Add Extra options to Sort By in products list V4.x.x
I'm trying the same thing -- I have an extra field for date added (and I'll do the same after I get this working for date released). I have the drop down menu for sort but I can't get the functionality to work. In include/search.php I added this line
__________________
Version 4.1.11 License products: X-Cart Gold Add-on: X-FeatureComparison Add-on: X-SpecialOffers Add-on: X-AOM (Advanced Order Management) Add-on: X-FancyCategories |
|||||||
#7
|
|||||||
|
|||||||
Re: Add Extra options to Sort By in products list V4.x.x
continued ... I added this line "produpdated" => func_get_langvar_by_name("lbl_prod_update_date"), and on line 603 I added this --- case "produpdated":
$sort_string = "$sql_tbl[products_extra_field_value].prod_update_date $direction"; break; but I get this error message when I use the sort --- INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC, xcart_products.product ASC, xcart_products.productcode ASC, xcart_products.' at line 1 SQL QUERY FAILURE:SELECT COUNT(xcart_products.productid) FROM xcart_pricing, xcart_products LEFT JOIN xcart_quick_flags ON xcart_quick_flags.productid = xcart_products.productid LEFT JOIN xcart_product_memberships ON xcart_product_memberships.productid = xcart_products.productid INNER JOIN xcart_quick_prices ON xcart_quick_prices.productid = xcart_products.productid AND xcart_quick_prices.membershipid = '0' LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid AND xcart_quick_prices.variantid = xcart_variants.variantid INNER JOIN xcart_products_categories ON xcart_products_categories.productid = xcart_products.productid INNER JOIN xcart_categories ON xcart_products_categories.categoryid = xcart_categories.categoryid LEFT JOIN xcart_category_memberships ON xcart_category_memberships.categoryid = xcart_categories.categoryid WHERE xcart_quick_prices.priceid = xcart_pricing.priceid AND xcart_products.product_type <> 'C' AND xcart_products.forsale <> 'B' AND xcart_category_memberships.membershipid IS NULL AND xcart_product_memberships.membershipid IS NULL AND xcart_categories.avail = 'Y' AND xcart_products_categories.categoryid='253' AND (xcart_products_categories.main='Y' OR xcart_products_categories.main!='Y') AND (xcart_products.forsale = 'Y' OR xcart_products.forsale = '') GROUP BY xcart_products.productid ORDER BY .prod_update_date ASC, xcart_products.product ASC, xcart_products.productcode ASC, xcart_products.productid ASC Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/unique/public_html/cart/include/func/func.db.php on line 157
__________________
Version 4.1.11 License products: X-Cart Gold Add-on: X-FeatureComparison Add-on: X-SpecialOffers Add-on: X-AOM (Advanced Order Management) Add-on: X-FancyCategories |
|||||||
#8
|
|||||||
|
|||||||
Re: Add Extra options to Sort By in products list V4.x.x
So can someone direct me to the code that would work for an extra field value sort?
__________________
Version 4.1.11 License products: X-Cart Gold Add-on: X-FeatureComparison Add-on: X-SpecialOffers Add-on: X-AOM (Advanced Order Management) Add-on: X-FancyCategories |
|||||||
#9
|
|||||||
|
|||||||
Re: Add Extra options to Sort By in products list V4.x.x
found this 29.95 mod that does it http://bcsengineering.com/store/catalog/Product_Sort_by_Pro_for_Xcart-p-275.html
__________________
Version 4.1.11 License products: X-Cart Gold Add-on: X-FeatureComparison Add-on: X-SpecialOffers Add-on: X-AOM (Advanced Order Management) Add-on: X-FancyCategories |
|||||||
#10
|
|||||||
|
|||||||
Re: Add Extra options to Sort By in products list V4.x.x
I'm going to try this mod from Shan with the drop-down as you've indicated. If I want to change the Sort by: sequence (ie. Sort by: Price Product Date Added), do I change this in the include/search.php file or is there a .tpl that I need to change?
Christine Quote:
__________________
______________ version 4.1.9 Gold |
|||||||
|
|||
X-Cart forums © 2001-2020
|