Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Exclude Words or Phrases from Advanced Search


SuperPower09

Recommended Posts

Sorry if this is a silly/redundant question but I couldn't find the answer to save my life.

So...Is there a way to exclude a phrase or word from within the Advanced Search? 

I could've swore the "NOT" operator was included for this case but I guess not :unsure:

Link to comment
Share on other sites

  • 2 weeks later...

There is no native provision for this.  You might change advanced_search_result.php to add it.  Look for

        case '(':
        case ')':
        case 'and':
        case 'or':
          $where_str .= " " . $search_keywords[$i] . " ";
          break;

and change it to

        case '(':
        case ')':
        case 'and':
        case 'or':
        case 'not':
          $where_str .= " " . $search_keywords[$i] . " ";
          break;

Add one line with not in it.  Then you could use not as you expect. 

I haven't tested this for functionality or efficiency.  Use at your own risk. 

Always back up before making changes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...