Divided in custom fields

  • Rafael Cavalcante
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 weeks ago - 7 years 3 weeks ago #96197 by Rafael Cavalcante
Divided in custom fields was created by Rafael Cavalcante
Hello Tuan,

I need to create a custom field in list format that follows the following specifications.

TYPE - list
VALUES - yes
- no
SELECTED VALUES - no

Rate field - yes

When we select the NO option, the value of the plan remains unchanged. And when we select the YES option the value of the plan will be divided by 2.

In the values ​​of the rates I put it like this:
/1
/2

Is not working.

How to insert the Mathematical division function correctly?

Grateful.
Last edit: 7 years 3 weeks ago by Rafael Cavalcante.

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

More
7 years 3 weeks ago #96230 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Divided in custom fields
Assume the price of the plan is 100, then put the below values to fee values:

0
-50

By doing that, when users select No option, the price will be substracted by 50 and it should solve the issue

Tuan

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

  • Rafael Cavalcante
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 weeks ago #96312 by Rafael Cavalcante
Replied by Rafael Cavalcante on topic Divided in custom fields
Actually I already have a sum field added in the plan. I really need to divide by 2.

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

More
7 years 3 weeks ago #96315 by Alan Bennett
Replied by Alan Bennett on topic Divided in custom fields
I think what we really need is the ability to embed php in the specification of custom fields. Tuan and I discussed this some time ago.

See how another subscription component (RS Membership) offers this:

•(*) In the Values area custom PHP coding can be used, enclosed in between the following tags: //<code>,//</code>. Example (will add the current server date):
//<code>
return date();
//</code>

This would enable values to be set in any way we need.

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

More
7 years 3 weeks ago #96334 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Divided in custom fields
Hello Rafael

The question is what amount will need to get to divide 2? Could you send me the link to subscription form and explain how the fee should be calculated?

I will then look at it to see whether there is a way to setup and guide you

Tuan

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

  • Rafael Cavalcante
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 weeks ago #96376 by Rafael Cavalcante
Replied by Rafael Cavalcante on topic Divided in custom fields
Hello Tuan,

Follow the link of the form, as you can see is very extensive.

www.cra-ce.org.br/websistema/index.php/r...soa-juridica/sign-up

In the option "Capital Stock" when the user selects an option a quantity is added to the value of the subscription. Therefore, since there are eight options in the field "Capital Social", it is not feasible to place only a simple subtraction.

It is necessary to create one another field that will have two selection actions (main / secondary) where main will be preempted the value without changes and Secondary that will be the value of the inscription, added to the value of Capital Social divided by 2.

(Inscrição+capital social)/2

In the descriptive custom rate field says that we can use any mathematic operation, but when I try to split it does not work.

Thanks for your help.

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