foaad Posted October 26, 2006 Posted October 26, 2006 I am a newbie in PHP and OSC. I am trying to create a calculator for Product_info page where customer inputs the width and length of the area and the calculator calculates the surface area (this is the easy part). Then the calculator will takes the result and divides it by the dynamic amount of product per case (in square foot)(it is a different value for each product) and gives the number of cases of the particular product. In the background I need the same calculator to calculate the weigh of the cases and have a total handy when customer orders it to pass it on to shipping pages and calculate the price for shipping. Any assistance would be immensely appreciated. Quote
foaad Posted October 28, 2006 Author Posted October 28, 2006 Well, I found a calculator and with minor modifications it works, in a page of its own. However, I tested the calculator after adding it to my product_info page and it completely useless. It also affects the buttons (add to cart, etc) on the page. Do I need to add this part as another "include"? And where do I add it? Please help. Quote
foaad Posted November 2, 2006 Author Posted November 2, 2006 I have tried the calculator that I had found and tried to implement it in the page. However, I have not been succesful. Maybe, someone can take a look at this and help me out. I need to put the attached code to my Product_info.php file and I am totally lost. What I need to do is to add the dynamic product info such as square foot per carton and have it populate the corresponding box in the calculator and then have the result of that be added to the shopping cart. I know this is possible. However, I really do not have the knowledge to write the code for it. <form action="java script:sqftcalc" name="sqftcalc" id="sqftcalc"> <table summary="Square Foot Calculator" cellspacing="5" cellpadding="0" border="0"> <tr> <td class="calctype" nowrap="nowrap">Room Length:</td> <td class="calcfieldarea"><input type="text" name="lengthF" id="lengthF" size="4" value="0" tabindex="1" class="field" /> <label for="lengthF">feet</label></td> <td class="calcfieldarea"><input type="text" name="lengthI" id="lengthI" size="4" value="0" tabindex="2" class="field" /> <label for="lengthI">inches</label></td> </tr> <tr> <td class="calctype" nowrap="nowrap">Room Width:</td> <td class="calcfieldarea"><input type="text" name="widthF" id="widthF" size="4" value="0" tabindex="3" class="field" /> <label for="widthF">feet</label></td> <td class="calcfieldarea"><input type="text" name="widthI" id="widthI" size="4" value="0" tabindex="4" class="field" /> <label for="widthI">inches</label></td> </tr> <tr> <td class="calctype" nowrap="nowrap">Sq. Ft. Per Carton:</td> <td class="calcfieldarea" colspan="2"><input name="cartonsqft" id="cartonsqft" type="text" value="0" tabindex="5" size="4" class="field" /></td> </tr> <tr> <td> </td> <td colspan="2"><input type="Reset" value="Clear" /> <input name="CALCULATE" type="button" id="CALCULATE" onClick="calcCarts(sqftcalc)" value="CALCULATE" /></td> </tr> </table> <br /> <table summary="Square Foot Calculator" cellspacing="5" cellpadding="0" border="0" style="border:1px solid #999966; background:#CCCC99;"> <tr> <td colspan="3"><h2 style="margin:0;">Results…</h2></td> </tr> <tr> <td class="calctype" nowrap="nowrap"><b>Total square footage required:</b></td> <td colspan="2"><input type="text" value="0" name="totalsf" size="10" class="field" /></td> </tr> <tr> <td class="calctype" nowrap="nowrap"><b>Total cartons required:</b></td> <td colspan="2"><input type="text" value="0" name="totalcartons" size="10" class="field" /></td> </tr> </table> </form> Quote
dynamoeffects Posted November 2, 2006 Posted November 2, 2006 If you do a google search for "whitebox bamboo", the first result should be a store that I wrote a similar calculator for. You can set the sq ft, number of boxes, or a price and it'll automatically calculate the other fields. Quote Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.
foaad Posted November 4, 2006 Author Posted November 4, 2006 If you do a google search for "whitebox bamboo", the first result should be a store that I wrote a similar calculator for. You can set the sq ft, number of boxes, or a price and it'll automatically calculate the other fields. Thank you so much. Now this makes a bit more sense as you have put a min. amount to order. I will follow your code and see if I can come up with something for my site. Quote
bernarde Posted February 28, 2007 Posted February 28, 2007 I need something similar to calculate square footage of windows. Is there a solution to this for osCommerce yet? Quote
Guest Posted October 1, 2008 Posted October 1, 2008 I need something similar to calculate square footage of windows. Is there a solution to this for osCommerce yet? I am a sign maker and am seeking the exact same solution to calculate the square footage price of dibond and other materials. Quote
♥joli1811 Posted November 27, 2008 Posted November 27, 2008 hi here is an interesting contribution http://addons.oscommerce.com/info/6328 might help john Quote To improve is to change; to be perfect is to change often.
CustomLightFilters Posted August 7, 2010 Posted August 7, 2010 Has anyone figured out how to do custom priced products based on the square inches? I tried to setup the Custom Product Builder but there does not seem to be anyway of using the same product just with different sizes. Quote
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.
Note: Your post will require moderator approval before it will be visible.