• Resolved franpena

    (@franpena)


    Hi,

    I’d like to ask whether it is possible to operate two fields and to show the result in the [pdb_signup] page.

    The reason is that I’d like to ask users how many products of a fixed price they like. At the end of the page, the final price (fixed price multiplied by number of items) should appear.

    Thanks in advance.

    https://wordpress.org/plugins/participants-database/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author xnau webdesign

    (@xnau)

    It’s possible, but it wouldn’t be too easy, the plugin isn’t really designed for that sort of thing. You may find something like this easier to do with a plugin for selling products where there is a quantity selector and a price.

    Thread Starter franpena

    (@franpena)

    Just to complete the answer to my own question, I have been able to add two variables from the Signup page, and show the result in the Thanks page, following these instructions:

    1. Copy the file wp-content/plugins/participants-database/templates/pdb-thanks-default.php to wp-content/themes/[your_used_theme]/templates, where [your_used_theme] stands for the name of your used theme (create the folder if it does not exist).

    2. Edit this file from WordPress, i.e., go to Appearance – Editor – pdb-thanks-default.php

    3. Include the following lines inside the main <div>:

    <?php
       $total = $this->record->[group]->fields->[var1]->value + $this->record->[group]->fields->[var2]->value;
       echo "<p>The total amount you have to pay is ".$total."€.</p>";
      ?>

    where [group], [var1] and [var2] stand for, respectively, a group and two variables in the Participants Database list.

    Plugin Author xnau webdesign

    (@xnau)

    Good solution…glad you figured it out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Operate two fields and show the result in the signup page’ is closed to new replies.