View Full Version : purchase by surface area
jonnyatom5
07-Oct-2003, 01:15 PM
I've got a client who needs for his customers to order by surface area, ie: input a width and height, (retain these inputs for the checkout) then dependant upon these inputs generates a price, I figured that multiplying the width and height would give a suface area in cm squared and then multiply this by a cm squared price to give a final.
Can this be done in Actinic V 6.1.3?
NormanRouxel
07-Oct-2003, 02:16 PM
The first thing you'll have to check is that your price per square cm will fit sensibly into Actinic's penny based pricing system. If that's OK then you can arrange for the calculation to be done with a bit of JavaScript and for the Quantity to be replaced by the product.
The best way to retain the customer input values would be to fit them into the Other Info prompt where they would appear on the checkout.
Another way would be to have drop-down boxes for width and breadth and these would also be would also be carried through to the checkout. Of course this assumes that these fit into sensible ranges for drop-down boxes.
I did a demo site that shows an large amount of calculation going on. You can see it at http://www.drillpine.biz/voilenet/acatalog/More_Products.html where the curtains are sold by area and a few other options. This required quite a bit of work however.
It actually uses another technique that allows the price of a product to be calculated on the fly, removing the granularity problem associated with actinic price units.
You may also want to search the Forum using keywords like width, breadth, area, etc as I'm sure I've posted such solutions before.
Norman
jonnyatom5
07-Oct-2003, 02:46 PM
Hiya Norman
thanks for the reply, you confirmed my initial thoughts. I've had a play using my limited knowledge of javascript and managed the area calculation utilising drop down boxesand managed to populate an input box which I imagine would then be used as the quantity to then calculate the price. Trouble is, I'm now failing on associating the dropdown list names from actinic with my names in the javascript I've cobbled together. Is this the correct way to go about it? Can I get at the "NETQUOTEVAR:ATTRIBUTEREF" to name it?
Regards Garry
PS: the example site you gave is exactly what I want, with drop and width etc.
NormanRouxel
07-Oct-2003, 03:38 PM
I'd written a ReadMe that might help. Here it is.
Norman
NormanRouxel
07-Oct-2003, 04:52 PM
Grrr.... Actinic changed the Other Info Prompt code somewhat in 6.1.3. Here's the readme again with 6.1.2 and 6.1.3 compatibility.
Norman
NormanRouxel
08-Oct-2003, 08:22 AM
I've updated the ReadMe to deal with:
You might get confusing results should someone add an identical product twice.
The Quantity would increase but the Other Info (which contains a total area) wouldn't. A patch to Cart.pm fixes this
by treating any products with Other Info set as always different.
Also I've added autocomplete="off" to Width and Depth input fields as buggy Internet Explorer doesn't fire the onchange event if you use autocomplete! Bummer.
Norman
jonnyatom5
08-Oct-2003, 11:36 AM
Hiya Norman
Thank you a million, that read me and consequent changes worked wonderfully...
...on a PC. I design on a Mac (for my sins) and so tested it on this as well (plus my client uses an Apple Mac), the whole process falls over. Error below.
"Quantity: The quantity must be a whole number between 1 and 32767."
It seems that the width and height values aren't being 'transfered' into the "dimensions" input box and consequently neither is the area into the quantity, hence the app thinks no quantity has been input and so throws up the error.
This is totally annoying as it works fine on my PC.
Any ideas?
URL: http://www.etchfx.co.uk/acatalog
NormanRouxel
08-Oct-2003, 03:30 PM
I've no access to a Mac as I'm on holiday inTurkey. I can only suggest putting in some alert('We got here'); type statements to see whether or not it's detecting the Quantity field or whatever.
Norman
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.