graphicmagic Posted December 1, 2009 Share Posted December 1, 2009 Hi, I sell invitations and need to have a break down of quanity and price per that quanity. This is what I have come up with and it isn't working from me and it won't load into the discription of the items either. Any ideas? <html> <head> <script type="text/javascript"> function calc() { var val = document.myform.invitation.value; var price = parseFloat(val); // extract the price component var quantity = parseInt(document.myform.invitation_QTY.value); if (isNaN(quantity)) { alert ("Please enter a number for quantity required"); document.myform.invitation_QTY.value = ""; return false; } if ((quantity >0) && (price > 0)) { document.myform.total.value = (price * quantity).toFixed(2); } } </script> </head> <body> <form name= "myform"> <label>Invitations: <select name="Invitations and RSVPs" onchange="calc();"> <option value = "0" selected="selected">CHOOSE A QUANITY </option> <option value="232.50 SIZE: 50" >50 qty </option> <option value="257.00 SIZE: 60" >60 qty </option> <option value="281.50 SIZE 70">70 qty </option> <option value="306.00 SIZE: 80" >80 qty </option> <option value="330.50 SIZE: 90" >90 qty </option> <option value="355.00 SIZE 100">100 qty </option> <option value="379.00 SIZE: 110" >110 qty </option> <option value="404.00 SIZE: 120" >120 qty </option> <option value="428.50 SIZE 130">130 qty </option> <option value="453.00 SIZE: 140" >140 qty </option> <option value="477.50 SIZE: 150" >150 qty </option> <option value="502.00 SIZE 160">160 qty </option> <option value="526.50 SIZE: 170" >170 qty </option> <option value="551.00 SIZE: 180" >180 qty </option> <option value="576.50 SIZE: 190">190 qty </option> <option value="600.00 SIZE: 200" >200 qty </option> <option value="624.50 SIZE: 210" >210 qty </option> <option value="649.00 SIZE 220">220 qty </option> <option value="673.50 SIZE: 230" >230 qty </option> <option value="698.00 SIZE: 240" >240 qty </option> <option value="722.50 SIZE 250">250 qty </option> </select> </label> <label>QTY: <input type="text" name="Invitation_QTY" value = "0" onfocus= "this.value = ''"; onchange="calc()" /> </label> <label>Price: <input type="text" readonly="readonly" name="total" > </label> </form> </body> </html> Thanks! Quote Link to comment Share on other sites More sharing options...
TCOB1 Posted December 5, 2009 Share Posted December 5, 2009 (edited) Hi, I sell invitations and need to have a break down of quanity and price per that quanity. This is what I have come up with and it isn't working from me and it won't load into the discription of the items either. Any ideas? <html> <head> <script type="text/javascript"> function calc() { var val = document.myform.invitation.value; var price = parseFloat(val); // extract the price component var quantity = parseInt(document.myform.invitation_QTY.value); if (isNaN(quantity)) { alert ("Please enter a number for quantity required"); document.myform.invitation_QTY.value = ""; return false; } if ((quantity >0) && (price > 0)) { document.myform.total.value = (price * quantity).toFixed(2); } } </script> </head> <body> <form name= "myform"> <label>Invitations: <select name="Invitations and RSVPs" onchange="calc();"> <option value = "0" selected="selected">CHOOSE A QUANITY </option> <option value="232.50 SIZE: 50" >50 qty </option> <option value="257.00 SIZE: 60" >60 qty </option> <option value="281.50 SIZE 70">70 qty </option> <option value="306.00 SIZE: 80" >80 qty </option> <option value="330.50 SIZE: 90" >90 qty </option> <option value="355.00 SIZE 100">100 qty </option> <option value="379.00 SIZE: 110" >110 qty </option> <option value="404.00 SIZE: 120" >120 qty </option> <option value="428.50 SIZE 130">130 qty </option> <option value="453.00 SIZE: 140" >140 qty </option> <option value="477.50 SIZE: 150" >150 qty </option> <option value="502.00 SIZE 160">160 qty </option> <option value="526.50 SIZE: 170" >170 qty </option> <option value="551.00 SIZE: 180" >180 qty </option> <option value="576.50 SIZE: 190">190 qty </option> <option value="600.00 SIZE: 200" >200 qty </option> <option value="624.50 SIZE: 210" >210 qty </option> <option value="649.00 SIZE 220">220 qty </option> <option value="673.50 SIZE: 230" >230 qty </option> <option value="698.00 SIZE: 240" >240 qty </option> <option value="722.50 SIZE 250">250 qty </option> </select> </label> <label>QTY: <input type="text" name="Invitation_QTY" value = "0" onfocus= "this.value = ''"; onchange="calc()" /> </label> <label>Price: <input type="text" readonly="readonly" name="total" > </label> </form> </body> </html> Thanks! I'm new at this but this works for me. You can set this up in the product attributes section under catalog. Product Option can be set any title eg Color, Size. Option Value set to your eg Size = 14", 16", 20", Brown, Pink, Blue Then in the product section you creat the list of items and there option. The vulue can be set to +/- $ for the next size. I sell Teddy Bears - 14", 16" 20" in Brown, Pink, Blue. The buyer choses a 14" bear and the selects the color option. Hope this helps. Glen Edited December 5, 2009 by TCOB1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.