Calculating between 2 product variants

I have products within my store that require calculation of square to arrive at the correct price.



Example:

Product is a Custom Door and the price equals $25 per square.



Variants

Available Widths: 24", 24.5", 25", 25.5" and 26"

Availabe Heights: 68", 68.5", 69", 69.5" and 70"



Selecting door measurements of 24" W x 68.5" H

24" = 2ft 68.5" = 5.70833333333333333333333 ft, So square equals: 11.416666666666666666667 and the cost would be $285.42



Is there any way I can make this work within CS-Cart? Any assistance is greatly appreciated!

I’ve done a square footage calculator before in jQuery. However, I’m not sure what you’re doing. Could you make the calculations you’re trying to do more clear, like:

24" x 68.5" = xxxxx

Thanks gginorio,



It could go 24" x 68.5" = 1644"

then 1644" / 12 = 137

then 137" / 12 = 11.416 sq ft



I was thinking 24" / 12 = 2

then 68.5" / 12 = 5.70833333333333333333333

then 2 x 5.70833333333333333333333 = 11.416 sq ft



At $25 per sq ft, the total price would be $285.40



Either calculation would work and I hope it makes better sense to you.



I have only done some very minor custom work in CS-Cart and the best solution that I know of with my skill set is to do a php calculator and include it based on a product id. And then I have to get the result to communicate with the cart. That is not very efficient, but I am sure I could something to work if needed.



Thanks again

A PHP calculator? Like using a form? I’m not sure that’s the best idea.



I think creating options for lengh and width, the price per square foot as a feature, then writing a small jquery calculator to do the match (entering the total into the amount box) might do the trick.

As far as i know (unless they’ve changed it recently) you cant do it.



I wanted to do the same thing to calculate the price of foam blocks.



If you do global options it just doesn’t compute correctly (adds but does not multiply) if you do drop down selection. I ended up creating hundreds categories (so youd clik on category 32" and then click on category 60") but that just was not right.



I did get a reply back from a cs cart shop owner though, that had asked cs cart to do this function and they did it for him (for a price).



There should be some way to incorporate how global options are calculated but there isnt. If any one know a way to do it i’d be interested in the answer.

gginorio,

Like I said, my skill set is limited. I will not try to do a calculator in php. I would most certainly screw things up.





mrfoameruk,

I will contact CS-Cart about doing this for me. I am willing to pay because I really need this feature. I’ll post back here if and when they reply. Thanks for the tip.

I heard from CS-Cart development team a few weeks ago and the quoted price is around $600 to implement what I need into my cart.



I am going to make a decision by Wednesday to pursuit the custom work or not. The price is probably worth it because of the sales it will help generate, not to mention the ease of use for the customer.



Is this my best option? Any opinions on this would be appreciated.