Guest Posted December 27, 2002 Share Posted December 27, 2002 Hey can someone make a contrib that would show only products with images , 90% of the products we have don't have images, but it doesn't look as cool when the "new products for the month of..." show a few product names. Link to comment Share on other sites More sharing options...
burt Posted December 27, 2002 Share Posted December 27, 2002 Not difficult. Check to see what is contained in the database for "no image" - it could be "Array", it could be "" (nothing). And then just say (put very simply mind you) onto your SQL statement that builds the list: AND $products_image != ""; // assuming nothing - see above or very similar - rather depends on the sql construct that you are using. Next question: Can you do this yourself ? If yes, great. If no, you need to; - pay someone to do it for you, or - hope someone needs the same functionality and posts here when they've done it, or - maybe someone will do it for you and post it here anyway. Hope this helps. Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2002 Share Posted December 27, 2002 ...your SQL statement that builds the list: AND $products_image != ""; // assuming nothing - see above Hope this helps. My SQL is extremely rusty, but shouldn't it be?: NOT $products_image = "" Link to comment Share on other sites More sharing options...
burt Posted December 27, 2002 Share Posted December 27, 2002 My SQL is extremely rusty Correct. Extremely rusty. :wink: Link to comment Share on other sites More sharing options...
wizardsandwars Posted December 27, 2002 Share Posted December 27, 2002 Burt is correct. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help. Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2002 Share Posted December 27, 2002 :( Darn, I need some schooling. Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 OK here's how it looks (from whats_new.php): if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status='1' AND $products_image != "" order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { I know I did something wrong; it wont work, because I have the ultimate in beginner SQL knowledge. Any suggestions? Link to comment Share on other sites More sharing options...
burt Posted December 31, 2002 Share Posted December 31, 2002 Remove the $ sign Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 Thanks Burt, however it still dosen't work, I also changed the double quotes to single. Link to comment Share on other sites More sharing options...
burt Posted December 31, 2002 Share Posted December 31, 2002 This is on a live-shop that I am admin of, it's in a different place but does much the same job as you are after: $new_products_query = tep_db_query("select p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, IF(s.status, s.specials_new_products_price,p.products_price) as products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_image != '' and products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id group by p.products_id order by RAND(), p.products_date_added DESC, pd.products_name limit " . MAX_DISPLAY_NEW_PRODUCTS); Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 Thanks for the code, but it's not working also it must be something within the DB, the site I'm trying to get it to work for is: http://www.forksdrumcloset.com I'm using a snapshot from may...if that's any constellation. Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 if that's any constellation. Man, what am I thinking... big dipper? Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 Now I'm really confused ... it seemed like evertime a made a change, nothing happened. So I really messed up the query so that it wouldn't be able to grab anything on purpose. and It's still doing the same thing. Here's the question: Is there any other spot than /catalog/includes/boxes/whats_new.php where thequery for new items for the month of XX resides? Link to comment Share on other sites More sharing options...
burt Posted December 31, 2002 Share Posted December 31, 2002 Is there any other spot than /catalog/includes/boxes/whats_new.php where thequery for new items for the month of XX resides? modules/products_new.php or modules/new_products.php (I can't remember which)... Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 Thanks, that was the problem all along. It works like a charm now. Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2002 Share Posted December 31, 2002 One more question, when it's using the sub-catagory query, how do I make it query all of the products in all of it's sub-catagories? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.