Posted: September 15, 2020 at 7:34 am
Hi there, I’m trying to create a field in the registration form where the user will input a number(e.g 300) and it will be deducted based on the input at the checkout page. May I know how do I go about it? |
|
Hi there, This is not something we have available within core but take a look at the snippet here: That is used to add a surcharge based on the users input and you can do the same with a discount by making the unit_price in that snippet negative. |
|
@Tony, Thanks for pointing me in the right direction. Right now, I have a different surcharge as well labeled payment method, where there is a 3.5% surcharge if they pay by credit card. However, it is not in the right order, I would like to have the credit card surcharge applied last. May I know how do I change the order of the invoice? |
|
September 17, 2020 at 11:10 am Which code are you using to add the surcharge? If I’m understanding th question correctly, you should just be able to set the |
|
Hi Tony, Thanks for your kind reply once again. I think that is correct actually, but whenever I modify it still does not change the order of the items. Please see code in this link here below https://gist.github.com/hzr1990/58afed24a69a76074218e1448c57c6c4 And the screenshot here |
|
Have you applied a higher LIN_order? Right now it looks like its set to 1, try 100, does it apply correctly then? |
|
Hi Tony, Thanks for the kind reply For the item I want to be at the top, I tried applying numbers from ‘0’ to ‘-1000’ whereas for the item i want to apply last, I tried applying numbers from ‘1’ to ‘99999’ |
|
?? Which items? EE automatically orders line items as they are added so if you are changing that for various items you’ll likely start running into weird issues.
The order is only set when the line item is added, so I’m just checking that you are adjusting the code and then simply refreshing the page to confirm? Set LIN_Order to say 100 on your payment method surchage code then clear your session by visiting /registration-cancelled/ Start a new registration and work through to reapply the surcharge, it still doesn’t apply correctly? |
|
This reply has been marked as private. | |
Hi Tony! you may have missed my previous message or escalated it further. Any updates so far? Thanks! |
|
Hi Guys, Any updates? |
|
Hi guys, any updates? Please see the reply again below. Hi Tony, Thanks for the prompt reply. Sorry I was not being detailed in what I applied the numbers from. What I meant was for bc_ee_add_product_surcharge I set the LIN_order to ‘100’ and for bc_ee_apply_transaction_surcharge I set the LIN_order to ‘999’ The two numbers were added into the array under the method add_child_line_item(EE_Line_Item::new_instance( array( I tried your method and data seems to be cleared but it does not seem to work either. My understanding is that the code runs whenever the form is submitted, not on the finalize registration page itself, so whenever i modified the code i went back and restart the registration process all over again. To provide more clarity,https://thebeverageclique.com/events/wset-level-1-test/ Thanks in advance! |
|
The support post ‘Deduct amount based on registration form’ 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.