- Posts: 20
- Thank you received: 0
Questions about Payment Form extension
Adding two separate fields together
- Coughlin
- Topic Author
- Offline
- Junior Member
-
Less
More
13 years 1 month ago #13837
by Coughlin
Adding two separate fields together was created by Coughlin
As the title suggest:
I have a sign up form I am creating that has a couple different variables that are effecting final price of the form. It is signing up to stay in a hotel.
Basically one field is a dropdown with different pricing rates for the different hotels. ($100, $120, etc)
The next field allows selection of the number of nights staying at the hotel that was chosen.
I need a way to calculate the total derived from two separate fields.
This is what it would look like as an equation: Hotel A ($100) x Number of Nights (2) = total ($200)
Is there a way to have the form calculate this across the two fields?
I have a sign up form I am creating that has a couple different variables that are effecting final price of the form. It is signing up to stay in a hotel.
Basically one field is a dropdown with different pricing rates for the different hotels. ($100, $120, etc)
The next field allows selection of the number of nights staying at the hotel that was chosen.
I need a way to calculate the total derived from two separate fields.
This is what it would look like as an equation: Hotel A ($100) x Number of Nights (2) = total ($200)
Is there a way to have the form calculate this across the two fields?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
13 years 1 month ago #13845
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Adding two separate fields together
Hi
Basically, you can use Fee Formula to calculate the total fee. The instruction are :
1. Set Fee Field property of the pricing rates to No. But still enter data into Fee Values as if this is a custom fee field .
2. Set the Fee Field property of number of nights to Yes. In the fee formula of this field, enter :
[FIELD_VALUE]*[PF_PRICE_RATES]
(replace PF_PRICE_RATES with actual name of pricing rates custom field in uppercase) .
After that, it will work as expected .
If it still doesn't work, please submit a support ticket gives me administrator account of your site so that I can check the setup for you !
Regards,
Tuan
Basically, you can use Fee Formula to calculate the total fee. The instruction are :
1. Set Fee Field property of the pricing rates to No. But still enter data into Fee Values as if this is a custom fee field .
2. Set the Fee Field property of number of nights to Yes. In the fee formula of this field, enter :
[FIELD_VALUE]*[PF_PRICE_RATES]
(replace PF_PRICE_RATES with actual name of pricing rates custom field in uppercase) .
After that, it will work as expected .
If it still doesn't work, please submit a support ticket gives me administrator account of your site so that I can check the setup for you !
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Coughlin
- Topic Author
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 0
13 years 1 month ago #13862
by Coughlin
Replied by Coughlin on topic Re: Adding two separate fields together
Thank you that did work. However I am running into another problem.
I realized that I need to combine more than two fields to get a total on this form.
There are a total of 4 fields involved in the calculation of the total amount.
I have:
1. Hotel Requested (which has per night amount like $105)
2. How Many Nights Staying
3. Number of King Rooms Requesting
4. Number of Double Rooms Requesting
Can I use the same method of having the first 3 fields with the fee field turned off then enabling the 4th field as the fee field? Or is that to complicated for it to handle?
Addition and multiplication would be needed in this calculation. Figured it would look something like this, using the last field (number of double rooms) as the one to input the code:
([FIELD_VALUE]+[PF_KING_ROOMS])*[PF_HOTEL_STAYING]*[PF_NIGHTS]
Is that correct or is that something the form is not capable of?
I attached a screen shot of the form.
I realized that I need to combine more than two fields to get a total on this form.
There are a total of 4 fields involved in the calculation of the total amount.
I have:
1. Hotel Requested (which has per night amount like $105)
2. How Many Nights Staying
3. Number of King Rooms Requesting
4. Number of Double Rooms Requesting
Can I use the same method of having the first 3 fields with the fee field turned off then enabling the 4th field as the fee field? Or is that to complicated for it to handle?
Addition and multiplication would be needed in this calculation. Figured it would look something like this, using the last field (number of double rooms) as the one to input the code:
([FIELD_VALUE]+[PF_KING_ROOMS])*[PF_HOTEL_STAYING]*[PF_NIGHTS]
Is that correct or is that something the form is not capable of?
I attached a screen shot of the form.
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.