[Skip to main content](#vessel-content)

#   Change price calculation

##

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183280](#183280) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183280 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")* was created by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")*

-- url of the page with the problem -- : [ www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat](http://www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat)
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 2.5

Hi,

I'm creating a webshop for a printing company.
The current hikashop configuration allows to order products.
So, example situation:
I have two pieces: first one is 30x30cm (€ price_a), second one is 60x40cm (€ price_b).
A customer can order, sees the amount and pays.

The owner of this company wants to change it:
he has the custom fields width and height and want to define a price per cm², in stead of per product.

Does someone know how I can configure this?
So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 10 months ago [\#183305](#183305) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183305 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Hi,

You can follow the instructions of the section "How to sell products by Width and Length ?" of our FAQ:
[ www.hikashop.com/support/support/documen...on/106-faq.html#cart](http://www.hikashop.com/support/support/documentation/106-faq.html#cart)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mohairbears](/forum/user/916-mohairbears "View mohairbears's Profile")**
- [![mohairbears's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/916-mohairbears "View mohairbears's Profile")
- [ Offline](/forum/user/916-mohairbears)

Less More

- Posts: 609
- Thank you received: 13
-

11 years 10 months ago [\#183322](#183322) by [mohairbears](/forum/user/916-mohairbears "View mohairbears's Profile")  Replied by *[mohairbears](/forum/user/916-mohairbears "View mohairbears's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183322 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Hi, I sell with widths &amp; lengths etc. Best way is to set up 'Characteristics' for this requirement or simply if selling only by cm² is to set up the price for cm² and put in the description that it's sold by cm² they can put amount required in the quantity box if more than 1 cm² piece is needed.

Hope this helps.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183324](#183324) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183324 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Hi,

thanks for the fasts responses.
It's no solution to put the amount of cm² in the quantity field:
for some products he can do this (e.g. wallpaper), but for some products (like a canvas) he wants to have the amount of products in the quantity field. Those products have a width and length (and so a cm² defined).
Now he want to set a price per cm² and he wants the price being calculated based on the cm²...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mohairbears](/forum/user/916-mohairbears "View mohairbears's Profile")**
- [![mohairbears's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/916-mohairbears "View mohairbears's Profile")
- [ Offline](/forum/user/916-mohairbears)

Less More

- Posts: 609
- Thank you received: 13
-

11 years 10 months ago [\#183325](#183325) by [mohairbears](/forum/user/916-mohairbears "View mohairbears's Profile")  Replied by *[mohairbears](/forum/user/916-mohairbears "View mohairbears's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183325 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

you put the amount you have in stock in the quantity box i.e. if you have 10 cm² then put 10 in quantity (you can leave this as the default (unlimited) if you have loads of stock, then set the price for 1 x cm², is someone wants 5 x cm² they put '5' in the box (front end) and the price will be calculated for 5 x cm² also reducing your stock by 5 x cm² (if set)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183608](#183608) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183608 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Hi,

I know you can do it like that, but it's not that clean right?
It's just: 1 product (e.g. mouse mat) can have two dimensions 30x30cm (i.e. 900cm²) or 40x20cm (i.e. 800cm²).
The price needs to be calculated based on the width and height of the product (characteristics), but the quantity is the amount of products (e.g. mouse mats) that the customer wants to buy.
So the price is the amount of cm² x price_per_cm² x quantity....

Is there a clean solution to do this, without adapting the PHP code of hikashop?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183610](#183610) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183610 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

I found I can do this by using a template override on the hikashop_product_price_for_quantity_in_cart(&amp;$product) or hikashop_product_price_for_quantity_in_order(&amp;$product) method.

The issue now is that I don't find documentation (or if possible) an example on how to do template overrides for a particular product...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 10 months ago [\#183612](#183612) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183612 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

@MaartenVdp The link I gave in my message has a plugin which implements that in order to achieve what you want.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183656](#183656) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183656 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

So,

I searched further. It can be enough that I define a price on the product level (without length and with characteristics).
The price that needs to be created when I add width and height characteristic has to be width x height x global price product (will be defined per cm²).

Is there a way to manipulate how the prices are calculated and stored into the database?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183681](#183681) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183681 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Thank you very much!!!

I didn't see that it was a link :blush:
I just saw that I had to create the plugin....
Many thanks!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183753](#183753) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183753 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Hi Nicolas,

I installed the plugin, but nothing is happening....
- I installed the plugin (with these changes:
if(!function_exists('hikashop_product_price_for_quantity_in_cart') &amp;&amp; !function_exists('hikashop_product_price_for_quantity_in_order')) {
function hikashop_product_price_for_quantity_in_cart(&amp;$product){
$currencyClass = hikashop_get('class.currency');
$quantity = @$product-&gt;cart_product_quantity;
if(!empty($product-&gt;length) &amp;&amp; !empty($product-&gt;width)){
$quantity = 500;//$quantity*$product-&gt;length*$product-&gt;width;
}
$currencyClass-&gt;quantityPrices($product-&gt;prices,$quantity,$product-&gt;cart_product_total_quantity);
}

function hikashop_product_price_for_quantity_in_order(&amp;$product){
$quantity = $product-&gt;order_product_quantity;
if(!empty($product-&gt;length) &amp;&amp; !empty($product-&gt;width)){
$quantity = $quantity*$product-&gt;length*$product-&gt;width;
}
$product-&gt;order_product_total_price_no_vat = -100;//$product-&gt;order_product_price*$quantity;
$product-&gt;order_product_total_price = -50;//($product-&gt;order_product_price+$product-&gt;order_product_tax)*$quantity;
}
}

just to see that it's working...
- I have width &amp; length and published it on the front end.
Now I still have the old prices on the front end

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 10 months ago [\#183800](#183800) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183800 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Hi,

The prices will only change in the cart since that an override of the quantity price calculated when the cart is loaded in memory.
So make sure that the plugin is published and that you're looking at the price of the product in the cart.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183859](#183859) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183859 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

And what do you have to override in the following scenario:

I give as a price for the global product: €amountA (e.g. mouse mat) ==&gt; price is per cm²
mouse mat has 2 variants: 20x20cm, and 40x40cm.
when I enter those variants, with there length and with, I want to have the price calculated based on the global price set.
Is this possible through a hikashop plugin, or should I add a database trigger?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 10 months ago [\#183862](#183862) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183862 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

If you want to have fixed variants, and not fields where the user can enter anything, you don't need any plugin or database trigger.
Just click on the "manage variants" button of the product edition page, edit each variant, and enter what you want in the field "Main product price percentage" of each one.
The price will then be calculated automatically for each variant.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

11 years 10 months ago [\#183931](#183931) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  Replied by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183931 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

Aha ![:)](/media/kunena/emoticons/8.png ":)")
this is indeed what I'm looking for.
Is there a plugin way to put in "product price percentage" automatically "width * length"?
like the quantity plugin for the cart

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

11 years 10 months ago [\#183938](#183938) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change price calculation](/forum/26-product-category-display/873643-change-price-calculation#183938 "-- url of the page with the problem -- :   www.print-foto.com/NL/fotoafdrukken/foto/foto-op-voetmat  -- HikaShop version -- : 2.3.1 -- Joomla version -- : 2.5  Hi,  I'm creating a webshop for a printing company. The current hikashop configuration allows to order products. So, example situation: I have two pieces: first one is 30x30cm (€ price&#95;a), second one is 60x40cm (€ price&#95;b). A customer can order, sees the amount and pays.  The owner of this company wants to change it: he has the custom fields width and height and want to define a price per cm², in stead of per product.  Does someone know how I can configure this? So, I'll have a price per cm² for each product and the price will be calculated for the dimensions.")*

There is no plugin for that.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzM2NDMtY2hhbmdlLXByaWNlLWNhbGN1bGF0aW9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.485 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
