Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default LIMIT amount of option values displayed in Option Value Manager

    I'm using Zen Cart 1.5.6b. I would like to limit the total number of Option Values pulled from the database to be accessed by this section. We have 10s of thousands of option values and it's slowed the option value manager page down way too much. I've seen in the option_values_manager.php file where there is a mySQL statement of SELECT * ..... in order to check the values for corruption but I was wondering if anyone knew where I could add a LIMIT to a mySQL statement to have it only pull the first 500 values or so. I'm not trying to limit how many appear on each page, I know that is done in the configuration. I'm trying to modify the php file's database call in order to add a LIMIT clause so it doesn't have to pull every single option value in order to properly build the page. Thanks in advance for your help!

  2. #2
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    I see a line containing
    $products_values = $db->Execute("SELECT p.products_id, pd.products_name, po.products_options_name, pa.options_id
    FROM " . TABLE_PRODUCTS . " p,
    " . TABLE_PRODUCTS_ATTRIBUTES . " pa,
    " . TABLE_PRODUCTS_OPTIONS . " po,
    " . TABLE_PRODUCTS_DESCRIPTION . " pd
    WHERE pd.products_id = p.products_id
    AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
    AND po.language_id = " . (int)$_SESSION['languages_id'] . "
    AND pa.products_id = p.products_id
    AND pa.options_values_id = " . (int)$_GET['value_id'] . "
    AND po.products_options_id = pa.options_id
    ORDER BY pd.products_name");

    Would this perhaps be where I would add the LIMIT after ORDER BY?

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    That query is only applicable to when deleting an option value.

    A query related to display of the current items is associated with $values_query_raw, but that query is sent through the splitPageResults class so that it only looks at the "portion" of items to be displayed... What value do you have for configuration->Maximum->Products Attributes - Option Names and Values Display?

    The number presented there should apply the limit that you are seeking when preparing to show the information. Otherwise, there is a possible "delay" in loading earlier on in the file where it is addressing "damaged database, caused by users indiscriminately deleting table data".
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    A search for $values_query_raw in the developer toolkit brings up nothing across all PHP files in the catalog and admin. I'm working a non-zencart solution for the option managament but for now I really just need to limit the amount of options values it's listing to 500. I know this would keep any backend users from accessing pages of values beyond the first 500 but is exactly as I intend. I tried limiting the statement $values = "SELECT pov.products_options_values_id........ on lines 665 - 673 to 500 and that had the pagination reduce as intended but no values appear in the table. It just states "an error occurred" with no log. What am I missing?

  5. #5
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    Quote Originally Posted by clam_man View Post
    A search for $values_query_raw in the developer toolkit brings up nothing across all PHP files in the catalog and admin. I'm working a non-zencart solution for the option managament but for now I really just need to limit the amount of options values it's listing to 500. I know this would keep any backend users from accessing pages of values beyond the first 500 but is exactly as I intend. I tried limiting the statement $values = "SELECT pov.products_options_values_id........ on lines 665 - 673 to 500 and that had the pagination reduce as intended but no values appear in the table. It just states "an error occurred" with no log. What am I missing?
    I'm not finding reference to the information provided above: I was looking in the admin attributes_controller and not finding a similar sql statement. As to not receiving a log, well, there are any of likely reasons for not "seeing" it. Look in the docs website about logs. Basically, you may have to many debug logs for a new one to be generated or possibly be retrieved. Possibly logging may be disabled for any number of reasons, etc.

    Providing the entire sql statement in a post may help suss the issue, further providing the code on that area may help as well. It may be necessary to change the Execute portion of the query to there provide the limit instead of in the query itself.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    Quote Originally Posted by mc12345678 View Post
    I'm not finding reference to the information provided above: I was looking in the admin attributes_controller and not finding a similar sql statement. As to not receiving a log, well, there are any of likely reasons for not "seeing" it. Look in the docs website about logs. Basically, you may have to many debug logs for a new one to be generated or possibly be retrieved. Possibly logging may be disabled for any number of reasons, etc.

    Providing the entire sql statement in a post may help suss the issue, further providing the code on that area may help as well. It may be necessary to change the Execute portion of the query to there provide the limit instead of in the query itself.
    Sorry, I see now... admin/options_values_manager.php. apparently my previous response was not in direct reference to Zen Cart 1.5.6, but instead later versions where that query was modified and better supports the kind of effect desired. Not sure if just using the Zen Cart 1.5.7 of the file would work or if additional effort would be needed such as actually upgrading or just incorporating some of the associated features in that area of code.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    I'm currently on 1.5.6b but I could try moving things over to 1.5.7 if that will give me more functionality in the option value manager php file.

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    Quote Originally Posted by clam_man View Post
    I'm currently on 1.5.6b but I could try moving things over to 1.5.7 if that will give me more functionality in the option value manager php file.
    Ideally would move to 1.5.8 (currently released version), but yes should always use the latest or at least more recent. Also, yes such newer versions would better support your desired result.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Jun 2019
    Location
    Austin TX
    Posts
    45
    Plugin Contributions
    0

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    Ah, I finally figured out how to do what I wanted. I was able to work a solution that didn't have to modify the query_factory.php. Thanks for your help though!

  10. #10
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,133
    Plugin Contributions
    11

    Default Re: LIMIT amount of option values displayed in Option Value Manager

    Quote Originally Posted by clam_man View Post
    Ah, I finally figured out how to do what I wanted. I was able to work a solution that didn't have to modify the query_factory.php. Thanks for your help though!
    This is where you let the world know what it took to get it going. Karnac has left the building.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Problem with Attributes Controller, Option Name Manager, Option Value Manager
    By Wulf359 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 27 Jun 2013, 08:54 PM
  2. attribute option Values is there a limit
    By cshart in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 7 Jan 2011, 11:52 AM
  3. Attributes Controller - Increasing rows displayed for Option Name and Option Value?
    By ThisSideOfTheCross in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 23 Apr 2010, 05:13 AM
  4. v1.3.7 Option Values Manager lost value parts
    By asknight in forum Bug Reports
    Replies: 1
    Last Post: 10 Jan 2007, 07:57 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