CalcBuilder Forum

Display 'Name' of an option list in the report

User pouce 2016-04-03 00:07:21

Hello,

Thanks for your joomla extension, calc builder, it is awesome! I use joomla 3.5 on php 7 and all is working smoothly

I made a price calculator with fields that are option list. So for an option list there is a Name and a Value.
I would like to show in my report (email, pdf) the Name and the value of the fields to make a description of the price they pay and what for. Is it possible? natively.

For example, I have an option list with Name 'Once a week' with the value '15' € and another 'Once a Month' with the value '5' €
I would like to describe the price as follow:

"You have subscribed to our service at the price of 15 € per month. The task will be done Once a week."

So if the field is $price, I can easily display the value in the report using ##price## but how can I display the name of the option list field ?

Thanks in advance,
Best regards,

Pouce

Edited by pouce - 03.04.2016 00:09

Edited by pouce - 03.04.2016 00:10

Moonsoft support 2016-04-03 10:09:01

Hello,
thanks for the feedback, highly appreciated!. Yes, you have access either to the value of an option, or the text that shows at the option list (the name). You only need to add _name to get the text attached. For ex, if you have an option list field with name 'myoptionlist', you will be printing the value selected with

##myoptionlist##

and the text attached with

##myoptionlist_name##

Please note you can also freely build different texts according to the value selected, using a new variable at the code, for ex:

if($myoptionlist=="15") { $mynewtext="You have subscribed to our service at the price of 15 € per month. The task will be done Once a week.";}
if($myoptionlist=="5") { $mynewtext="You have subscribed to our service at the price of 5 € per month.....";}


and then print at your output your new ##mynewtext## to have the custom text included.

Hope this helps, regards

...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!