Additional example code to make popup page have submit and attribute buttons. This code is only tested with Catalog. It will work with Business but it currently fails to display discounted prices for logged in Business customers. Also you have to go to View / Search Settings / Results and uncheck Highlight Located Text. CHANGE LOG 17-02-05 Made V7 specific ReadMe. Added NETQUOTEVAR:DISCOUNTINFO to AddToCart_ExtendedInfo.html. 04-04-04 (Nice date) Moved Popup JavaScript to popupsupport.js, changed AddToCart_ExtendedInfo.html to suit. Removed rendundant CUSTOMVAR:SINGLEADD code. Will be compatible with upsell code. 22-02-04 Updated to work with All types of Sections. 02-11-03 Updated to work with Business. (Fails to display discounted prices for logged in customers.) 31-10-03 Updated to work with Quantity on Product Page (without Single Add). Other Info and Date Prompts added to popup template. 20-10-03 No code changes - just the two Business and Search warnings above. 20-10-03 Updated to work with Netscape & Opera (tested with IE6.0.2800, NN7.1, Opera 7.11 all on Windows-XP Pro. INSTALLATION ************************************************************** Make file (in Site1) popupsupport.js from the following:- ************************************************************** // START POPUP WITH ADD TO CART SUPPORT var noreferrer = false; var oktosubmit = false; var singleadd = false; function setitup(prodref) { var undef; // (V11) use unique name from source window as target if ( opener ) { if ( opener.WindowName ) document.forms.popform.target = opener.WindowName; // Netscape needs the long-winded name // look through all parent forms 'till one containing field SID var of = opener.document.forms; var i = of.length - 1; for ( var j = 0; j <= i; j++) { var k = of[j].length - 1; for ( var l = 0; l <= k; l++) { if ( of[j].elements[l].name == 'PU_' + prodref ) { // patch in values from calling page document.forms.popform.SID.value = of[j].SID.value; document.forms.popform.action = of[j].action; if ( of[j].SINGLEADD ) singleadd = true; if ( noreferrer ) { document.forms.popform.ACTINIC_REFERRER.value = opener.location.href; } else { document.forms.popform.ACTINIC_REFERRER.value = of[j].ACTINIC_REFERRER.value; } document.forms.popform.PAGEFILENAME.value = of[j].PAGEFILENAME.value; return true; } } } } // should never get here but... alert("Cannot find product." + "\nMake sure that the main page is still displaying the product and try again." + "\n( not found in Product Template)"); setTimeout("window.close()",2000); // defer the window close for Netscape & Opera return false; } function doit() { setTimeout("window.close()",500); // defer the window close for Netscape & Opera return oktosubmit; } // END POPUP WITH ADD TO CART SUPPORT ************************************************************** Make a file called "AddToCart_ExtendedInfo.html" from the following. Put it in Site1. ************************************************************** NETQUOTEVAR:PAGETITLE NETQUOTEVAR:PAGEHEADER
NETQUOTEVAR:PRODUCTIMAGE NETQUOTEVAR:PRODUCTNAME NETQUOTEVAR:PRODUCTREF
NETQUOTEVAR:PRODUCTDESCRIPTION
NETQUOTEVAR:PRODUCTBEGINLINKNETQUOTEVAR:PRODUCTLINKTEXTNETQUOTEVAR:PRODUCTENDLINK NETQUOTEVAR:PRICEEXPLANATION
NETQUOTEVAR:PRODUCTPRICE
NETQUOTEVAR:DISCOUNTINFO NETQUOTEVAR:OTHERINFOPROMPT NETQUOTEVAR:DATEPROMPT NETQUOTEVAR:CARTERRORXMLNETQUOTEVAR:PRODUCTQUANTITY
NETQUOTEVAR:ADDTOCARTBUTTON
NETQUOTEVAR:TEMPLATEENDXML
************************************************************** Then amend Act_ProductBody.html (in Site1) to add the fragment below to the top of the template. This uniquely names the main window so we can use it as the TARGET of the popup form submission. ************************************************************** ..... template continues unaltered. ************************************************************** Then amend every Product Template e.g. Act_ProductLine.html (in Site1) to add the fragment below. Place it under every occurrence of NETQUOTEVAR:PRODUCTFORMBEGIN (some Templates have this line in twice) ************************************************************** OPERATION ************************************************************** In Actinic arrange for the AddToCart_ExtendedInfo.html template to be used as the popup template in the Products Extened Info dialogue. ************************************************************** NOTES You can also (optionally) comment out the NETQUOTEVAR:ADDTOCARTBUTTON on the ProductLine template so that the popup is the only way to submit the details. Also if you do this and comment out the NETQUOTEVAR:PRODUCTDESCRIPTION in your Product Template and replace the NETQUOTEVAR:INFOTEXT in Test_ExtendedInfo.html with NETQUOTEVAR:PRODUCTDESCRIPTION then you move your normal product description from the product page to the popup one.