JonnyLongTorso Posted July 22, 2003 Posted July 22, 2003 I just installed my first contribution, Featured Products version 1.3 (which is a very very nice extension btw, along with the random product chooser @ http://www.oscommerce.com/community/contri...ions,651/page,2 ). Everything seems to be running properly, all my selected products show up on the page. However, upon clicking on the 'Featured Products' link on the main page--opening up the featured_products.php link--I get the following error: 1064 - You have an error in your SQL syntax near 'select p.products_id, pd.products_name, p.products_image, p.products_price, p.pr' at line 1 select count(select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' left join specials s on p.products_id = s.products_id left join featured f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand(673061471) ) as total [TEP STOP] As I indicated before, this is my first extension--installed on the latest OScommerce milestone (2.2 Milestone 2, 7/12/2003). And I'm fairly new to all of this :). I think I could work around the problem by removing the "Featured Products" link at the top of the featured products table on the index page (i.e. not allowing users the ability to click into featured_products.php), but I'm not sure how to do that either. TIA :). Quote
fredfillah Posted August 4, 2003 Posted August 4, 2003 I am having the same problem with Featured Products contrib (with the rotate add-on) and osC 2.2. The workaround (hack) to disable the "Featured Products" link is to: 1) Comment out the SQL query that fails in catalog/featured_prorducts.php around line 56. Comment out the following lines /* Disable Featured Product link $featured_products_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by p.products_date_added DESC, pd.products_name"; $featured_products_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_FEATURED_PRODUCTS_LISTING, $featured_products_query_raw, $featured_products_numrows); $featured_products_query = tep_db_query($featured_products_query_raw); while ($featured_products = tep_db_fetch_array($featured_products_query)) { $featured_products_array[] = array('id' => $featured_products['products_id'], 'name' => $featured_products['products_name'], 'image' => $featured_products['products_image'], 'price' => $featured_products['products_price'], 'specials_price' => $featured_products['specials_new_products_price'], 'tax_class_id' => $featured_products['products_tax_class_id'], 'date_added' => tep_date_long($featured_products['products_date_added']), 'manufacturer' => $featured_products['manufacturers_name']); } */ 2) Comment out the line that creates the link. It in catalog/includes/functions/featured.php around line 67. Comment out the line // $info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>'); and add $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS ); I'm using MySQL v4.0.13. Which version are you using? Anyway, this worked for me...good luck. Quote -Fred
kepa Posted August 5, 2003 Posted August 5, 2003 and I just did exactly what you did as a quick fix. I think it may be the code in the contribution itself? I don't know, but that link is great as it invities cusotmers in to view. I'll look into it tomorrow I guess, if no one else knows what the error is. Quote
kepa Posted August 5, 2003 Posted August 5, 2003 catalog/includes/modules folder where you do number 2. 2) Comment out the line that creates the link. It in catalog/includes/functions/featured.php around line 67. Comment out the line Code: // $info_box_contents[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>'); and add Code: $info_box_contents[] = array('align' => 'left', 'text' => TABLE_HEADING_FEATURED_PRODUCTS ); Quote
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.
Note: Your post will require moderator approval before it will be visible.