Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HOW TO ADD THE PRICE INFORMATION TO POP UP WINDOW


speed2

Recommended Posts

Speed, as I recall you have STS installed so I don't know if this applies.

 

You'll need to change catalog/popup_image.php.

 

Add the price to the $products_query SQL.

 

Then at the bottom in the <body> section where the image is displayed you'll probably want to add a table with the image in one row and the price in the next.

 

I don't have the code and really am busy right now, but I'm sure your up to a little experimenting on your own.

 

Good Luck

 

Tom

Link to comment
Share on other sites

Easy "cheater" way would be to just append the price to the end of the pop-up window link.

 

I.E. -> popup_viewer.php?id=image_name&price=34.00

 

Then in the window code have the image

 

<?php

echo "<img src=" . $id . " border=0>";
echo "<br><br>";
echo "Price: $ " . $price;

?>

 

The above is not EXACTLY what you need, but pretty close. Just append the product price to the php link, then grab it in the popup window.

I need to read the rules more often...

Link to comment
Share on other sites

Hi westkoast, I followed your instruction and its not working!

by default we have catalog/popup_image.php and how do I list the price in there?

 

I think OceanRanch is right, but don't know how to do everythign he said..some one please help

Link to comment
Share on other sites

<?php

 require('includes/application_top.php');

 $navigation->remove_current_page();

 $products_query = tep_db_query("select pd.products_name, p.products_price, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 $products = tep_db_fetch_array($products_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
 if (navigator.appName == 'Netscape') i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
 self.focus();
}
//--></script>
</head>
<body onload="resize();">
 <div align="center">
	 <?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?><br>
	 <?php echo $products['products_price']; ?></div>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

 

Can you try that?

I need to read the rules more often...

Link to comment
Share on other sites

Ok, I forgot something, you're gonna need to add some extra pixels to the window size.

 

I.E.

 

function resize() {

if (navigator.appName == 'Netscape') i=40;

if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);

self.focus();

}

 

 

height + 90 or something, so that it makes room for the price.

I need to read the rules more often...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...