This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Send total amount calculated on payment form to other form single amount field


  1. vdo-ph
    Member

    Hello,

    We have tried using your suggestion from previous ticket 60680 to send the total calculated price from one form to another form that can use this total amount in the payment cycle, however, we are not having any luck doing it this way...

    Let me explain in better detail for your help to solve this issue.

    ---

    We have a single form that is a combination estimate/invoice form. It is a "payment form", but only uses this for calculation, not actual payment. So, if the user selects "estimate", they will not need to "pay" at this time. However, if the client selects "invoice" they should pay immediately, but need to do this in a separate form (for various reasons).

    Since the form has these options, we do NOT want to do the credit card payment part of the first form (otherwise, it forces payment or will not submit), so we set to "Cash", and want to send this information (via specially created link in the results page of the submitted form) to a second form to have the total calculated amount automatically entered (and not changeable by the customer), so the user can continue payment by credit card. (Even though this may look as it can simply skip the payment page, it's not an option we can find because ONLY actual pages can be skipped via logic, not the payment page itself, likely by design.)

    e.g. Form 1 calculates a total amount, let's say this is $101.23. We can get the actual total amount using {total_amount}, and can use this to create a link like http://domain.com/machform/view.php?id=1234&element_1={total_amount} per your original suggestion. Similarly, we can get the same "Total Amount" from a price field directly, by calling it's element variable, like {element_2}.

    1.) We created a test submit form to simulate this linking, as follows:

    Name (complex field)
    element_1 (element_1_1 / element_1_2)

    Price (complex field)
    element_2 (element_2_1 / element_2_2)

    Completing this form allows us to pull out ONLY the first name or last name using {element_1_1} and {element_1_2}, and produces the separate first and last name to populate the element_1_1 and element_1_2 on the second form. This works great. (We probably wouldn't have this problem at all if the "price" and "total amount" elements worked the same as the name field, with direct access to ONLY the inputted data, or ONLY the dollars / cents separately.).

    Using {total_amount} also provides the full amount in the link, but contains "extra data" such as the $ and USD (total=$102.24 USD) - Also, in the actual link, the "space" in between the amount and USD causes the link to ACTUALLY be $102.24%20USD

    Resulting link: http://domain.com/view.php?id=16530&element_1_1=Glenn&element_1_2=Geller&element_2=$101.23

    But, if we attempt to grab ONLY the inputted data using {element_2_1} (for dollars area, separately) and {element_2_2} (for cents area, separately), this does NOT work, and the output is just the curly brace contents. See the link produced below.

    Resulting link: http://domain.com/view.php?id=16530&element_1_1=Glenn&element_1_2=Geller&element_2_1={element_2_1}&element_2_2={element_2_2}

    Also, since the total amount or single output produced contains the dollar sign (and USD), e.g. element_2=$101.23 (USD), it may not work entirely.

    2.) We created a second form, Form 2, as the "receive" form, and tried to use a Price field first, then later added all other types of fields that can be used for payment like checkboxes and dropdown.

    Name (complex field)
    element_1 (element_1_1 / element_1_2)

    Total Amount (p) (complex field - price field)
    element_2 (element_2_1 / element_2_2)

    Total Amount (cb) (complex field - checkboxes field - only 1 checkbox)
    element_3 (element_3_1)

    Total Amount (dd) (complex field - dropdown field - only 1 dropdown)
    element_4 (element_4_1)

    However, when attempting to send the output data from the {total_amount} to the element_2 form input (price), it fails. We can send this data to element_2_1 or element_2_2, but then the field looks like $ $101.23. or $ . $101.23 but never just $101.23 and this obviously doesn't work properly.

    Same issue with the checkboxes and dropdown field types, they will not accept the {total_amount} or {element_2} data at all.

    So, we need to know how to properly take a total calculated price, and put it into a "recognized price type" field via query string, so we can enable payments on the second form.

    How to do this?

    We thought there could be something like {total_amount_dollars} or {total_amount_d} and {total_amount_cents} or {total_amount_c} but we don't know if this is the correct syntax, and doesn't seem to work at all in our tests.

    We have tested this in versions 4.1 and 4.2, with the same results.

    Please review further and advise.

    Posted 9 years ago #

RSS feed for this topic

Reply