Forums / All Other Contributions/Addons / Advanced Search Plus

Advanced Search Plus

Results 1 to 20 of 33
28 Jan 2014, 16:41
#1
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Advanced Search Plus

This contribution expands the advanced search function to Categories, Subcategories and EZ Pages.

Categories, Subcategories - searches in Name and Description
EZ Pages - searches in Title and Html_Text

It will display results for products, categories and EZpages and indicate if there are no matches available.

Updated install instructions and screenshots now included.
03 Feb 2014, 21:46
#3
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: Advanced Search Plus

is it 1.5.0 compatible ??
03 Feb 2014, 21:52
#4
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

I don't have any v1.50 carts to test it on, it should work. You could give it a try or let me know if you'd like me to test it on your cart. Be sure to make backups before making any changes.
21 Feb 2014, 15:24
#5
avansant avatar

avansant

Zen Follower

Join Date:
Aug 2004
Posts:
122
Plugin Contributions:
0

Re: Advanced Search Plus

twitchtoo:

I don't have any v1.50 carts to test it on, it should work. You could give it a try or let me know if you'd like me to test it on your cart. Be sure to make backups before making any changes.


I have a question/need help with your search.

My site has a billion categories, but if you wanted to search for otters, for example, you'd get zero results because the products are only called "otter shirt" using an include that pulls the name of the category into the product name (which was necessary to avoid creating a billion products).

The categories have real names though, so there is a category called "otters." I figured your plugin would be perfect to solve my search by category problem, but there are two snags...

1. The picture for each category says "no image available" instead of pulling the icon for that category.
2. My category descriptions use a trick to pull the name of the category into them (which you were actually helping me with in another thread) so the descriptions of the categories in the search end up like "Embroidered Personalized Gifts for the Lover" instead of "Embroidered Personalized Otter Gifts for the Otter Lover"

Between those two things, it makes it hard to see which result is the one you want. For instance: http://doodlesport.com/super/index.php?main_page=advanced_search_result&search_in_description=1&keyword=otter&x=0&y=0

There is otter in "trotter horse" and "otter"

So... for problem #2 I need to add code like
$current_categories_description = str_replace('<!--category-->', $breadcrumb->last(), $current_categories_description);
Which is how I tricked the descriptions into inserting the category name in the product descriptions, but I'm having trouble figuring out how add category names to the results - they aren't already there.

For problem #1, need to tell it to pull the category pictures. Then, even if the descriptions are goofy, at least the picture will tell them which is the right result.

Hope that makes sense! Happy to pay you for your help.
21 Feb 2014, 22:10
#6
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

It looks like this no_picture image is a bug, I'm working on the fix as I type this :)
22 Feb 2014, 05:56
#7
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

twitchtoo:

It looks like this no_picture image is a bug, I'm working on the fix as I type this :)


The bug fix is here...
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_advanced_search_categories.php


Line 82 - 86 - replace this:

