Vote up!
Vote down!

Custom pricing based on dimensions

Hi all,

I’m hoping that someone can point me in the right direction or give me some feedback on a project that I’m working on. What I’m trying to do is create a pricing structure based on user input, specifically calculating sign and banner costs. The user will have ability to enter a length, width, quantity and the material type then the data will be multiplied by the square foot unit cost of that particular material type to give an instant quote on how much the sign or banner will cost.

I’m wondering if this is even possible in current way commerce is setup? If not where is the best place to start to get this configured. I realize that is a very specific questions but I’m not really sure where to start.

Thanks in advance for any advice!

Asked by: jschoen
on July 9, 2012

1 Answer

Vote up!
Vote down!


This is an easy one! You can create a customizable product.

And then you can use pricing rules to determine the price!

Josh Miller
Answer by: Josh Miller
Posted: Sep 5, 2012


Hey Josh, I've watched the videos and only started dabbling in rules. Can you provide a few steps to guide in configuring this?

I'm looking for a similar thing for a large print website -- that is, the customer fills in dimensions of ft/in x ft/in and gets a square foot total and the fee based on our per sq ft price. Thanks for your help.

- lastar84 on September 20, 2012

This sample caculation is what I'm trying to achieve. I'm guessing that I create line item types for the feet/inches boxes, and then apply calculations through rules?

- lastar84 on September 24, 2012

After several days of experiments and research, I don't think this is doable without writing a dedicated module. The functionality doesn't appear to exist in the mentioned modules for something like this:

Fields a, b, c, d, are completed by a visitor. These represent feet and inches for height and length. When a button is clicked, it calculates a + b x c + d, and updates a sum field for total square footage. It then provides a price based based on sum multiplied by the price per sq ft.

For one thing, where would the button come from for this calculation? I may have overlooked it, but it doesn't seem to be an available custom line item. Something needs to trigger the calculation, and if the fields are revised, to trigger a re-calculation. I'm curious if anyone has come up with a solution for selling products based on dimensions in D7. I have found possible solutions for Ubercart in D6, as can be seen in action here -- and I'm afraid that the quickest answer at this point is returning to D6.

- lastar84 on September 26, 2012

Have you found a solution to this? im looking to do the same thing. (i have only come far enough to see the custom line item moduleS)

- petergus on February 19, 2013

I still have not found a solution, and so we have begun searching for an outside contractor. Area and volume calculations are easy to do in plain old PHP sites with a little help from JavaScript. But integrating this into Drupal Commerce has become a nightmare for us, unfortunately. This is a strange thing not to have readily available for Drupal Commerce, because so many products are sold by area or volume.

- lastar84 on February 20, 2013

@lastar84, i have infact figured it out! works great! Rules and custom line items ya!
Leave a comment here how i can contact you and i can help out if you want.

- petergus on February 26, 2013

@petergus Can you email me what you found out. I am trying to do something similar with the client giving inches, how many sides and quantity to figure out the price. Thanks.

- Ryan Condict on August 6, 2014