The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
How to add discount code to checkout total without any script!
Please not this may be a bit to clunky for some people and not give enough options. This does work well if there is only one discount percentage even if you have multiple codes.
So I'll assume that you have managed to get a total price for whatever you are selling and that you have that in a field lets call that [150]
Next thing is to create a single line text box with the title 'discount code' and lets call this field [151]
Next thing is to create a radio checkbox field with the title 'select discount' and lets call this field [152]
In this field put two options the first should be 'no discount' and the second should be '10% discount' or whatever value discount you want. Next you tick the 'use seprate values' and use the value '1' for no discount' and '0.9' for the '10% discount'
Now use conditional logic to make 'select discount' field [152] appear when the correct code has been placed in 'discount code' [151]. So to do this we would have 'show' this field when 'any' of the following match:
'Discount code' is 'equal to' 'apple'
'Discount code' is 'equal to' 'pear'
Now if anyone types in either apple or pear into the discount code this will give them the option to select '10% discount'
Next make sure that the radio button 'no discount' is checked by default to ensure that users who cannot see field [152] will still get a value of 1.
The last step is to create a single line text field called 'checkout total' [153] check read only and also check calculate default value for this field. Then use the calculation [150]*[152]
Thats it, finished. Your form should work with discounts.
Please note that if you wanted a to add tw0 different 'select discount' fields, one for a 10% discount and one for a 15% discount option then be warned as if you type in the code to get the 10% discount and check the box, then go back and type in the 15% discount code then the purchaser will end up being able to get a 23.5% discount.
January 14, 2019 at 1:12 pm
Thank you. This worked, basically, for me. At least better than any other solution I've found. It does exactly as you say - my problem is I have a total I'm calculating that adds in a PayPal fee to each transaction... 3.5%+.30 I need to offer one free ticket. If they purchase two - or more - it messes up that PayPal math. Maybe I can wrap my head around the algebra and get it straight. Regardless - this was a huge help! Thank you so much.
Discussion closed.