Can't take credit for that portion. Most of the backend work was done by haredo (Mark). It was his first site and I prodded, he researched.
I guess we need to publish that as a mod.
When the product is displayed, it uses the tpl_product_info_display.php to display the product. If you have attributes with the item, the tpl_modules_attributes.php file is called.
You put an if in the tpl for attributes, use JavaScript to pop-up the window, add some files to the extra-datafiles folder, add a couple of folders with some files, (THEN A MIRACLE HAPPENS), and you're done!
The code in the tpl_modules_attributes.php looks like
PHP Code:
<div id="productAttributes">
<?php if ($zv_display_select_option > 0) { ?>
<h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3>
<?php } // show please select unless all are readonly ?>
<?php
for($i=0;$i<sizeof($options_name);$i++) {
?>
<?php
if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {
?>
<h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3>
<?php
}
if (preg_match("/anklet/i", $options_name[$i]))
{
$guideLink = '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ASZLNGTH) . '\')">(<u>Guidelines</u>)</a>';
}
else
$guideLink = null;
?>
The file popup_aszlnth_filenames.php goes in the /includes/extra_datafiles folder and looks like
PHP Code:
<?php
// ASZLNGTH Filename Define
define('FILENAME_POPUP_ASZLNGTH', 'popup_aszlngth');
?>
A folder called popup_aszlngth goes under includes/modules/pages and contains the files header_php.php
PHP Code:
<?php
/**
* Pop up attribute help
*
*/
$_SESSION['navigation']->remove_current_page();
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
?>
along with the header_php.php file, there needs to be a jscript_main.php file that looks like
PHP Code:
<?php
// window resizing for aszlngth
?>
<script language="javascript" type="text/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>
There also needs to be a folder named pop-up_azlngth in the custom template folder (includes/templates/gomag/popup_aszlngth) that contains the tpl_main_page.php file which looks like
PHP Code:
<?php
/**
* tpl_main_page.php
*
* Main page to display the aszlngth pop-up data
*/
?>
<body id="popupASZLNGTH">
<h1><?php echo HEADING_ASZLNGTH ?></h1>
<div id="ankletSize"><?php echo TEXT_ASZLNGTH1 ?></div>
<div><?php echo TEXT_ASZLNGTH2 ?></div>
<div><?php echo '<a href="javascript:window.close()">' . TEXT_CLOSE_ASZLNGTH_WINDOW . '</a>'; ?></div>
</body>
There may be something I've left out and I'll get Mark to review.
This whole "magic" is loosely based on the existing cvv pop-up.
As I always say to Mark, "Necessity is NOT the Mother of invention; laziness IS!" Or, as a friend of mine would say, "We RESEARCHED the cvv pop-up."