johnnyosc Posted November 30, 2002 Posted November 30, 2002 Does anyone know if there is a contribution that has a pop up image that will show the items name and price above the picture along with a close box link? If not, how would you do the code to have the pop up add the price and item name? Any suggestions? Thanks...
Guest Posted November 30, 2002 Posted November 30, 2002 Not sure about a contribution, but you can just add a couple lines to catalog/popup_image.php. The item name already appears in the title, so you can move that to the body if you wanted to. First, add 2 more fields to the SQL query: p.products_price and p.products_tax_class_id Then, where you want the price to be displayed, add this line: echo $currencies->display_price($products_values['products_price'], tep_get_tax_rate($products_values['products_tax_class_id'])); And at the bottom, just add a simple close link: <a href="javascript:window.close()">Close</a> Of course, you'll have to adjust the JavaScript resize() function to increase the popup window height a little since you are adding more lines. :) You can play around with the formatting to get it to look the way you want it to. Tony
johnnyosc Posted November 30, 2002 Author Posted November 30, 2002 Hello Tony, Thanks for the help on the coding!! However, when I added the code for the price, I only get a price of $0.00 on all my products. The product name is fine. I added the two fields to my sql database as well under products. What do you think i possibly did wrong? Maybe didnt added the fields right in the sql? Please advise. Thanks...
Guest Posted November 30, 2002 Posted November 30, 2002 I think I might have confused you. :oops: You don't need to add any fields to the database...you already have them. :) I meant, add the fields to the query. Somewhere around line 15 in catalog/popup_image.php: Change this: $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . $languages_id . "'"); To this: $products_query = tep_db_query("select pd.products_name, p.products_price, p.products_tax_class_id, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . $languages_id . "'"); The query is where it pulls the information to be calculated by the display_price function. If you don't add the fields to the query, it won't pull anything from the database and give you a $0.00 cost. :shock: Tony
johnnyosc Posted December 1, 2002 Author Posted December 1, 2002 Tony, Thanks for clearing it up. Works great. Now I need to just figure out how to set up the pop up size to make the size look even. Shouldnt be too hard. Thanks again for the help, you the MAN!!! JohnnyOSC
Recommended Posts
Archived
This topic is now archived and is closed to further replies.