| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Adding (Mfr.) Sort Fields 4.0.x | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Adding (Mfr.) Sort Fields 4.0.x
It seems its fairly easy to add any sort field you like with X-Cart 4.0.x.
Here's how I added manufacturerid to the sort by options. 1) Edit include/search.php find: Code:
Replace with: Code:
Now in the same file locate: Code:
After this line of code add: Code:
That's it! Pretty simple and quick, and it works on most all available fields in xcart_products table as well as others if need be.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#2
|
|||||||||
|
|||||||||
nice and simple mod. thanx boomer.
__________________
Dongan MercuryMinds Technologies Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com Follow us at Facebook / Twitter |
|||||||||
#3
|
|||||||||
|
|||||||||
Strange think in my x-cart is, that its sorting correctly only in product search but the choices of ordering are available in list of products in categories and manufacturers, and here its not working correctly, becouse when I am in specified category and click on manufacturer or date sorting, its searching in whole products and order all products, not only which are in the specified category. Anybody know how to solve this ?
Ahh, I found what was wrong.. I have form action address in search order template search.php, instead of nothink
__________________
Radek Karban - WebDesign - Reklama.cz (not x-cart site) several x-cart (gold version 4.0.10 - 4.1.3, linux debian) and a huge pack of mods |
|||||||||
#4
|
|||||||
|
|||||||
Nice one..thanks B00MER
__________________
X-cart v4.0.8 |
|||||||
#5
|
|||||||||
|
|||||||||
Thanks for the mod.
Does anyone know how to change this to sort by votes? I tried the obvious, but it didnt seem to work at all.
__________________
4.4 Code:
|
|||||||||
#6
|
|||||||
|
|||||||
Great mod...any ideas on how to make a drop down to display only the selected manufacturer?
__________________
X-Cart Pro 4.1.9 PHP5.2.5 MySQL 5.0.54 IIS/Apache/NGINX Webservers |
|||||||
#7
|
|||||||||
|
|||||||||
Is there a way to make an additional 'extra field' (or fields) sortable? For instance, we use our own SKU, and would like to add a ManufacturerSKU, and be able to sort by that also. Would this be tough to do?
__________________
Two Separate X-Cart Stores Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series. Integrated with Stone Edge Order Manager + POS Version 4.1.12 Gold (fresh install) - X-AOM - Linux Mods - XCSEO free |
|||||||||
#8
|
|||||||
|
|||||||
I checked my code and it looks different:
$sort_fields = array( "productcode" => func_get_langvar_by_name("lbl_sku"), "title" => func_get_langvar_by_name("lbl_product"), "price" => func_get_langvar_by_name("lbl_price"), "orderby" => func_get_langvar_by_name("lbl_default") ); if($current_area == 'A' || $current_area == 'P') $sort_fields["quantity"] = func_get_langvar_by_name("lbl_quantity"); if (empty($search_data)) And then: { case "productcode": $sort_string = "$sql_tbl[products].productcode $direction"; break; case "title": $sort_string = "$sql_tbl[products].product $direction"; break; case "orderby": $sort_string = "$sql_tbl[products_categories].orderby $direction"; break; case "quantity": $sort_string = "$sql_tbl[products].avail $direction"; break; I tried and gave me an error message on line 1. Does anyone know what to do in this situation? By the way it has been done Б─≤speedup optimizationБ─≥ on my XCart, several months ago. Thanks
__________________
X-Cart Version 4.6.0 |
|||||||
|
|||
X-Cart forums © 2001-2020
|