Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Could you search the file:
    /includes/functions/functions_lookups.php

    And find the function that starts with:
    Code:
      function zen_get_products_category_id($products_id) {
    and paste the contents here ...

    Also look for the function:
    /admin/includes/functions/general.php

    and find the function that starts with:
    Code:
      function zen_get_products_category_id($products_id) {
    and paste it here as well ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #12
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    Okay. I loaded my website on to my Linux machine running
    LAMPP and the sort function works fine, so I guess your statement
    that the DB is corrupt is the likely culprit.

    The question is, how do I repair the DB ? I see that there is a
    MySql function called mysqlcheck which has an auto-repair
    option. It looks like it needs to be ran on each table that one
    wishes to check/repair. Can you give me a heads up on
    which of the tables might be corrupted and causing the sort
    problem? I don't want to have to run the function on every table
    unless necessary.

    I know this is NOT a MySql forum so if you choose not to answer
    I understand.

    Thanks for all your help.

  3. #13
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Corrupt data could be in a number of tables ...

    There are two kinds of corrupt data ... damaged data that the Repair in phpMyAdmin might by able to fix ... and the corrupt data where you have bad records of data in the database tables and these need to be checked through to try to locate the bad records ...

    Checking for bad records can be hard as there are a lot of checks to be done on the database table records ...

    If you have a good copy of your database, then that can just be reloaded ...

    If you do not, and do not want to manually re-add all of your data, then it might be worthwhile having someone go through your database table records and see if they can spot the problems and clean them up ...

    You might need someone to do this kind of clean up for you and you might post in the Commercial Help Wanted to see if anyone is available to help you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #14
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    Here are the two functions, in the order requested.

    From includes/functions/functions_lookups.php:

    PHP Code:
      function zen_get_products_category_id($products_id) {
        global 
    $db;

        
    $the_products_category_query "select products_id, categories_id from " TABLE_PRODUCTS_TO_CATEGORIES " where products_id = '" . (int)$products_id "'" " order by products_id,categories_id";
        
    $the_products_category $db->Execute($the_products_category_query);

        return 
    $the_products_category->fields['categories_id'];
      } 
    From admin/includes/general.php:

    PHP Code:
      function zen_get_products_category_id($products_id) {
        global 
    $db;

        
    $the_products_category_query "select products_id, categories_id from " TABLE_PRODUCTS_TO_CATEGORIES " where products_id = '" $products_id "'" " order by products_id,categories_id";
        
    $the_products_category $db->Execute($the_products_category_query);

        return 
    $the_products_category->fields['categories_id'];
      } 

    Thanks, John

  5. #15
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    I don't know if this is significant, or not, but when I am in the
    admin, the sort by price works correctly. It is only in the store that
    it does not.

    Also, as I stated earlier, some categories do sort correctly in the store. Seems to be categories that have very few products that
    work, but not ALL categories with only a few products. Seems a bit strange to me.

    Also, I did a check on the two MySql tables that I thought would be relevant to the problem ( zen_products and zen_products_to_categories ) and I do not see anything out of order.

    It would seem to me that if it were a database corruption issue that the problem would also manifest itself in the admin.

    I really appreciate your taking the time to help me on this.

    John
    Last edited by JohnBoyCR; 20 Oct 2010 at 09:29 PM. Reason: additional info

  6. #16
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    By the way, I did reload all my product data. No help.
    I could, I suppose restore a backup. The problem is that I
    am not sure when the problem started and I have not kept backups
    that are older than about 2 months. My BAD ?

    I had a thought about something that I could try. Assuming that
    perhaps some PHP code might be corrupt, if I knew which code
    might be culpable I could try reloading the code from my localhost
    up to the live site. The reason for that is that the sort functions
    appear to work correctly on the localhost. Just a thought!

    Again, thanks for all your help. When we get this fixed I will talk to the store owner and see if we can't send something to the TEAM !
    You folks are great !

    John

  7. #17
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    If you look at those two functions in the Known Bug Fixes you have the wrong ones ...

    You need to fix those functions to what is posted for the bug fix ... and it leads me to think you have other bugs not fixed as well ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #18
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    Thank you. I will go through the list of bug fixes and hopefully fix
    all of the bugs.

    I am still somewhat confused as to why the sort works on my
    localhost server but not on the live server, unless the bug fixes
    had been incorporated into the 1.3.8a download I fetched last
    week.

    Again, thanks for your help.

    John

  9. #19
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    I went through the list of bugs and security patches (about 5
    pages of fixes and bugs) as per the links you sent me, and updated the files.

    The problem still exists so I guess there is most likely a DB
    error. I will use the mysqlcheck function to look for
    corrupt tables in the DB and will let you know the outcome.

    Again, thanks for all your help.

    John

  10. #20
    Join Date
    Jan 2009
    Posts
    201
    Plugin Contributions
    6

    Default Re: Problems with Sort by Price

    Linda,

    I checked the MySql tables using the CHECK TABLE tablename
    function and there do not seem to be any tables that are corrupt.
    I believe that the CHECK TABLE function looks at the keys for
    each table to ensure that links to other tables are not broken, as
    well as other checks.

    This is really puzzling. As the sort by price works in the admin I have to assume (maybe a BAD IDEA) that the DB is okay.
    That leaves me with trying to find out what PHP code might be
    causing the problem.

    As I stated earlier, I made all of the code changes as outlined
    in the link you sent

    http://www.zen-cart.com/forum/showthread.php?t=82619

    so unless I goofed when making the code updates then there is
    still something not quite right. I am going to keep after this until
    I find the solution.

    Thanks again for you help. I will let you know when I find the
    problem.

    John

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Sort by price with column display....
    By barnamania in forum Templates, Stylesheets, Page Layout
    Replies: 100
    Last Post: 21 Apr 2014, 10:50 PM
  2. v151 Product Sort within Category - having problems changing the default sort order
    By Don Wagner in forum Customization from the Admin
    Replies: 4
    Last Post: 21 Oct 2012, 03:03 AM
  3. how to sort products listings with price
    By pavka in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Apr 2008, 08:11 PM
  4. Price = zero Problems with price
    By msbaranga in forum General Questions
    Replies: 1
    Last Post: 11 Sep 2007, 04:07 PM
  5. default sort order by price WITH matrix mod
    By SarahL in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 27 Jul 2007, 08:31 AM

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