- Posts: 52
- Thank you received: 4
Calculate how much based on square meters
4 years 10 months ago #337710
by Ginius
Calculate how much based on square meters was created by Ginius
-- 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.
-- 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.
Please Log in or Create an account to join the conversation.
4 years 10 months ago #337715
by nicolas
Replied by nicolas on topic Calculate how much based on square meters
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
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
Please Log in or Create an account to join the conversation.
4 years 10 months ago - 4 years 10 months ago #337728
by Ginius
Replied by Ginius on topic Calculate how much based on square meters
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.
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 10 months ago by Ginius.
Please Log in or Create an account to join the conversation.
4 years 10 months ago #337736
by nicolas
Replied by nicolas on topic Calculate how much based on square meters
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
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
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
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
Please Log in or Create an account to join the conversation.
4 years 10 months ago #337788
by Ginius
Replied by Ginius on topic Calculate how much based on square meters
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 or Create an account to join the conversation.
4 years 10 months ago #337791
by nicolas
Replied by nicolas on topic Calculate how much based on square meters
Hi,
In the file show_block_custom_item.php , that you can edit via the menu Display>Views, you can see this line:
This line already adds a onchange to the custom item fields.
So you can just call your javascript function from there. For example:
In the file show_block_custom_item.php , that you can edit via the menu Display>Views, you can see this line:
Code:
' '.$onWhat.'="window.hikashop.toggleField(this.value,\''.$fieldName.'\',\'item\',0);"',
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 or Create an account to join the conversation.
Time to create page: 0.130 seconds