Page 19 of 23 FirstFirst ... 91718192021 ... LastLast
Results 181 to 190 of 224
  1. #181
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default reducing queries

    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: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  2. #182
    Join Date
    Sep 2010
    Location
    California
    Posts
    22
    Plugin Contributions
    0

    Default Re: reducing queries

    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

  3. #183
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: reducing queries

    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: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  4. #184
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: reducing queries

    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

  5. #185
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: reducing queries

    Note that in Zen Cart 1.55, this change was made in html_output.php:
    ZC154
    PHP Code:
    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
    PHP Code:
    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: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  6. #186
    Join Date
    Sep 2010
    Location
    California
    Posts
    22
    Plugin Contributions
    0

    Default Re: reducing queries

    Quote Originally Posted by Jerr View Post
    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.

  7. #187
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,571
    Plugin Contributions
    30

    Default Re: reducing queries

    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: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  8. #188
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: reducing queries

    Sorry for still not releasing the new version, but I am to busy with other things.

  9. #189
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: reducing queries

    Quote Originally Posted by Design75 View Post
    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 . 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-Ca...r/tree/develop

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

  10. #190
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default 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.

 

 
Page 19 of 23 FirstFirst ... 91718192021 ... LastLast

Similar Threads

  1. Product Quantities as Drop Downs?
    By ehdesign in forum General Questions
    Replies: 3
    Last Post: 25 Jun 2011, 06:21 PM
  2. 2 questions on tab category drop downs
    By deemurphy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 14 Apr 2010, 02:29 PM
  3. I'm new ~ Trying to enter product with several drop downs
    By skirch in forum General Questions
    Replies: 2
    Last Post: 25 Mar 2009, 01:24 AM
  4. Category Heading - can't remove w/drop downs
    By Terry111 in forum Basic Configuration
    Replies: 3
    Last Post: 20 Sep 2008, 09:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR