Contributions
Display matching categories in search results
Display matching categories in search results
For OsCommerce 2.2 rc1
This will display matching categories results where the name matches the search, if you have the category description mod
(http://www.oscommerce.com/community/contributions,2343), there is code to include that too.
Also included is code if you have my hide categories contribution (http://addons.oscommerce.com/info/5907).
Included here is an sql query to add a setting in admin to control category search.
If a category is selected in the search, then only that (and subcategories if option set) are searched.
The from / to date filters are also applied.
I`ve also added an option to search categories only.
During the writing of this I found what appears to me to be a vulnerability in the search form in OSC2.2 rc1 where it could be used by a malicious attacker to inject sql or code.
I have added a trap in advanced_search_result.php for this.
Forum started for this at http://forums.oscommerce.com/index.php?showtopic=301065
Expand All / Collapse All
Added options to category_listing.php:
$cat_tree=true;//set to true to display the full tree of category (related categories), otherwise false
$duplicates=false;// Related categories are only shown with matching if they have not been shown already, set this to true to it will show category from tree though its shown already.
Changed Files: category_listing.php
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals compatible.
FULL PACKAGE
V1.3
Added option to position category results above or below product results.
Changed Files: category_listing.php, category_search_result.php, advanced_search_result.php & additional sql query.
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals compatible.
FULL PACKAGE
V1.2
Result will now display the full category tree for the matching category with matching highlighted.
Added switches at start of files to simplify install:
.
$cat_desc=false;//set to true if you have category descriptions
$cat_stat=false;//set to true if you have hide category mod
$short=false; //set to true if you have short product descriptions
Changed Files: category_listing.php, advanced_search.php & advanced_search_result.php
Tested on PHP 4 & 5, SQL 4 & 5, osC 2.2 ms2, rc1 & rc2a and is register_globals compatible.
Forum thread at http://forums.oscommerce.com/index.php?showtopic=301065
FULL PACKAGE
I missed a couple of instructions in the manual install, other files are unaffected.
Full Package
Display matching categories in search results
For OsCommerce 2.2 rc1
This will display matching categories results where the name matches the search, if you have the category description mod
(http://www.oscommerce.com/community/contributions,2343), there is code to include that too.
Also included is code if you have my hide categories contribution (http://addons.oscommerce.com/info/5907).
Included here is an sql query to add a setting in admin to control category search.
If a category is selected in the search, then only that (and subcategories if option set) are searched.
The from / to date filters are also applied.
I`ve also added an option to search categories only.
During the writing of this I found what appears to me to be a vulnerability in the search form in OSC2.2 rc1 where it could be used by a malicious attacker to inject sql or code.
I have added a trap in advanced_search_result.php for this.
Forum started for this at http://forums.oscommerce.com/index.php?showtopic=301065
Note: Contributions are used at own risk.