Posted: June 25, 2019 at 9:17 pm
Hi EE Team, I was able to customize the bc_ee_apply_transaction_surcharge.php snippet to suit my needs. Each transaction surcharge function group works great individually. But, when I am trying to apply 2 transaction surcharge function groups on the same registration form, one is blocking the other from firing. I have tried :
3) Assigning different filter priorities :
Would you please give me some directions as of how I can run multiple occurrences of the bc_ee_apply_transaction_surcharge.php snippet on a single registration form ? Thanks in advance. Patrick
|
|
Sorry for the presentation, I thought the triple backticks would wrap the code correctly… |
|
Hi, You don’t need to (and probably should not) change the filter priorities and variable names. You also do not change When building out your code for a second surcharge, you’ll change the function names and any custom filter hook names. An example of a custom filter hook from the code example is the |
|
Thanks Josh ! I have cleaned my code as per your instructions. Both surcharges are now working as expected except for one special case : Let say I have a ticket of 20$. For some guests, I am applying a negative surcharge to simulate a discount (guest1 = -10$, guest2 = -15$, guest3 = -20$) based on a dropdown selection menu. The second surcharge is a variable donation (positive integer). If I apply the first surcharge for guest3, which is equivalent to a 100% discount, then the result of the second surcharge is always 0 independently of user donation. In fact, whenever a first surcharge results in a null calculation from the recalculate_total_including_taxes() function, the second surcharge is not applied. Now, when inverting both functions in my custom plug-in, i.e. applying “Donation” surcharge prior to applying “Discount” surcharge, everything works as expected, even the case described earlier. Any clues or recommendations ? Thanks in advance. |
|
You could try changing the LIN_order parameters (passed to |
|
The support post ‘Applying multiple transaction surcharges’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.