Product Price By Size

User guide for the Product Price By Size module for Prestashop. A module which allows dynamic price calculation for products based on area, size, dimensions or other fields.


The Product Price By Size module is a powerful solution for Prestashop store owners who will be selling products which are cut / tailored to size for customers. Customers should be able to enter the dimensions they require on the product page and these should be used to calculate a dynamic price.

For example, store owners may be selling DIY products such as glass sheets, wood skirting, wood pieces, fabrics, cloths or stationery such as signage which would have a dynamic price according to the area using a formula such as £1.00 per m2.

So in short, if you need dynamic prices for your product which are calculated based on measurements or values the customer enters then the Product Price By Size module is an ideal solution.


The installation procedure is very much similar to most other Prestashop modules. No core changes are required therefore installation is straight forward. Be sure to follow the instructions below for a successful installation:

  1. Upload the module folder to your store’s module folder: {root}/modules/
  2. After uploading the module, in the Prestashop Back Office, head over the to the Modules section.
  3. Search for the module and choose the install option
  4. After a successful installation the module is ready to be used. Initially the module’s main configuration page will be displayed. We’ll take a look at how to use the module in this user guide.


Configure the product price by size module

After installing the module, we’re ready to start configuring the global configuration options. Locate the module in the modules list and click
the configure link. You will be presented with several tabs, these are Dimensions, Units, Area Price Suffixes, Translations, Equation Templates, Global Options and Mass Assign.

During the installation of the module, sample data is installed for all the above tabs to help you get started with the module quicker, however you can customize each of these, adding, editing and deleting to suit the needs of your store. We’ll now take a more detailed look at each of these tabs.


Configuring the dimensions

This is a list of fields which will be displayed on your front end product page, into which the customer can enter a numeric value or select
from a predefined range of values. The values entered into these dimension fields will be used to calculate a dynamic price for your product.

By Default the module creates height, width and depth. You can create new dimensions by completing the form presented on the right
hand side.

If your store is a multi-language store then don’t forget to enter all translations for the dimension name (by using the language selector next to the dimension name field).


Units are displayed next to the dimension fields on the product page and in the customer cart to denote in which metric unit you are selling
this product in and cutting to size, for example, meters, centimeters, inches, ounces, kg … you get the idea.

The module comes with a host of predefined units including their associated symbols. You can add or edit as you need within this panel.


All of the module translations can be found under the International > Translations menu in the back office as usual. However some translations are not available there, those translations can be found under the translations tab in the module confi0guration page.

Equation Templates

Displays a list of equation templates you have created for reuse across multiple products. Equation templates are created and edited under
the product edit sections of the back office. You can either create unique equations individually for each product or create a template here to allow you to conveniently re-use the same equation across different products.

We’ll take a closer look at equations later in this guide.

Global Options

You’ll see global options related to the module here, the options are:

Display Total Area
Enable this option if you would like the total area entered by the customer to be displayed on the product page.

Mass Assign

Mass Assign module settings

The Mass Assign tab allows you to copy settings from one product to multiple products and / or categories across your store. To use the feature start typing in the name in the product search field and select the product you wish to copy settings from.

After selecting the product you wish to copy settings from, select the category or categories you wish to copy the module settings to. If you
select a single category, you can select individual products in that category. If you select multiple categories then the module settings will be copied across to all products in those selected categories.

Setting up your Products

Once the general module configuration has been saved, we’re ready to move on and set up a product(s) to take advantage of dynamic product prices.

Firstly, choose a product to edit in the back office and under the Modules tab, select product price by size.

To help you set up dynamic pricing, it may help if you go through and answer the questions in the list below before you start setting up your

  • Which dimensions should the customer enter and should they be “free form” values or do you need the customer select from a predefined list of values
  • What is the dynamic price of my product? for example £1.00 per m2
  • Does the customer enter dimensions in a unit different to the unit price the product is cut to size in?
  • How will be the dynamic price be calculated? It may help to write down the formula
  • Do I need to restrict the values the customer can enter into the dimension fields?
  • If my product has attributes, how will they affect the price?

With the above all clarified we’re in a good place to start setting up dynamic pricing for your product.

Methods of calculating a dynamic price

The module uses 3 methods to calculate a dynamic price, let me discuss each of these with you:

Linear Calculation

This is the default method the module will use to calculate a dynamic price for your product. The formula simply multiples all the dimensions entered by the customer with the price of the product. For example, if you have chosen to display Height and Width dimensions on your product page, then the price will be calculated as follows:

dynamic price = Length x Width x Product Price

Area ranges based pricing

This method allows for a more sophisticated approach to calculating a dynamic price. The method allows you to create ranges of areas and
influence the price based on these area ranges. We’ll explore this method in more detail later in this article.

Custom Calculations

This final approach is the most powerful of all and gives you greater control of how your dynamic prices are calculated by allowing you to
define a custom formula. What’s more, you can even set up different formulas for different attributes. We’ll look at this more later on.

For now lets take a look at the general options in the product price by size tab.

General Options

General Options for configuring dynamic product price

The first panel, provides some general options related to the product as show below:

Let’s take a look at the options.

This option simply determines if this product will use a dynamic price or not. Setting it to no will cause the product to behave as any other standard product in Prestashop, i.e the module will not influence the product in any way.

Use Attribute in calculation
This option will affect Linear calculations and area based calculations. When set to no, the attribute price is simply added to the end of price calculation as follows:

