Questions about Payment Form extension

FORM_AMOUNT in field fee calculations

  • mrjansen
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #5189 by mrjansen
FORM_AMOUNT in field fee calculations was created by mrjansen
I think that for a text field, it would be more useful to offer FEE_AMOUNT as an additional parameter available in the field calculation.

As it stands, in your helper/fields.php file, the code only looks for two things:
Code:
$formula = str_replace('[FORM_AMOUNT]', $formAmount, $formula) ; $formula = str_replace('[FIELD_VALUE]', $postedValue, $formula ) ;

Why not offer [FEE_VALUE], from the "Fee Values" field???

The reason I ask is that I integrated the component with a membership level, pulled from Community Builder.

The form amount changes dynamically based on membership type, but I set the Form Amount as "0" and am calculating the totals based on the FEE mapping.

This would be quite useful for more dynamic Form values, based on membership levels (as specified in CB).

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

More
13 years 6 months ago #5220 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: FORM_AMOUNT in field fee calculations
Hi

The [FORM_AMOUNT] tag is only used for textbox field type. For your membership fields, I think you can use radiolist custom field type. In this case, the fee will be calculated based on the fee values field .

Please have a look at joomdonation.com/index.php?option=com_co...icle&id=70&Itemid=54 to see the sample custom field which I created for membership .

Thanks,

Tuan

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

More
12 years 7 months ago #11237 by azurelink
Replied by azurelink on topic Re: FORM_AMOUNT in field fee calculations
admin wrote:

Hi

The [FORM_AMOUNT] tag is only used for textbox field type. For your membership fields, I think you can use radiolist custom field type. In this case, the fee will be calculated based on the fee values field .

Please have a look at joomdonation.com/index.php?option=com_co...icle&id=70&Itemid=54 to see the sample custom field which I created for membership .

Thanks,

Tuan


Tuan,

Does this mean that in spite of what it says in the Payment Form component about the Fee Formula only being "applied for textbox field type", that I can use a field formula like this "[FORM_AMOUNT]*.1" in conjunction with a radiolist field type? I need a way to apply a 10% discount to the price.

In my case, I have a Dropdown field type designated as a Fee Field which I need to apply a 10% discount to, if the above Radiolist field is clicked.

Please advise at your earliest convenience.

Thanks,
azurelink

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

More
12 years 7 months ago #11243 by azurelink
Replied by azurelink on topic Re: FORM_AMOUNT in field fee calculations
Oh, I just reread your post Tuan and now see that you said the "fee will be calculated based on the fee values field" instead of using the Fee Formula. Sorry

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

Moderators: Tuan Pham Ngoc