PDA

View Full Version : Advanced Search with Attributes



michael_s
12-06-2014, 06:57 PM
After implementing a couple different contributions to provide advanced search capabilities that were not delivering exactly what I was looking for in an advanced search capability I decided to develop my own version based upon my company’s needs.

This contribution is built upon the contributions provided by the following:
SiteSearch Plus - Jack York
Search Description simple mod - Gabin
Advanced Search - Attributes - Adam

The most prominent issue was that all of the attributes were displaying regardless of the language. So this contribution is based upon on one Option, for my web site that would be colors.

My site is using MySQL 5.5.27, PHP 8.3.28, and osCommerce 2.2 versions.

The files that are affected:
catalog/advanced_search.php
catalog/advanced_search_result.php
catalog/includes/functions/general.php

In addition, it includes the language files for four languages that I support:
catalog/includes/languages/english/advanced_search.php
catalog/includes/languages/espanol/advanced_search.php
catalog/includes/languages/french/advanced_search.php
catalog/includes/languages/german/advanced_search.php

The code changes provide a drop-down box of the attributes (colors) specific to the language chosen by the customer. The box is populated by a new function in the general.php file called get_attributes. The Title for the drop-down box is defined in the language files using the new text constants ENTRY_ATTRIBUTES and TEST_ALL_ATTRIBUTES similar to the way that the search for manufacturers. The attribute chosen has its id passed to advanced_search_result and therefor there is no need to deal with blanks or other characters in the attribute text. The advanced_search_result also allows the Quick Search to include the description.

More... (http://addons.oscommerce.com/info/9181)