dynamic price = (Length x Height x Product Price) + Attribute Price Impact

Switching this option to Yes, changes it so that the formula becomes:

dynamic price = Length x Height x (Product Price + Attribute Price Impact)

As you can see above, if set to yes the attribute price impact is included in area price.

Charge Minimum Price
If your product must have a minimum price regardless of the area ordered by the customer then you can use this option to set the minimum price. Therefore if the dynamic price calculation ever falls below the min price, the module will charge the minimum price you have set for this product.

Leave this option empty or enter 0 if a minimum price should not be applied.

Charge setup Fee
Some products may have a additional setup fee in addition to the dynamic price. Enter any setup fees into this field and it will be added to the total product price.

Convert Units entered by the customer?
If customers will be entering the dimensions to order in a unit which is different to that which you price your product in, then enable this option and tell the module how to do the conversion.

For example, your product is priced in m2 (£1.00 / m2) but you would like your customers to enter Length and Width in cm, in this case we need to tell the module to convert from cm to m, and to do this set the Conversion formula to divide by 100. Now whenever the module calculates the price it will divide whatever the customer enters by 100, in effect converting from cm to m.

You can change these to suit your needs to convert to and from other units such as feet, inches etc.

Assigning fields to products

Managing Product fields

Each product can display a different set of dimension fields on the front end product page for a customer to enter the size / area of their order.

Under this section you can select which dimension fields will appear, along with additional options.

When adding a dimension field to a product, you have the ability to define the following properties for each field individually:

  • Dimension select a dimension from the list of dimensions you set up in the main module configuration, for example : Width
  • Unit choose the unit to be displayed next the fields on the product page, cart and order emails etc
  • Min set any value above zero here to ensure the customer enters a value in the field above this minimum value
  • Max set any value above zero here to ensure the customer enters a value in the field below this maximum value
  • Default Value The numeric value displayed in the dimension field by default
  • Input Type Choose whether you would like to display a text box or a drop-down select for the customer to enter the dimensions into. If you choose a drop-down select field then the customer will select a value from a list of possible values. You can define the values by clicking the “Edit Drop Down Values” button.
  • Decimals the number of decimals the input field will accept. This only applied to text input fields and not the drop down
  • Step Allow the input field to only accept certain increments of numbers. For example, if you enter 5 into this this field, the customer will only be able to enter multiples of 5 into the fielld on the product page (5, 10, 15 etc). If the customer enters anything in between it will be rounded up to the next step increment.

When adding a field to a product you’ll need to enter the properties as described in the list above. The list of dimension fields you assign will appear in this section as a list, you can use the controls in the list to edit, delete or rearrange the dimension fields at any time.

Custom Calculations

Managing Product fields

A powerful feature of the Product Price By Size module is to allow you to define a custom formula to calculate your product price. Furthermore you can even create individual custom formulas for each of your different attributes. This feature allows you to define extremely flexible dynamic price calculations.

To use custom calculations the first thing you will need to do is enable the option as shown in the screen shot, after which you will want to create your calculation. Click the Edit button in the custom calculation panel to start editing the custom calculation. You should see a pop up resembling a calculator appear; use this tool to create your calculation. You will notice the calculator allows you to also insert variables such as various dimensions, product price, attribute price, base price etc.

On the right hand side select All Combinations before creating your equations, or if you wish to create combination specific equations then select the specific combination.

Once done save your calculation and the pop up should close.

If you need to create different formulas for calculating a dynamic price for each attribute, you can do so by clicking the edit or pencil icon next to the attribute and the calculator for that specific attribute will appear.

Area Based Prices

The Area Based prices as discussed earlier is the last of the methods for calculating a dynamic price for products. It allows you to setup different area prices based on the total area range order by the customer.

Let’s take a look at an example.

Let us assume you are selling PVC sheets which are cut to size for the customer. The Customer can enter the length and width they require on the product page.

The cost of your PVC sheet is £10.00 / m2. However you want to encourage customers to buy more so you would like to drop the price down to £9.00 / m2 if they order more than 50 m2.

In this section you can create such pricing structures. Enter the range of areas such as: 0 to 50, 51 to 100 etc.. and set the price impact for each range. When setting the Price Impact you can use the following 3 operations.

Increase By
This will increase the base product price by the amount you specify. So if your base price is set 10.00€, you can choose to increase it by X amount for a specific area range. The final price will then be used in the dynamic price calculation.

Decrease By
A identical to the above but instead of increasing the base product price, it will decrease instead. This method is useful if you want to make the product cheaper the more the customer orders.

Fixed Price
The price you enter will be the final price used for the areas that fall within the range. No calculations are performed.

Stock Management

Area based stock management

The stock management feature in the module allows you to manage stock for your products based on area rather than discreet quantities. If the customer attempts to purchase a total area which is greater than the available area in stock then the module will prevent the customer from purchasing the product.

You can find the stock management options under the stock management tab and the options should be similar to that below:

Simply enable stock management by toggling the stock management switch and enter the area available for each product combination and
then save. If your product does not contain combinations then a single stock quantity field is displayed instead for you to populate.

Front End Setup

After enabling the module for a product, it will automatically displayed on the product page and is ready to use, no further configuration
should be required at this point.

Get Product Price By Size on Prestashop Addons site

Get Product Price By Size on Prestafusion