How to add Promo Code Logic to Payment form

  • kranai
    Asked on March 20, 2016 at 12:45 PM

    Hi

    Re Form: Insight Academy Registration Form

    I need to add some logic to my above form such that it is able to handle promo code discounts as well. I have currently in my form logic for early bird.

    Meaning if the customer has a promo code he is entitled to a 10% discount on cost of the workshop provided it is not during the early bird period.

    if workshop cost is $150 and early bird discount is until say 9th March 2016.

    The promo code may have a string like ABCD2016. If they enter this string then form should calculate final payment as 150 x 0.90 = $135 PROVIDED date is greater then 9th March 2016 (early bird cut-off date).

    So customer do not get the 10% discount during the early bird period even if they enter the promo code.

    I need to add some additional conditional statements to get the above working. Can u please let me know where I need to put this in.

     

    Thanska lot for your help

    best rgds

    kish

     

  • Mike_G JotForm Support
    Replied on March 20, 2016 at 1:49 PM

    I have checked your form and base on what I have seen you have passed the value of the field, "Final Total (PayPal)" to the "Final Cost Workshop (payment)" field. In order for you to achieve what you would like to happen, you first need to have an additional text box, where the Promo Code is to be entered by your submitters.

    How to add Promo Code Logic to Payment form Image 1 Screenshot 40

    After that, add a Date field that will hold the date today (current date). The value of this field which is set to be always today(current) is to be compared to the duration of the promo. Also, this field should be set as hidden so it will not show on the form.

    How to add Promo Code Logic to Payment form Image 2 Screenshot 51

    Next thing that you need to do is to create the condition that will check if the promo code is correct and if it is still within the promo period.

    In my example, I have made the promo code, "1234ABCD" and it will only be until March 24, 2016. Meaning if the promo code is entered after that date, even if it is valid, the discount will not be applied. Also, we need to make sure that "ALL" rules should be met for the discount to be applied. Also, since the value of field, Final Total (PayPal), is only derived from Cost of Event field, we will apply the discount to the Cost of Event field before it will be passed to the Final Total (PayPal) field.

    How to add Promo Code Logic to Payment form Image 3 Screenshot 62

    You can check the clone version of your form I have created where I have applied the changes. 

    https://form.jotform.com/60795665566977

    Also, you can play with the Date Today field and set a default date to check if the promo period works.

    Feel free to let us know if you need clarifications with any of the instructions above.

    Thank you.

  • kranai
    Replied on March 20, 2016 at 9:02 PM

    hi

    PLEASE DIRECT this to MIKE_G (to avoid confusion). Don't mind waiting for his answer.

    Hi Mike

    Thanks for your reply and animated response. Much appreciated.

    I understand your steps except the part I need to create a date field which will hold the current date. I have already a hidden date filed called "Today's Date" which I am using to calculate the early bird discount in my current form. 

    My question is can I use this field again instead creating another one as you have suggested?

    In addition, your logic says before March 24th 2016 the promo code is valid...this not what I want ..it should be after early bird cutoff date. So if early bird cutoff date is 24th March 2016 then promo code will be valid. So I just need to change the conditional "Before" to "After" in your solution (am i right?)

    Look forward to your reply.

    Best Rgds

    Kish

     

  • kranai
    Replied on March 21, 2016 at 11:06 AM

    Hi

    Since Mike_G is not available can someone else help with my query.

    Please refer to this form:

    Clone of Insight Academy Registration Form (Promo Code) 798624

    I have made a copy of Mike_G form. However the logic he gave is not quite correct so I have modified it but I don't seem to get it working.

     

    If you look at the first set of conditional statement ..I am checking to see if promo code is 1234ABCD and date is after 10th March and if both conditions are true then i am inserting 0.9 into the discount box. (Basically if anyone provides promo code will get 10% off the cost of the workshop which is $150 and after 10% it should be $135).

    I have also have a early bird discount if customer register before 9th March 2016 I insert 0.72 into the discount box. The logic is also in the one of the conditional statements. (This period is now over based on current date)

    Now if go down the form if the customer selects the mode of payment as Cheque then cheque number box will be displayed and  Final Total (Cheque) should show $135

    If customer selects mode of payment as Payal/Credit Card then Final Total (PayPal) should display $135 and also Final Cost Workshop 135 SGD should be displayed.

    I am not getting the displays correctly...can u please let em know what I am not doing correct?

    rgds

    kish

  • Kiran Support Team Lead
    Replied on March 21, 2016 at 12:03 PM

    I'm checking on the issue. Please allow me some time to check on this and get back to you with relevant information.

    Thank you for your patience. 

  • Kiran Support Team Lead
    Replied on March 21, 2016 at 12:18 PM

    As I check your form, I see that the discount is calculated correctly and displayed in the Cost of Event field after applying the discount code. However, I notice that the calculated value is not displaying the final total until Cheque/PayPal is selected. This is due to the conditions displayed below:

    How to add Promo Code Logic to Payment form Image 1 Screenshot 30

    Since you are using Calculation widget for both Cheque and PayPal Final Total, you may insert the field "Cost of Event" directly into the widget. Then you may disable/remove the above conditions.

    How to add Promo Code Logic to Payment form Image 2 Screenshot 41

    Please make the necessary changes to your form and you can see that the calculated values displayed in Cheque or PayPal.

     

    Hope this information helps! 

  • kranai
    Replied on March 21, 2016 at 1:56 PM

    Hi Kiran

     

    Please refer to this form:

    Clone of Insight Academy Registration Form (Promo Code) 798624

    Thanks for your reply. I did as you said only problem with this is that amount is displayed immediately at the bottom in Final Total (Cheque) and Final Total (PayPal)  EVEN BEFORE customer selects whether he wants to pay by cheque or Paypal as his mode of payment. 

    The above doesn't look neat...it should only display upon mode of selection button  is selected.

    Is there anyway we can tweak this so that display correctly?

    Appreciate your help

     

    best rgds

    Kish

     

  • kranai
    Replied on March 21, 2016 at 2:09 PM

    Hi Kiran

    Looking at this again...the two conditional statements you asked to disable ...isnt that what I want...I am saying if mode of payment is cheque then insert cost of event into Final Total Cheque.

    Similarly if mode of payment is paypal then insert cost of event into Final Total Paypal.

    The problem it is not displaying the numbers correctly in Final Total Cheque and Final Total Paypal.

    Hope we can solve this

    kish

  • Kiran Support Team Lead
    Replied on March 21, 2016 at 2:50 PM

    I understand. Since we are able to select only one payment method, I think it is not required to display the total for both the fields (Cheque and PayPal). With a few changes on the form, following is the output of the form.

    How to add Promo Code Logic to Payment form Image 1 Screenshot 50

    This is what I did to the form in order to achieve this.

    1. Removed the Final Total (PayPal) field completely from the form since the total is already being displayed using Payment field.

    2. Final Total (Cheque) field shall be displayed only when Cheque is selected for Mode of Payment by adding the condition.

    How to add Promo Code Logic to Payment form Image 2 Screenshot 61

    3. The payment tool can get the calculated value from the 'Cost of Event' field directly.

    How to add Promo Code Logic to Payment form Image 3 Screenshot 72

    Here is the demo form : https://form.jotform.com/60805479598977

    If you want to display both the fields, you may revert the changes that were made as mentioned in my earlier post and add two conditions to the form as shown below. 

    How to add Promo Code Logic to Payment form Image 4 Screenshot 83

    Here is the demo form : https://form.jotform.com/60806104732953

    You can clone these forms to your account to see how they work.

    Hope this information helps! 

  • kranai
    Replied on March 22, 2016 at 11:46 AM

    Hi Kiran

     

    Please refer to this form:

    Clone of Insight Academy Registration Form (Promo Code) 798624

    Thanks for your reply. I was trying to go back to my original displays by following your instructions 

    1. I revert the changes you gave on March 21st above

    2. I included the two condition statements you gave yesterday

    It is not display sing correctly...just a question your 2 conditions you gave yesterday are different from two I original had as shown March 21st above ...is this correct?

    Look forward to hearing from you

    best rgds

    kish

  • Kiran Support Team Lead
    Replied on March 22, 2016 at 12:15 PM

    Yes. The earlier conditions were already there in your JotForm which I wanted to disabled as per my response on 21st. Since you wanted to display the total in one of the Final Total fields, I asked to you to enable these conditions by reverting the form and add two more conditions.

    As I check your JotForm now, I notice that the following conditions are deleted which is causing the issue.

    How to add Promo Code Logic to Payment form Image 1 Screenshot 20

    Adding these two conditions to your JotForm should be displaying the value correctly. Hope this information helps! 

  • kranai
    Replied on March 22, 2016 at 1:13 PM

    Hi Kiran

    Thanks for your response. 

    Now it works EXCEPT when I do this...

    After inserting some inputs I decide to RESET the form.

    then after inserting the promo code the totals numbers don't change it remains at $150...

     

    Also do I still need the following two conditional statements in my form? or can i delete them?

    if mode of payment = paypal/credit card

    Insert 0 into final cheque

    And 

    If mode of payment = Cheque

    Insert 0 into final paypal

     

    best rgds

    kish

     

  • Mike_G JotForm Support
    Replied on March 22, 2016 at 1:55 PM

    I have cloned your form and found out what's causing the issue. Please see the image below.

    How to add Promo Code Logic to Payment form Image 1 Screenshot 40

    The "Default Date" is set to "Custom" with a value of "today". Yes, it will work the first time you have loaded your form and it will give you the date today. However, the "Today's Date" will be empty after resetting the form with this value reason for your conditions not being met. (You can test that by unhiding the "Today's Date" field).

    I would suggest, rather using the "Custom" option for the "Default Date" with a value of "today, use the "Current" option instead.

    How to add Promo Code Logic to Payment form Image 2 Screenshot 51
    With regards to the condition you're asking if it should stay in your form, I have checked Kiran's form and I found those condition present and enabled.

    How to add Promo Code Logic to Payment form Image 3 Screenshot 62

  • kranai
    Replied on March 22, 2016 at 3:05 PM

    Hi Mike/Kiran

    Okay it looks fine now...thanks a lot.

    Regarding the two conditional statements I know they are enabled...but we reverted some steps during our  discussion and I want to find out from Kiran whether these two conditions still needs to be there or can  I delete them.

    Look forward to your kind reply

    kish

     

  • Kiran Support Team Lead
    Replied on March 22, 2016 at 3:26 PM

    As I check your JotForm now, it seems to be good now and I believe it is working as per your requirements. No other conditions need to be removed/disabled at the moment on your JotForm.

    If you need any further assistance, please let us know. We will be happy to help.