Making a secret coded give a product a special offer price (tested with 6.1.2) and IE6 only! Note this only works at the moment with simple products wih no attributes or prompts. In the following our secret code is any off 'codexyz', 'abcpqr', 'wowza123' (without the quotes). We make a duplicate product with it's product reference suffixed with 'nhr' Put the following code into actiniccore.js (at the very bottom):- // the following two lines can be changed to suit your requirements. var secretsuffix = 'nhr'; // the product reference suffix suffix for our hidden items. var secretcode = ['codexyz', 'abcpqr', 'wowza123']; // list of valid codes - you can add / remove entries if required // end of user modifiable lines function formfield(fname){ // look through all forms 'till one containing field "fname" var df = document.forms; // simplified version - only return object fname var i = df.length - 1; for ( var j = 0; j <= i; j++ ) { var k = df[j].length - 1; for ( var l = 0; l <= k; l++ ) { if ( df[j].elements[l].name == (fname) ) { return df[j].elements[l]; } } } alert('Cannot find field ' + fname); // shouldn't happen... return false; } function secretcodecheck(submitimage, prodref){ var enteredvalue = formfield('SC_' + prodref).value; // the customer entered value from out visible full price product var secretvalue = ''; var secretcodecount = secretcode.length; for ( var i = 0; i < secretcodecount; i++ ) { if ( enteredvalue == secretcode[i] ) secretvalue = secretsuffix; // if we have a valid code then get the hidden suffix } submitimage.name = prodref + secretvalue; // alter the submit images name to match our invisible product formfield('Q_' + prodref).name = 'Q_' + prodref + secretvalue; // alter the invisible quantity name to match our displayed product return true; } Save the following code as SecretCode_ProductLine.html This is a standard product template with the NETQUOTEVAR:ADDTOCARTBUTTON replaced by a code field, a custom submit button with some javascript on the button click. NETQUOTEVAR:INCLUDE Act_ProductSeparator.html NETQUOTEVAR:ENDSEPARATOR NETQUOTEVAR:PRODUCTFORMBEGIN NETQUOTEVAR:TEMPLATEBEGINXML NETQUOTEVAR:PRODUCTIMAGE NETQUOTEVAR:PRODUCTNAME NETQUOTEVAR:PRODUCTREF
NETQUOTEVAR:PRODUCTDESCRIPTION NETQUOTEVAR:EXTINFOLINK
NETQUOTEVAR:EXTINFOBUTTON
NETQUOTEVAR:PRODUCTBEGINLINKNETQUOTEVAR:PRODUCTLINKTEXTNETQUOTEVAR:PRODUCTENDLINK NETQUOTEVAR:PRICEEXPLANATION
NETQUOTEVAR:PRODUCTPRICE NETQUOTEVAR:OTHERINFOPROMPT NETQUOTEVAR:DATEPROMPT NETQUOTEVAR:CARTERRORXMLNETQUOTEVAR:PRODUCTQUANTITY
Secret discount code
NETQUOTEVAR:TEMPLATEENDXML NETQUOTEVAR:PRODUCTFORMEND NETQUOTEVAR:NEXT Save the following code as Invisible_ProductLine.html This is a standard product template with EVERYTHING commented out so the product is invisible. NETQUOTEVAR:ENDSEPARATOR NETQUOTEVAR:NEXT Go into Actinic and turn off "Auto Generate Product References" in View / Business Settings / Options. That's all the setup done. Now for each discounted product:- Now create your usual product at the full price. Use SecretCode_ProductLine.html as it's template. Set its product reference to (e.g.) ABC101. Duplicate that product. Set the price to be your discounted one. Set its product reference to be the same as the one above but with the secretsuffix added (e.g.) ABC101nhr Use Invisible_ProductLine.html as it's template. The customer will only see the usual full priced product with an additional secret code input field. If they enter any of the the correct codes then the form submission will be altered to select the invisible discounted poroduct. If the wrong (or no code) is entered then the full priced product is added as usual.