Many forums do not allow you to post HTML, but some do. Here is the code for product_iframe.php:
PHP Code:
<?php
require_once 'squirrelcart/pre_storefront.php';
if (is_numeric($_GET['rn'])) {
$prod_html = sc_product($_GET['rn']);
$prod_html = str_replace('<a','<a target="_blank"',$prod_html);
$prod_info = sc_xml_safe(sc_query("SELECT IF(Page_Title, Page_Title, Name) AS Title, Keywords, Brief_Description FROM Products WHERE record_number = '$_GET[rn]'"));
}
if (empty($prod_html)) $prod_html = 'Product not found.';
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="title" content="<?php print $prod_info['Title']?>" />
<meta name="keywords" content="<?php print $prod_info['Keywords']?>" />
<meta name="description" content="<?php print $prod_info['Brief_Description'] ?>" />
<title><?php print $prod_info['Title'] ?></title>
<link rel="stylesheet" type="text/css" href="<?php print SC_MASTER_THEME_DIR_DYN ?>/style_main.css.php" />
</head>
<body>
<div id="sc">
<?php print $prod_html;?>
</div>
</body>
</html>
If you drop that in a file named "product_iframe.php" and drop it at the same level as your storefront page, you can then do this:
http://www.example.com/product_iframe.php?rn=123
It should show that product thumbnail. You can then use that URL in an iframe src on any page you want.
You will probably want to add a small amount of CSS to make it look better. I left that out. If you change this:
PHP Code:
$prod_html = sc_product($_GET['rn']);
to this, you will get a product detail page instead:
PHP Code:
$prod_html = sc_product($_GET['rn'], 'product_detail');