Accordeon Section with fields price calculation

  • wegwb
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0

wegwb created the topic: Accordeon Section with fields price calculation

Hi there,
i need your help.

Ive to create a form thats represent some offers for catering and we would like to organized thats categorys with accordeon headlines. E.g. Kalte Platten, Salate, Suppen, Fleisch and so on. The user have now the choice to see the offers inside this section.
Inside the accordeon there are many food articles like differs met products(pork, beef, chicken)
Behind these fields are placed the prices thats are invisible for the user and the possiblity to insert a ammount of products for the users choice.
CheckboxDescription of the productammount
After some sections of the products the user should have visible a summery price and the possiblity to change the checkboxes(choice of products) and set the ammount of products to passed his budget. Atfer the submit the list with ordered products its to e-mail to the client and me. I hope my decription its easy understanding.

Can anyone give me an example for that?
#238297
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2738
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: Accordeon Section with fields price calculation

Hello,

I am not sure about every part, but I get the general idea about what you want to achieve.

Create all the elements that you want to have in the form and add a "total" filed at the end. You can use select list for each of the meals defined like follows:
0;0;
0;1;1
0;2;2
...

Then add an additional page to your form which will be consisted of summarize elements for each field in your form.
In the Properties of the summarize elements, check the "Hide row if empty" checkbox so that meals which were not selected do not appear in the summary.
A user won't be able to change the quantity there, but he can go back and correct quantity if wanted.

As for calculating the total, do as follows.

Go to form's Advanced properties > More options > Scripts and in Initialization script set Type to Custom and put there the following code:
function ff_FORMNAME_init()
{
setInterval('calc()', 500);
} // ff_FORMNAME_init


function calc() {

var total = 0;

total = Number(ff_getElementByName('chicken').value) * 6 + Number(ff_getElementByName('beef').value) * 8 + Number(ff_getElementByName('pork').value) * 7;

ff_getElementByName('total').value = total;

}
NOTE: In the code above replace FORMNAME with the Name of your form.
Also, in the code replace 'chicken' with the name of the field in your form and 6 with the price for that concrete meal. Add to the sum all of the meals from your form.

Let me know whetehr this helped.

If you have more questions, feel free to ask.

Regards,

Mihaela
#238303
  • wegwb
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0

wegwb replied the topic: Accordeon Section with fields price calculation

Okay sometimes i can give u an optic example with 2 accordeon with list inside.
Maybe u can see whats the form should do.
example accordeon form(only visuell)https://macherclub.de/partyservice
#238309
  • wegwb
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 7
  • Thank you received: 0

wegwb replied the topic: Accordeon Section with fields price calculation

Hello Mihaela,

u described a solution with select list. Ive created now an form with checkbox and a textfield(integer only) with the ammount of the choice. Thats the base for all other products. Now im ask u How can i set the fields right?
1. Only calculate price if checked the checkbox than with the ammount of the textflied input.
2. How can is set page´s to an accordeon?

i would be happy for an answer.
#238382
Moderators: ForumSupporttomeperica
Time to create page: 0.105 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here