Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Interesting situation with quantity


Recommended Posts

I am making a hardwood flooring store, and it has an interesting situation regarding product quantities.


Mainly, the product is hardwood flooring. This is priced per sq ft, however, there is a set number of sq ft per carton that varies per product.


We also sell trimming/mouldings by the lineal foot. These products are usually in 6'5" lengths. (could say this is the units/container for this)


We also may sell individual items such as cleaning solutions and other accessories.




I need a way to get an accurate count of total cost by calculating the exact quantity users will end up with. I have already added in my products mysql table a units/container option. Any ideas?


the basic calulation will be (just using dummy variables)

$actual_qty = $num_packages * $sqft_per_box;
$total_cost = $actual_qty * $price_per_unit;


i want to update the qty of the product ordered to the $actual_qty ordered


how do i get this to mesh with the mysql tables and order processing stuff?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...