• Resolved s

    (@sdnazdi)


    Hello,
    I like to create a some table of services in Tablepress such as the link
    of that hotel

    https://www.safirhotel.net/booking

    I will explain a little bit:
    As you may see in the page you choose a room first (multiple available through dropdown). Click “BOOK” button and then go to the next table for supplement options.
    Here from the table you can choose whatever first by marking the “checkbox” in column 4, and then choosing Quantity from dropdown select.
    By marking check box you will see immediately the total sum at the bottom of the table updates.
    This means that the total amount is sum of product of cells in columns 2,4 and 5 respectively.
    Now my question is:
    1- how to add checkbox such that when it is checked it returns 1 otherwise 0?
    2- how to add dropdown select such that the values chosen can be calculated numeric?
    3-how to define the total cell value?
    4- By the way, I also like plus/minus button (to add value) similar to amazon shopping cart instead of dropdown select.

    PS. I wrote some simple code and you may see if they are good or not, if not please help me with the correct ones.
    I choose the single room 22.5 euro, click “BOOk” go to table
    1-for the checkbox

    <input type="checkbox" value="1" class="checkbox" id="001" onclick="addPerService(this)">

    2- for the dropdown select

    <select size="1" ><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select>

    3- For the total

    =22.5+B1*D1*E1+B2*D2*E2+B3*D3*E3+B4*D4*E4+B5*D5*E5+B6*D6*E6+B7*D7*E7+B8*D8*E8+B9*D9*E9+B10*D10*E10+B11*D11*E11

    Unfortunately the in above formula the column D does not have any value and I get the error
    !ERROR! D1 does not contain a number or expression

    Thanks.

    • This topic was modified 2 years, 12 months ago by s.
    • This topic was modified 2 years, 12 months ago by s.
    • This topic was modified 2 years, 12 months ago by s.
    • This topic was modified 2 years, 12 months ago by s.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.
    Also, sorry for the late reply. I was very busy with personal life, so that I could not reply earlier.

    Your general approach is correct: You will need to add HTML code for the checkbox and dropdowns to the table.
    However, you will then need to code your own program logic to handle the calculations. TablePress can not automatically do this for you. Also, using the TablePress math formulas will not work here, as these can’t do calculations based on the user input, but only on data that already is in the table.

    Regards,
    Tobias

    Thread Starter s

    (@sdnazdi)

    Hi,
    Thank you very much for your reply.
    Are you aware of some plugin (preferably free) other than TablePress which can do such dynamic table for me.

    Regards

    • This reply was modified 2 years, 11 months ago by s.
    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no, sorry, I’m not aware of an existing plugin for this. You might have to look for ecommerce or booking plugins, maybe.

    Regards,
    Tobias

    Thread Starter s

    (@sdnazdi)

    Hi,
    Again thank you very much for your kind answers.
    Regards

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sure, no problem! Always happy to help!

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘TablePress: checkbox and deopdown select calculations’ is closed to new replies.