• Resolved ld2002

    (@ld2002)


    Hello community,
    I’m working on selling tickets for an event using Forminator. However, only a limited number of tickets are available for the event. Therefore I have to limit the buyable tickets per account. That’s why tickets can only be booked with a previously created account. The number of cards that an account can book at once already works, but it is then possible to make unlimited purchases with this account. Of course I want to stop that. I would prefer it if the user role was changed after the successful payment, because I use this to control how many tickets an account can book. I suspect that this is only possible via custom code. Unfortunately, I am still very inexperienced with custom code, which is why I would have to ask you to explain to me as precisely as possible where this code has to be integrated so that it works. Unfortunately, you would then have to provide me with this custom code. Unfortunately, the code I’ve found so far hasn’t helped me much due to my inexperience.

    If there is another possibility where the user role does not have to be changed, that would be enough for me.

    Sorry I’m so inexperienced and thank you very much in advance!

    • This topic was modified 4 years, 3 months ago by ld2002.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @ld2002

    I hope you are doing good today.

    Please note custom complex work is out of the scope of support. I pinged our SLS Team to review your query and see can we help in this case. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Thread Starter ld2002

    (@ld2002)

    Hey @wpmudevsupport13,
    Thanks for your help, I was actually able to solve it myself now. I programmed my own plugin that changes the role. I attach my solution here.
    Thanks again!
    <?php
    /**
    * Plugin Name: Change_username
    */
    function my_paypal_function($custom_form, $field, $paypal_entry_data, $submitted_data, $field_data_array){
    $current_user = wp_get_current_user();
    $current_user->set_role(“newrole”);
    }
    add_action(‘forminator_custom_form_after_paypal_charge’, ‘my_paypal_function’, 10, 5);
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Áccept one payment per account’ is closed to new replies.