if ($listing->fields['categories_image'] == '') {
$lc_text .= '<img src="images/no_picture.jpg" width='.IMAGE_PRODUCT_LISTING_WIDTH.' height='.IMAGE_PRODUCT_LISTING_HEIGHT.'/></a>';
} else {
$lc_text .= zen_image(DIR_WS_IMAGES . $listing->fields['categories_image'], $listing->fields['category_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
}


With this:
$lc_text .= zen_image(DIR_WS_IMAGES . zen_get_categories_image($listing->fields['categories_id']), $listing->fields['category_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) . '</a>'; // if ($listing->fields['categories_image'] == '') {
// $lc_text .= '<img src="images/no_picture.jpg" width='.IMAGE_PRODUCT_LISTING_WIDTH.' height='.IMAGE_PRODUCT_LISTING_HEIGHT.'/></a>';
// } else {
// $lc_text .= zen_image(DIR_WS_IMAGES . $listing->fields['categories_image'], $listing->fields['category_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
// }


And you should see category images if they exist. I'll add this bug fix to the next release of Advanced Search Plus :)


If you haven't already, install Admin Display Product/Catalog Thumbnails so you can see the category images in the admin - category/product listing.

Located here:

http://www.zen-cart.com/downloads.php?do=file&id=1346
22 Feb 2014, 06:01
#8
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

On to your second question...

avansant:


2. My category descriptions use a trick to pull the name of the category into them (which you were actually helping me with in another thread) so the descriptions of the categories in the search end up like "Embroidered Personalized Gifts for the Lover" instead of "Embroidered Personalized Otter Gifts for the Otter Lover"

$current_categories_description = str_replace('<!--category-->', $breadcrumb->last(), $current_categories_description);
Which is how I tricked the descriptions into inserting the category name in the product descriptions, but I'm having trouble figuring out how add category names to the results - they aren't already there.


If you look in the same file as the bug fix in my last post, line 76 holds the category_description output. Try your new description code there... I would try it myself but the last coffee is finally wearing off it's sleep time.
22 Feb 2014, 14:34
#9
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

Advanced Search Plus 2.02 has been submitted for review.

It's also available on my site if you can't wait :)
23 Feb 2014, 14:25
#10
avansant avatar

avansant

Zen Follower

Join Date:
Aug 2004
Posts:
122
Plugin Contributions:
0

Re: Advanced Search Plus

Hm. Looks like my post here didn't save - I did get the photo to show up using your instructions, thank you so much! I sent you some coffee money through your site. I can't get my dynamic category keywords to show up though. Using your direction I looked at the code near line 76 and tried

$zen_get_category_description = str_replace('<!--category-->', $categories_name, $zen_get_category_description);
I tried
$current_categories_description = str_replace('<!--category-->', $categories_name, $current_categories_description);

too

but that didn't work. Any idea how I can finish this bit? I'm using the wrong code for calling either the description or the category name for this file, but I can't figure out where I'm going wrong.
23 Feb 2014, 17:36
#11
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

This code:
switch ($column_list_cat[$col]) {
case 'CATEGORY_LIST_NAME':
$lc_align = 'left';
$lc_text = '<h3 class="itemTitle"><a href="'
. zen_href_link(FILENAME_DEFAULT, $cPath_new). '">' . $listing->fields['categories_name'] . '</a></h3><div class="listingDescription">'
. zen_trunc_string(zen_clean_html(stripslashes(zen_get_category_description($listing->fields['categories_id'], $_SESSION['languages_id']))))
. '</div>' ;
break;

Gets populated by this filter:
zen_get_category_description

So you could change the normal output of the description in the core file so it's consistent site wide.
- includes/functions/functions_lookups.php

OR

Restructure the variable on the page before it displays the output.
- includes/templates/YOUR_TEMPLATE/templates/tpl_modules_advanced_search_categories.php

$avansant_category_desc = 'add your custom script here'

Look over the file, trace the variables back to the source SQL query before randomly calling functions... echo and print_r are your friends ;)

I like core changes, one change - site wide application, less processing.

And thank you for the coffee, I'm enjoying one now :)
12 May 2014, 16:25
#12
axeman avatar

axeman

New Zenner

Join Date:
Dec 2013
Posts:
51
Plugin Contributions:
0

Re: Advanced Search Plus

Hi. I am looking to add an Exact Match function to the advanced search. I have listings that are partly the same name.

Example

OKI C510
OKI C510DN
OKI C5100

If I put OKI C510 into the search bar it will pull up the listing for C510DN and C5100 as well. Is there a way to filter this out as it I would have to create literally thousands of categories if I had to sort them into individual ones.

I would like to put in OKI C510 into the search bar and only see the exact match, not the variations that contain the same sequence of numbers and letters.
12 May 2014, 16:32
#13
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

In theory, you need to change the search 'LIKE' to 'EQUALS'

Or use the SQL boundaries search to match the whole word.

That way it's not looking for everything, it's only looking for exact matches to the keyword you have typed in.
15 May 2014, 02:08
#14
axeman avatar

axeman

New Zenner

Join Date:
Dec 2013
Posts:
51
Plugin Contributions:
0

Re: Advanced Search Plus

Do you think that it could be integrated into the advanced search function or would that upset the working of it? From the way my toner/ink cartridge finder would need to search i would need to have a more refined search than the standard and also your addon search. Instead of a generic search, pulling out everything that has part of the search term in it, it would need to filter out anything that isn't an exact match.

Have you any ideas for coding this as an option so that the filtering is reflected in the domain name which could be copied and pasted into the links for my cartridge finder? I can get round it to a degree but I may lose custom because only certain products would be shown instead of the complete range of options for a customer's printer. The other thing is that if the general search were to be too specific people would not be able to see all of the available options for their product, whereas if it was an option it could be usefull for both my customer and me.
17 Oct 2014, 08:35
#15
puhycz avatar

puhycz

New Zenner

Join Date:
Apr 2014
Posts:
21
Plugin Contributions:
0

Re: Advanced Search Plus

Hi, I have problem with this plugin. It works all great, but no showing catregory name in results. The $listing->fields['categories_id'] in tpl_modules_advanced_search_categories.php is clean... Where will be problem?

Many thanks.
19 Oct 2014, 19:02
#16
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

Axeman:

Do you think that it could be integrated into the advanced search function or would that upset the working of it? From the way my toner/ink cartridge finder would need to search i would need to have a more refined search than the standard and also your addon search. Instead of a generic search, pulling out everything that has part of the search term in it, it would need to filter out anything that isn't an exact match.

Have you any ideas for coding this as an option so that the filtering is reflected in the domain name which could be copied and pasted into the links for my cartridge finder? I can get round it to a degree but I may lose custom because only certain products would be shown instead of the complete range of options for a customer's printer. The other thing is that if the general search were to be too specific people would not be able to see all of the available options for their product, whereas if it was an option it could be usefull for both my customer and me.


Although we could change the search engine, it may be beneficial to run a VB script on your database. In the past I've created searchable indexes with automation scripts that actually put a static 'label' or 'model' or 'sku' in a new searchable field. This is always 100% compatible with every new version of zen and super fast and easy to change if ever you need to.

Instead of searching everything for something, search one column for everything. Reduces processing time to boot.
19 Oct 2014, 19:03
#17
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

puhycz:

Hi, I have problem with this plugin. It works all great, but no showing catregory name in results. The $listing->fields['categories_id'] in tpl_modules_advanced_search_categories.php is clean... Where will be problem?

Many thanks.


I need to see your site files to check, I emailed you.
30 Oct 2014, 08:41
#18
puhycz avatar

puhycz

New Zenner

Join Date:
Apr 2014
Posts:
21
Plugin Contributions:
0

Re: Advanced Search Plus

So, I send two emails, do you receive it? Thanks.
29 Mar 2015, 21:46
#19
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

puhycz:

So, I send two emails, do you receive it? Thanks.


Sorry no, please try again mate.
29 Mar 2015, 21:48
#20
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Posts:
1,732
Plugin Contributions:
11

Re: Advanced Search Plus

Advanced Search Plus for Zen Cart v1.54 is complete.

Check the forum plugins or my website for your copy.

What's new:
- forum bug fixes installed
- instructions re-written entirely
- screenshots included
- simplified fileset included and installed on stock Zen Cart 1.54
- separate security install instructions for anyone using Twitch Restrict with this module

As will all of the other modules I support, there's a stock zc v1.54 live/admin demo site available on my site.