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

#   Calculate how much based on square meters

##

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

Less More

- Posts: 54
- Thank you received: 4
-
-

4 years 11 months ago [\#337710](#337710) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  *[Calculate how much based on square meters](/forum/26-product-category-display/903616-calculate-how-much-based-on-square-meters#337710 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 4.0.4 -- PHP version -- : 7.4.23 -- Browser(s) name and version -- : Edge -- Error-message(debug-mod must be tuned on) -- : No  For a customer I am busy making a shop for floor tiles. Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin. In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated. In the forum I will say that there was a plugin (  www.hikashop.com/support/forum/product-c...e-meter.html?start=0 ). However, this does not work with the current version of Hikashop. Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.")* was created by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")*

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 4.0.4
-- PHP version -- : 7.4.23
-- Browser(s) name and version -- : Edge
-- Error-message(debug-mod must be tuned on) -- : No

For a customer I am busy making a shop for floor tiles.
Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin.
In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated.
In the forum I will say that there was a plugin ([ www.hikashop.com/support/forum/product-c...e-meter.html?start=0](https://www.hikashop.com/support/forum/product-category-display/878176-price-per-square-meter.html?start=0)). However, this does not work with the current version of Hikashop.
Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM2MTYtY2FsY3VsYXRlLWhvdy1tdWNoLWJhc2VkLW9uLXNxdWFyZS1tZXRlcnM/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

4 years 11 months ago [\#337715](#337715) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Calculate how much based on square meters](/forum/26-product-category-display/903616-calculate-how-much-based-on-square-meters#337715 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 4.0.4 -- PHP version -- : 7.4.23 -- Browser(s) name and version -- : Edge -- Error-message(debug-mod must be tuned on) -- : No  For a customer I am busy making a shop for floor tiles. Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin. In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated. In the forum I will say that there was a plugin (  www.hikashop.com/support/forum/product-c...e-meter.html?start=0 ). However, this does not work with the current version of Hikashop. Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.")*

Hi,

The plugin is now available on our marketplace and is working with the current version of HikaShop:
[ www.hikashop.com/marketplace/product/151...h-length-plugin.html](https://www.hikashop.com/marketplace/product/151-shopcustom-width-length-plugin.html)

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

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

Less More

- Posts: 54
- Thank you received: 4
-
-

4 years 11 months ago -  4 years 11 months ago [\#337728](#337728) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  Replied by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")* on topic *[Calculate how much based on square meters](/forum/26-product-category-display/903616-calculate-how-much-based-on-square-meters#337728 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 4.0.4 -- PHP version -- : 7.4.23 -- Browser(s) name and version -- : Edge -- Error-message(debug-mod must be tuned on) -- : No  For a customer I am busy making a shop for floor tiles. Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin. In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated. In the forum I will say that there was a plugin (  www.hikashop.com/support/forum/product-c...e-meter.html?start=0 ). However, this does not work with the current version of Hikashop. Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.")*

It is workign (also under Joomla 4), but not expected as I thought.

When iI entering the width and Length there is nothinhg happening. Only when I added the items the the card I see the price is calculated.

What i searching for is that the quanty box is changed. Now it is for no one visible what is happening.

Last edit: 4 years 11 months ago by [Ginius](/forum/user/39267-ginius "View Ginius's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM2MTYtY2FsY3VsYXRlLWhvdy1tdWNoLWJhc2VkLW9uLXNxdWFyZS1tZXRlcnM/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

4 years 11 months ago [\#337736](#337736) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Calculate how much based on square meters](/forum/26-product-category-display/903616-calculate-how-much-based-on-square-meters#337736 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 4.0.4 -- PHP version -- : 7.4.23 -- Browser(s) name and version -- : Edge -- Error-message(debug-mod must be tuned on) -- : No  For a customer I am busy making a shop for floor tiles. Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin. In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated. In the forum I will say that there was a plugin (  www.hikashop.com/support/forum/product-c...e-meter.html?start=0 ). However, this does not work with the current version of Hikashop. Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.")*

Hi,

If you want something which directly displays the price, I would recommend you to check Calc Builder:
[ www.moonsoft.es/joomla/product/3-calc-builder](https://www.moonsoft.es/joomla/product/3-calc-builder)
It's compatible with HikaShop and allows for calculations but with many options compared to this basic plugin we provide.

If you're a developer, you could also stick with the plugin from the marketplace, and add some javascript on the product page to display the price before the product is added to the cart.
We did a complex custom development for one of our customers to have such dynamic calculation on the product page here:
[ www.danialu.fr/boutique/boutique-toiture...net/56-solinet-15-40](https://www.danialu.fr/boutique/boutique-toiture/boutique-toiture-etancheite/boutique-toiture-etancheite-solinet/56-solinet-15-40)

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

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

Less More

- Posts: 54
- Thank you received: 4
-
-

4 years 11 months ago [\#337788](#337788) by [Ginius](/forum/user/39267-ginius "View Ginius's Profile")  Replied by *[Ginius](/forum/user/39267-ginius "View Ginius's Profile")* on topic *[Calculate how much based on square meters](/forum/26-product-category-display/903616-calculate-how-much-based-on-square-meters#337788 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 4.0.4 -- PHP version -- : 7.4.23 -- Browser(s) name and version -- : Edge -- Error-message(debug-mod must be tuned on) -- : No  For a customer I am busy making a shop for floor tiles. Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin. In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated. In the forum I will say that there was a plugin (  www.hikashop.com/support/forum/product-c...e-meter.html?start=0 ). However, this does not work with the current version of Hikashop. Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.")*

Thanks for the answer. In th last example I see you have on the input field an onchange="updateQuantity(this) element. Where or how in a custom field can I add a onchange element?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM2MTYtY2FsY3VsYXRlLWhvdy1tdWNoLWJhc2VkLW9uLXNxdWFyZS1tZXRlcnM/dG1wbD1tYXJrZG93bg==) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

4 years 11 months ago [\#337791](#337791) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Calculate how much based on square meters](/forum/26-product-category-display/903616-calculate-how-much-based-on-square-meters#337791 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 4.0.4 -- PHP version -- : 7.4.23 -- Browser(s) name and version -- : Edge -- Error-message(debug-mod must be tuned on) -- : No  For a customer I am busy making a shop for floor tiles. Based on the total area of the room, the number of boxes to be purchased must be calculated. This would involve a custom plugin. In this case, the user specifies the length, width and cutting loss, the number of packages is automatically calculated. In the forum I will say that there was a plugin (  www.hikashop.com/support/forum/product-c...e-meter.html?start=0 ). However, this does not work with the current version of Hikashop. Is there a plugin available or a base that I can customize or an example of a plugin that I can customize? I have programming experience.")*

Hi,

In the file show_block_custom_item.php , that you can edit via the menu Display&gt;Views, you can see this line: Code:

' '.$onWhat.'="window.hikashop.toggleField(this.value,\''.$fieldName.'\',\'item\',0);"',

This line already adds a onchange to the custom item fields.
So you can just call your javascript function from there. For example:
Code:

' '.$onWhat.'="window.hikashop.toggleField(this.value,\''.$fieldName.'\',\'item\',0); my_custom_javascript_function();"',

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDM2MTYtY2FsY3VsYXRlLWhvdy1tdWNoLWJhc2VkLW9uLXNxdWFyZS1tZXRlcnM/dG1wbD1tYXJrZG93bg==) 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.058 seconds

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