Results 1 to 9 of 9

1054 Error on Advanced Search - other suggestions haven't worked ???

This is a discussion on 1054 Error on Advanced Search - other suggestions haven't worked ??? within the osCmax v2 Installation issues forums, part of the osCmax v2.0 Forums category; Hi, I have a 1054 error on advanced search as per below and I have tried all the suggestions with ...

      
  1. #1
    Member
    Join Date
    May 2009
    Posts
    45
    Rep Power
    0


    Default 1054 Error on Advanced Search - other suggestions haven't worked ???

    Hi, I have a 1054 error on advanced search as per below and I have tried all the suggestions with regards to fixing the error however obviously I am missing something. These are 2 old carts 2.0.4 . I fixed the 1054 error on the index page but the advanced search is doing my head in The Server has just upgraded mysql to 5 hence the error on the old carts




    1054 - Unknown column 'p.products_id' in 'on clause'

    select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c left join tax_rates tr on p.products_tax_class_id = tr.tax_class_id left join zones_to_geo_zones gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '13') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '182') where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= 1)

    [TEP STOP]

    Have changed the advanced_search_results.tpl.php in the main and template without success

    Any help would be greatly appreciated. Even if I could disable the advanced search would be great but attempted this and still got the 1054 error

    Thank you in advance.

    Regards
    Giga

  2. #2
    Member
    Join Date
    May 2009
    Posts
    45
    Rep Power
    0


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    Update: Code for advanced search result.tpl.php and the same file in my tempalate;


    ==============================================

    $from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";


    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
    if (!tep_session_is_registered('customer_country_id') ) {
    $customer_country_id = STORE_COUNTRY;
    $customer_zone_id = STORE_ZONE;
    }
    $from_str .= (" left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id) left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
    }
    =======================================

    This throws up the following error:
    Parse error: syntax error, unexpected ';' in /home/****/public_html/cart/templates/***/content/advanced_search_result.tpl.php on line 70

    ++++++++++++++++++++++++++++

    Unfortunately I'm not great with php and am only learning so I just can't manage to find the error?

    thanks
    giga

  3. #3
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,124
    Rep Power
    55


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    Can you post just line 70 of advanced_search_result.tpl.php?
    pgmarshall
    _______________________________

  4. #4
    Member
    Join Date
    May 2009
    Posts
    45
    Rep Power
    0


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    Thank you for you assistance, its greatly appreciated. Please find line 70 as requested:

    $from_str .= (" left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id) left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";

  5. #5
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,124
    Rep Power
    55


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    I can not seem to find the code you are refering to ... although there is a similar line in v2.5 ... Try: $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
    pgmarshall
    _______________________________

  6. #6
    Member
    Join Date
    May 2009
    Posts
    45
    Rep Power
    0


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    Thanks again for your assistance... I tried the code you suggested and it came back with the following:
    1054 - Unknown column 'p.products_tax_class_id' in 'on clause'

    select count(distinct p.products_id) as total from ((products p) left join manufacturers m using(manufacturers_id), products_description pd) left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c left join tax_rates tr on p.products_tax_class_id = tr.tax_class_id left join zones_to_geo_zones gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '13') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '183') where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= 1)

    [TEP STOP]

    I just seem to be going round and round in circles with this one???

  7. #7
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,124
    Rep Power
    55


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    I have no idea what you have done to this page in v2.0.4 - have you editted the code somehow when adding mods? ... I would suggest restoring the original from the SVN ... advanced_search_result.tpl.php - oscmax2 - osCmax - osCommerce Maximized - Google Project Hosting ... Click view raw file (in right hand box - click show details if you can't see the box). v2.0.4 worked fine on php5+ for me. Regards,
    pgmarshall
    _______________________________

  8. #8
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    3,124
    Rep Power
    55


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    Please also make sure you BACKUP before making the changes! Regards,
    pgmarshall
    _______________________________

  9. #9
    Member
    Join Date
    May 2009
    Posts
    45
    Rep Power
    0


    Default Re: 1054 Error on Advanced Search - other suggestions haven't worked ???

    Thanks so much...will try this....this is inherited code so maybe anything is possible

Similar Threads

  1. Error 1054 on Search page..
    By cdxrevvved in forum osCmax v1.7 Discussion
    Replies: 5
    Last Post: 09-22-2007, 04:23 AM
  2. customer search function NEVER worked properly
    By ogilirca in forum osCmax v2 Customization/Mods
    Replies: 3
    Last Post: 02-28-2007, 06:50 AM
  3. customer search function NEVER worked properly
    By ogilirca in forum osCommerce 2.2 Discussion
    Replies: 0
    Last Post: 11-22-2006, 04:30 AM
  4. Advanced search on price gives SQL error
    By kopoba11 in forum osCmax v2 Installation issues
    Replies: 0
    Last Post: 04-23-2006, 07:25 PM
  5. Advanced Search Error
    By jgkiefer in forum osCmax v1.7 Discussion
    Replies: 4
    Last Post: 09-16-2003, 07:04 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
  •