Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I am a newbie in PHP and OSC. I am trying to create a calculator for Product_info page

  1. where customer inputs the width and length of the area and the calculator calculates the surface area (this is the easy part).
  2. 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.
  3. 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.

Posted

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.

Posted

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>

Posted

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.

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.

Posted
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.

  • 3 months later...
  • 1 year later...
Posted
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.

  • 1 month later...
  • 1 year later...
Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...