Possible to calculate with custom fields?

  • Posts: 1
  • Thank you received: 0
8 years 11 months ago #221843

-- 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,-

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 11 months ago #221879

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum