steffanih Posted November 16, 2010 Share Posted November 16, 2010 Hello, I am receiving this error after installing Related Products: 1054 - Unknown column 'p.products_id' in 'where clause' SELECT pop_products_id_slave, products_name, products_model, products_price, products_quantity, products_tax_class_id, products_image FROM products_related_products, products_description pa, products pb where p.products_id not in(33) and pop_products_id_slave = pa.products_id AND pa.products_id = pb.products_id AND language_id = '1' AND pop_products_id_master = '113' AND products_status='1' ORDER BY rand() [TEP STOP] It appears in my product info display. I believe I have loctade the code causing it in catalog/includes/modules/optional_related_products.php but I'm not sure exactly what is causing it and what I may need to change to clear the error. Thanks for any and all help! $orderBy = 'ORDER BY '; $orderBy .= (RELATED_PRODUCTS_RANDOMIZE)?'rand()':'pop_order_id, pop_id'; $orderBy .= (RELATED_PRODUCTS_MAX_DISP)?' limit ' . RELATED_PRODUCTS_MAX_DISP:''; $attributes = " SELECT pop_products_id_slave, products_name, products_model, products_price, products_quantity, products_tax_class_id, products_image FROM " . TABLE_PRODUCTS_RELATED_PRODUCTS . ", " . TABLE_PRODUCTS_DESCRIPTION . " pa, ". TABLE_PRODUCTS . " pb WHERE pop_products_id_slave = pa.products_id AND pa.products_id = pb.products_id AND language_id = '" . (int)$languages_id . "' AND pop_products_id_master = '".$HTTP_GET_VARS['products_id']."' AND products_status='1' " . $orderBy; $attribute_query = tep_db_query($attributes); if (mysql_num_rows($attribute_query)>0) { $count = 0; Quote Link to comment Share on other sites More sharing options...
steffanih Posted November 19, 2010 Author Share Posted November 19, 2010 I decided to try one of the earlier installs, moving back to the Feb 25th version as suggested elsewhere when trying to resolve 1054 issues on this contribution. Im back to the same thing, same error. This is the section of code it appears to be coming from in the earlier install. I have made the changes to index.php and advanced_search_result.php that claim to resolve 1054 problems, but I still receive the same 1054 error. Any clue as to what could be causing this prob or how to resolve it? // DANIEL: begin - show related products $attributes = "select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from " . TABLE_PRODUCTS_OPTIONS_PRODUCTS . ", " . TABLE_PRODUCTS_DESCRIPTION . " pa, ". TABLE_PRODUCTS . " pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '" . (int)$languages_id . "' and pop_products_id_master = '".$HTTP_GET_VARS['products_id']."' and products_status=1 order by pop_order_id, pop_id"; $attribute_query = tep_db_query($attributes); Quote Link to comment Share on other sites More sharing options...
Guest Posted August 10, 2013 Share Posted August 10, 2013 I decided to try one of the earlier installs, moving back to the Feb 25th version as suggested elsewhere when trying to resolve 1054 issues on this contribution. Im back to the same thing, same error. This is the section of code it appears to be coming from in the earlier install. I have made the changes to index.php and advanced_search_result.php that claim to resolve 1054 problems, but I still receive the same 1054 error. Any clue as to what could be causing this prob or how to resolve it? // DANIEL: begin - show related products $attributes = "select pop_products_id_slave, products_name, products_price, products_tax_class_id, products_image from " . TABLE_PRODUCTS_OPTIONS_PRODUCTS . ", " . TABLE_PRODUCTS_DESCRIPTION . " pa, ". TABLE_PRODUCTS . " pb WHERE pop_products_id_slave = pa.products_id and pa.products_id=pb.products_id and language_id = '" . (int)$languages_id . "' and pop_products_id_master = '".$HTTP_GET_VARS['products_id']."' and products_status=1 order by pop_order_id, pop_id"; $attribute_query = tep_db_query($attributes); I had the same problem which recently started showing up on my 2.3.1 install and this query fixes it: $attributes = " SELECT pop_products_id_slave, products_name, products_model, products_price, products_quantity, products_tax_class_id, products_image FROM " . TABLE_PRODUCTS_RELATED_PRODUCTS . ", " . TABLE_PRODUCTS_DESCRIPTION . " pa, " . TABLE_PRODUCTS . " p WHERE pop_products_id_slave = pa.products_id AND pa.products_id = p.products_id AND language_id = '" . (int)$languages_id . "' AND pop_products_id_master = '" . $HTTP_GET_VARS['products_id']."' AND products_status='1' " . $orderBy; Please notice the alias to TBLE_PRODUCTS just needs to be p not pb. Thank you. Quote Link to comment Share on other sites More sharing options...
adanob Posted June 10, 2015 Share Posted June 10, 2015 I am getting a different 1054 error. This just showed up today. "1054 - Unknown column 'products_ready_to_ship' in 'field list' SELECT products_ready_to_ship, products_ship_sep, products_weight FROM products WHERE products_id = 2538 LIMIT 1;[TEP STOP]" Quote Link to comment Share on other sites More sharing options...
adanob Posted June 11, 2015 Share Posted June 11, 2015 Answering my own question. That is a first for me. I found the problem. My shipping module for FedEx has a field called products_ready_to_ship. Removed module for now and the error message is gone. I bet I could write a SQL statement to add that field to the database? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.