Zen Cart Logo
Forums / All Other Contributions/Addons / Product Finder: multiple category drop-downs

Product Finder: multiple category drop-downs

Views: 48,918

Results 181 to 200 of 225
8 Oct 2014, 4:11 PM
#181
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Product Finder: multiple category drop-downs

Ok, so I didn't get around to uploading a new version as life got in the way/ I have a business to run...

Meanwhile recently I started to get mysql out of memory errors due to this mod...so I have had to understand more how it works.
I found that when the page first loads it checks through all the the categories and subcategories to see if there are enabled products in there before generating the initial drop down list. For me this is unecessary so after stopping this I reduced the average queries on pageload from 3800 to 200!!!

While I have done other minor things to improve this mod, I still want to improve the code and the documentation to enable people to customise it easier so pm me for the current version if you want to be a guinea pig.

Meanwhile you can try this simple change to reduce the queries (enable the page parse time first to see the difference), and see if it still works for you in your implementation.

In the functions/product_finder.php, find this bit:

while (!$categories->EOF) {
if (zen_products_in_category_count($categories->fields['categories_id'], true, true) >= 1) {
$category_tree_array[] = array('id' => $categories->fields['categories_id'], 'text' => $categories->fields['categories_name']);
}
$categories->MoveNext();

and comment out the if clause to stop it running the function zen_products_in_category_count:

while (!$categories->EOF) {
// if (zen_products_in_category_count($categories->fields['categories_id'], true, true) >= 1) {
$category_tree_array[] = array('id' => $categories->fields['categories_id'], 'text' => $categories->fields['categories_name']);
//}
$categories->MoveNext();

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

5 Sep 2015, 8:35 PM
#182
jerr avatar

jerr

New Zenner

Join Date:
Sep 2010
Location:
California
Posts:
22
Plugin Contributions:
0

Re: Product Finder: multiple category drop-downs

I have been playing around with this YMM option and have some found ways to create a database that works and can be manipulated for products. The only problem is that my approach, at least with the database, is the size. I am using tires as an example and it is a monster. The format works though and may be useful for a smaller database.

Here is the link to my test site. Check it out and if you have questions send them to me and I will try to answer them.
http://www.tireup.one

8 Sep 2015, 12:00 PM
#183
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Product Finder: multiple category drop-downs

I have been playing around with this YMM option and have some found ways to create a database that works and can be manipulated for products.
Sorry, I have no idea what YMM means or what you are implying by a "database that works" etc., please elucidate,
thanks
Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

10 Feb 2016, 1:19 PM
#184
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

Version 1.0 is soon to be released. This joint venture between torvista and me, brings a largely rewritten module.

  • The code has been rewritten to be more efficient with server resources.
  • An admin configuration menu has been added the make easier configuration.
  • files have been updated to Zen Cart 1.5.4 standard.
  • Jquery files have been removed form the package

The only thing remaining to do is to update the readme and do some final testing. The goal is to submit the new package by Monday

1 May 2016, 8:04 PM
#185
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Product Finder: multiple category drop-downs

Note that in Zen Cart 1.55, this change was made in html_output.php:
ZC154

function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select name="' . zen_output_string($name) . '"';
    if (zen_not_null($parameters)) $field .= ' ' . $parameters;
    $field .= '>' . "\n";

ZC155

function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select';
    if (!strstr($parameters, 'id=')) $field .= ' id="select-'.zen_output_string($name).'"';
    $field .= ' name="' . zen_output_string($name) . '"';

So if calling this function with no id/letting it generate the id itself, as in the case of this mod, the id now gets prefixed with select- and breaks the mod and any associated css.
So, you need to pass the ids in the function call to restore functionality.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

22 May 2016, 5:18 PM
#186
jerr avatar

jerr

New Zenner

Join Date:
Sep 2010
Location:
California
Posts:
22
Plugin Contributions:
0

Re: Product Finder: multiple category drop-downs

Jerr:

I have been playing around with this YMM option and have some found ways to create a database that works and can be manipulated for products. The only problem is that my approach, at least with the database, is the size. I am using tires as an example and it is a monster. The format works though and may be useful for a smaller database.

Here is the link to my test site. Check it out and if you have questions send them to me and I will try to answer them.
http://www.tireup.one

Steve I am sorry It has taken me so long to reply to your message. I was actually referring to your PRODUCT FINDER app.
Also I have moved my site to http://www.tireup.byethost3.com. I have been and still am in the process of developing this site so i have placed it on a free hosting site.

24 May 2016, 10:32 AM
#187
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Product Finder: multiple category drop-downs

Note that there is a revised version incorporating many changes on github:
https://github.com/Zen4All/Zen-Cart-Product-Finder

Try this and report issues on github.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

17 Apr 2019, 1:56 PM
#189
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

Design75:

Sorry for still not releasing the new version, but I am to busy with other things.
So it's almost 3 years later, and I almost have it finished :blush:. To be honest I all forgot about this mod.
For Those interested the development version can be found here: https://github.com/Zen4All-nl/Zen-Cart-Product-Finder/tree/develop

Please post any issues on Github, so I can keep track.

18 Apr 2019, 2:42 PM
#190
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

So finally Beta 1 is ready for testing.
https://github.com/Zen4All-nl/Zen-Cart-Product-Finder/releases/tag/1.0.0-beta1

  • The mod has been updated to work with Zen Cart 1.5.5 and newer
  • php 7.2 and newer
  • make use of the native ajax functionality
  • simplify the overall coding

Please let me know your findings, and I will update the documentation in the meantime.

28 Apr 2019, 2:08 PM
#191
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

Version 1.0.0 has been submitted fro review.

  • Integrated sidebox version
  • Moved to Zen Cart core ajax functionality
  • PHP 7.3 compatibility
  • Added auto-installer
24 May 2019, 9:20 AM
#192
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Product Finder: multiple category drop-downs

  • Moved to Zen Cart core ajax functionality

The javascript in this plugin watches for a dropdown change, then updates the next one.
What is the advantage in having the "waching" javascript pass the dropdown data to the ajax code, then get the array back to update the next dropdown, as opposed to doing that in the same javascript block as it did orginally?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

24 May 2019, 11:12 AM
#193
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

Nothing has changed in that functionality.
In previous versions there was a custom ajax function that called modellist,php in the root of the store. Now the core ajax function calls "includes/classes/ajax/zcAjaxProductFinderCats.php"
Except for some code modernizing updates it functions the same as first.

Do you have another version? That works in a different way? If you do I am always willing to take a look and see if things can be improved/simplified.

torvista:

The javascript in this plugin watches for a dropdown change, then updates the next one.
What is the advantage in having the "waching" javascript pass the dropdown data to the ajax code, then get the array back to update the next dropdown, as opposed to doing that in the same javascript block as it did orginally?

24 May 2019, 1:48 PM
#194
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Product Finder: multiple category drop-downs

If you do I am always willing to take a look and see if things can be improved/simplified.

Ha, since you are asking....I have just finished a major revision of it.
https://github.com/torvista/zen-cart_Product-Finder

As usual, I started tinkering then went too far, so decided it was not really something to submit a PR to your fileset.

  • It deals better with people doing odd things with the drop-downs both with/without JS.
  • made dd names consistent (no conflicts with id of cPath with other things)
  • removed tpl_product_finder as a template file. I preferred the dropdown code in a single module so the same code is used by the template block OR the sidebox. Easier to deal with more dropdowns/expansion.
  • css redone so it looks ok in the responsive template from installation.
  • ajax had a load of category array stuff, that didn't seem required: changed to use the single new function
  • noscript support redone completely, still a dogs dinner, should be dropped completely.
  • changed incorrect texts for installer. I don't see any need for an admin page, apart from a heads-up that the plugin is installed on the site, the options will never be changed.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

24 May 2019, 2:07 PM
#195
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

I'll take a look and test it. After that I'll make new updated version 1.x

Colaboration will be easier if you use a fork of my repo https://github.com/Zen4All-nl/Zen-Cart-Product-Finder

torvista:

Ha, since you are asking....I have just finished a major revision of it.
https://github.com/torvista/zen-cart_Product-Finder

As usual, I started tinkering then went too far, so decided it was not really something to submit a PR to your fileset.

  • It deals better with people doing odd things with the drop-downs both with/without JS.
  • made dd names consistent (no conflicts with id of cPath with other things)
  • removed tpl_product_finder as a template file. I preferred the dropdown code in a single module so the same code is used by the template block OR the sidebox. Easier to deal with more dropdowns/expansion.
  • css redone so it looks ok in the responsive template from installation.
  • ajax had a load of category array stuff, that didn't seem required: changed to use the single new function
  • noscript support redone completely, still a dogs dinner, should be dropped completely.
  • changed incorrect texts for installer. I don't see any need for an admin page, apart from a heads-up that the plugin is installed on the site, the options will never be changed.
19 Nov 2019, 5:55 PM
#196
racingaddiction avatar

racingaddiction

New Zenner

Join Date:
Apr 2019
Location:
Newport Beach, CA
Posts:
80
Plugin Contributions:
0

Re: Product Finder: multiple category drop-downs

I browsed through the thread, my question is how subcat is used - does this mean a product has to have subcategories to store the year, make & model data? I'm sorry, I don't see where the plugin gets the data in order to filter.

2nd question, can a year range be used? The raw file we'll be pulling product info is constructed as follows, I'll need to massage it so the years are four digits each:

Attachment 18719

19 Nov 2019, 6:19 PM
#197
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Product Finder: multiple category drop-downs

RacingAddiction:

I browsed through the thread, my question is how subcat is used - does this mean a product has to have subcategories to store the year, make & model data? I'm sorry, I don't see where the plugin gets the data in order to filter.

2nd question, can a year range be used? The raw file we'll be pulling product info is constructed as follows, I'll need to massage it so the years are four digits each:

Attachment 18719
The module gets it information from 3 category layers.
You make a category tree placing the products in the third layer.

I am typing this on my mobile, so if you need more info maybe someone else can elaborate, or els I'll get back to you tomorrow.

19 Nov 2019, 6:43 PM
#198
racingaddiction avatar

racingaddiction

New Zenner

Join Date:
Apr 2019
Location:
Newport Beach, CA
Posts:
80
Plugin Contributions:
0

Re: Product Finder: multiple category drop-downs

Yes I'd like more information, it sound like a great add-on. Since we have several hundred seat bases (for the above example) I'd be interested to see how the seat base product would be configured.

Thanks!

19 Nov 2019, 10:06 PM
#199
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,875
Plugin Contributions:
7

Re: Product Finder: multiple category drop-downs

The instructions in the plugin explain everything. I have it in use on my site (see profile homepage).

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

21 Nov 2019, 5:34 PM
#200
racingaddiction avatar

racingaddiction

New Zenner

Join Date:
Apr 2019
Location:
Newport Beach, CA
Posts:
80
Plugin Contributions:
0

Re: Product Finder: multiple category drop-downs

I downloaded and reviewed the documentation, it looks like a great plugin.

Per my screenshot, we're (trackreadyproducts.com) selling performance seats and each seat requires a seat base, sold separately. I'd configure the plugin as in the documentation: Make - Model - Year.

I don't think it does, but as each seat base can fit multiple vehicle brands and models, is this an issue? Has anyone loaded sub-categories and sub-sub-categories with a load file? There's hundreds and hundreds of seat bases.

Thank you!