Forums / All Other Contributions/Addons / Search: Prioritize Matching Names [Support Thread]

Search: Prioritize Matching Names [Support Thread]

Views: 6,562

Results 1 to 19 of 19
30 Oct 2015, 6:31 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Search: Prioritize Matching Names [Support Thread]

As this thread highlighted, equal weight is given to all products matching the search keywords ... whether the match was found in the product's name, model-number, manufacturers name, meta tags or (if requested) its description. As @lloyd_borrett indicated in that thread, that can mean that products whose ***names ***match those keywords might wind up "below the fold" -- where they're probably the most relevant!

This simple plugin updates the SQL query used on the "Advanced Search Results" page, giving a higher priority to those products whose names match the keywords.

Note: Since this plugin makes use of the auto-loaded observers feature introduced in Zen Cart v1.5.3, the plugin will operate properly only on Zen Cart versions v1.5.3 and later.

I'll be submitting to the Plugins shortly and will update this thread with the download link once I've got it.

3 Nov 2015, 8:17 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

The plugin is now available for download!

29 Dec 2015, 8:34 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

This plugin is compatible with Zen Cart versions v1.5.3 to v1.5.5.

7 Apr 2017, 9:35 PM
#5
monkeyjr47906 avatar

monkeyjr47906

New Zenner

Join Date:
Nov 2007
Posts:
72
Plugin Contributions:
0

Re: Search: Prioritize Matching Names [Support Thread]

Do you have any suggestions for how to make this plug in work with the dynamic filter mod? https://www.zen-cart.com/downloads.php?do=file&id=1361

It works perfectly, but it breaks the dynamic filter.

8 Apr 2017, 11:34 AM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

In what way does it "break" the dynamic filter?

10 Apr 2017, 2:36 PM
#7
monkeyjr47906 avatar

monkeyjr47906

New Zenner

Join Date:
Nov 2007
Posts:
72
Plugin Contributions:
0

Re: Search: Prioritize Matching Names [Support Thread]

Here is the error from the log ...

PHP Fatal error: 1054:Unknown column 'in_name' in 'order clause' :: SELECT p.products_id, p.products_price_sorter, p.master_categories_id, p.manufacturers_id FROM products p LEFT JOIN manufacturers m USING(manufacturers_id) LEFT JOIN products_description pd on p.products_id = pd.products_id JOIN products_to_categories p2c on p.products_id = p2c.products_id JOIN categories c on p2c.categories_id = c.categories_id LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 WHERE (p.products_status = 1
AND pd.language_id = 1 AND ((pd.products_name LIKE '%mighty%'
OR p.products_model
LIKE '%mighty%'
OR m.manufacturers_name
LIKE '%mighty%' OR (mtpd.metatags_keywords
LIKE '%mighty%'
AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description
LIKE '%mighty%'
AND mtpd.metatags_description !='') OR pd.products_description
LIKE '%mighty%') )) GROUP BY p.products_id order by in_name DESC, p.products_sort_order, pd.products_name ==> (as called by) /home/account/public_html/includes/templates/templatename/sideboxes/tpl_dynamic_filter.php on line 63 <== in /home/account/public_html/includes/classes/db/mysql/query_factory.php on line 167

10 Apr 2017, 3:38 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

That's because the Dynamic Filter (whatever version you're running) is stripping out the name-select clause that is added by this plugin.

I suggest that you take the issue to the Dynamic Filter's support thread (https://www.zen-cart.com/showthread.php?193289-Dynamic-Filter-Support-Thread) for resolution.

25 May 2021, 6:02 PM
#9
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: Search: Prioritize Matching Names [Support Thread]

lat9 you did great with this mod. There is one thing you can do to make it even greater....

So my customer looks for "Ford Trucks" .... but because all my trucks are sold as a "truck" instead of multiples they do not show up in search. :( If you could check the keyword and if it ends in "s" or "es" ... if you could strip those last 1 or 2 characters and run it through the "like" it would make this so awesome.

25 May 2021, 7:03 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

shrimp-gumbo-mmmhhh:

lat9 you did great with this mod. There is one thing you can do to make it even greater....

So my customer looks for "Ford Trucks" .... but because all my trucks are sold as a "truck" instead of multiples they do not show up in search. :( If you could check the keyword and if it ends in "s" or "es" ... if you could strip those last 1 or 2 characters and run it through the "like" it would make this so awesome.
That's, unfortunately, outside the scope of this plugin. There's also the underlying issue that different languages handle plural indications differently.

26 Oct 2021, 6:19 PM
#11
chuckrey avatar

chuckrey

Zen Follower

Join Date:
Aug 2020
Location:
Richarson
Posts:
160
Plugin Contributions:
0

Re: Search: Prioritize Matching Names [Support Thread]

Will this plugin display matching names and product images as the user types in the search box? For example.. Customer types 512 and everything that has 51278 will display under the search button and as they type more, it will list specifically what the customer is looking for?

26 Oct 2021, 7:10 PM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

chuckrey:

Will this plugin display matching names and product images as the user types in the search box? For example.. Customer types 512 and everything that has 51278 will display under the search button and as they type more, it will list specifically what the customer is looking for?
Nope, it provides an additional input for the search when a customer clicks the "Search" button. You're looking for an AJAX search.

26 Oct 2021, 7:37 PM
#13
chuckrey avatar

chuckrey

Zen Follower

Join Date:
Aug 2020
Location:
Richarson
Posts:
160
Plugin Contributions:
0

Re: Search: Prioritize Matching Names [Support Thread]

lat9:

Nope, it provides an additional input for the search when a customer clicks the "Search" button. You're looking for an AJAX search.

Thanks for the response. That will help me to narrow down my search.
:smile:

9 Nov 2022, 7:25 PM
#16
njcyx avatar

njcyx

Zen Follower

Join Date:
Apr 2019
Posts:
374
Plugin Contributions:
0

Re: Search: Prioritize Matching Names [Support Thread]

Have anyone tried this plug-in (Prioritize Matching Names) on zc1.58? I tried it today and it didn't work. No log file is generated.

9 Nov 2022, 9:45 PM
#17
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

njcyx:

Have anyone tried this plug-in (Prioritize Matching Names) on zc1.58? I tried it today and it didn't work. No log file is generated.
Since it's a primarily AJAX plugin, check the browser's console log to see if anything shows up there.

27 May 2024, 12:58 PM
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

v1.0.1 of "Prioritize Matching Names" is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2038

This release contains changes associated with the following GitHub issues:

#2: Bracket in search terms not ignored in query construction
#3: Define class property for PHP 7.4+

It's been validated on Zen Cart versions 1.5.8a and later and requires a PHP version 7.0 or later.

4 Oct 2024, 3:10 PM
#19
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Search: Prioritize Matching Names [Support Thread]

v2.0.0 of Prioritize Matching Names is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2038

This version requires a minimum Zen Cart version of 2.0.0 for its proper operation.