Zuncan Posted July 12, 2005 Share Posted July 12, 2005 Hi! Is it possible to alter the code in product_info.php so that the customerratings-button only will display if there actually are any ratings made? If it's possible - Please help! Here is the code for the button in product_info.php: <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?> Be well / Zuncan So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Guest Posted July 12, 2005 Share Posted July 12, 2005 Hi! Is it possible to alter the code in product_info.php so that the customerratings-button only will display if there actually are any ratings made? If it's possible - Please help! Here is the code for the button in product_info.php: <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?> Be well / Zuncan <{POST_SNAPBACK}> You would need to query the database and put an if statement dependent on whether there were reviews or not. Quick question though, how would someone rate a product if there was no button to press? Link to comment Share on other sites More sharing options...
Zuncan Posted July 12, 2005 Author Share Posted July 12, 2005 I would like to ad a "Write review" button also. Thats how I was thinking. That would help the customers so that thay dont need to press the reviews button to only end up seeing: "There are currently no review for this product". Would be more that greatful if you could help me out with this. Im totally lost when it comes to query the database.. So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Zuncan Posted July 12, 2005 Author Share Posted July 12, 2005 Of course it should only be possible to enter a review if the customer are logged in So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Zuncan Posted July 13, 2005 Author Share Posted July 13, 2005 Is it a simple way to do this, so pls help.. So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted July 13, 2005 Share Posted July 13, 2005 Is it a simple way to do this, so pls help.. <{POST_SNAPBACK}> go to the code of the page the button currently takes you to. As you can see, it displays if there is no review. The query for this has already been done, you only need to steal it from there, and instead of displaying "no reviews yet" you do not display anthing, and if there are reviews, you display your button. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Zuncan Posted July 13, 2005 Author Share Posted July 13, 2005 Thx I'll ty it So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Zuncan Posted July 15, 2005 Author Share Posted July 15, 2005 Still need help.. Can someone give me a code to use? So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted July 15, 2005 Share Posted July 15, 2005 Still need help.. Can someone give me a code to use? <{POST_SNAPBACK}> <?php $reviews_query = "select '1' from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' order by r.reviews_id desc"; if (tep_db_num_rows($reviews_query)) { ?> <!--here comes your button for reviews--> <?php } ?> :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Zuncan Posted July 15, 2005 Author Share Posted July 15, 2005 Thx Monica! It almost worked! The button disappered, but also for the products that have reviews. So basically the button is completly gone now.. Could you please look into this once more? / Zuncan So what?! Who care in a hundred years anyway? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.