- Posts: 1
- Thank you received: 0
Possible to calculate with custom fields?
10 years 10 months ago #221843
by Pixvisual
Possible to calculate with custom fields? was created by Pixvisual
-- HikaShop version -- : 2.6.0
I would like to create a webshop for rental of items. With the business edition, is it possible to add 2 custom date fields (start and end date for rental) and then automatically calculate how many days this is?
Is so, I would like to multiply the number of days with a certain amount.
Example:
1 day = €100,-
Additional days = €15,- / day
Having selected December 1 - December 3, it should be calculated that this is 3 days. 3 days x €15,- = €45,- + €100,- = 145,-
I would like to create a webshop for rental of items. With the business edition, is it possible to add 2 custom date fields (start and end date for rental) and then automatically calculate how many days this is?
Is so, I would like to multiply the number of days with a certain amount.
Example:
1 day = €100,-
Additional days = €15,- / day
Having selected December 1 - December 3, it should be calculated that this is 3 days. 3 days x €15,- = €45,- + €100,- = 145,-
Please Log in or Create an account to join the conversation.
10 years 10 months ago #221879
by nicolas
Replied by nicolas on topic Possible to calculate with custom fields?
Hi,
Yes, that's possible.
You need to create custom fields of the table "item" via the menu Display>Custom fields, and then you need to write a small hikashop plugin in order to do the calculation based on the values entered in the custom fields.
You can see an example of that with the donation plgin which takes the value of a custom item field and use it as the price of the product:
demo.hikashop.com/index.php/en/hikashop/...t-page/donation-page
Yes, that's possible.
You need to create custom fields of the table "item" via the menu Display>Custom fields, and then you need to write a small hikashop plugin in order to do the calculation based on the values entered in the custom fields.
You can see an example of that with the donation plgin which takes the value of a custom item field and use it as the price of the product:
demo.hikashop.com/index.php/en/hikashop/...t-page/donation-page
Please Log in or Create an account to join the conversation.
Time to create page: 0.155 seconds