• Resolved pvwij

    (@pvwij)


    Is it possible to change the Mollie payment description. Now this is:Reservering voor ‘EVENT DESCRIPTION’.

    I need the name of the booker in the payment description.

Viewing 15 replies - 1 through 15 (of 29 total)
  • Plugin Author Franky

    (@liedekef)

    This is currently not possible with EME. You can make a feature request at https://www.e-dynamics.be/wordpress

    Plugin Author Franky

    (@liedekef)

    Btw, the next version will have a filter where you can change the payment description:
    eme_rsvp_paymentform_description_filter
    and
    eme_member_paymentform_description_filter

    The filter has 3 arguments: the current description, the payment variable and the gateway name. The doc will contain sufficient examples to work with this.

    Thread Starter pvwij

    (@pvwij)

    Can you explain me more about usage of eme_rsvp_paymentform_description_filter and
    eme_member_paymentform_description_filter

    Plugin Author Franky

    (@liedekef)

    Thread Starter pvwij

    (@pvwij)

    I am not familiar with filters. What can I use here:
    $description = …. // change this

    Can you help me with an example?

    Plugin Author Franky

    (@liedekef)

    The mentioned page has links to wordpress documentation on filters, that is beyond EME support itself.
    Also, I guess you’ll need to read up or get someone to help you with your php code too (start with “printr($person);” for example).

    Thread Starter pvwij

    (@pvwij)

    I have added the filter as below but the payment description is not changing, what am I doing wrong?

    function my_eme_rsv_payment_descr($description,$payment,$gateway_name) {
        // $gateway_name is e.g. 'mollie', so you can change the description based on the gateway used if desired
        $booking_ids = eme_get_payment_booking_ids($payment['id']);
        $booking = eme_get_booking($booking_ids[0]);
        $event = eme_get_event($booking['event_id']);
        $person = eme_get_person($booking['person_id']);
    	$lastname = $person->lastname;
    	$firstname = $person->firstname;
    	$evenement = $event->event_name;
        $description = "Betaling van $firstname $lastname voor $evenement";
        return $description;
    }
    add_filter('eme_rsvp_paymentform_description_filter','my_eme_rsvp_payment_descr');
    Thread Starter pvwij

    (@pvwij)

    I found a missing character in the first line of code.

    Missing p in rsvp:
    function my_eme_rsv_payment_descr($description,$payment,$gateway_name) {

    Changed it but nothing happens.

    Plugin Author Franky

    (@liedekef)

    The filter has more than 1 parameter, so you need to define that in the add_filter definition. That is explained in the doc too, but I didn’t update that in the mentioned example. I updated the doc for this too.
    So, try this:
    add_filter(’eme_rsvp_paymentform_description_filter’,’my_eme_rsvp_payment_descr’,10,3);

    Thread Starter pvwij

    (@pvwij)

    So if I add that line of code the payment description will be $description ?

    Thread Starter pvwij

    (@pvwij)

    This is my code but the payment description is still the deafult:

    function my_eme_rsvp_payment_descr($description,$payment,$gateway_name) {
        // $gateway_name is e.g. 'mollie', so you can change the description based on the gateway used if desired
        $booking_ids = eme_get_payment_booking_ids($payment['id']);
        $booking = eme_get_booking($booking_ids[0]);
        $event = eme_get_event($booking['event_id']);
        $person = eme_get_person($booking['person_id']);
        $lastname = $person->lastname;
        $firstname = $person->firstname;
        $evenement = $event->event_name;
        $description = "Betaling van $firstname $lastname voor $evenement";
        return $description;
    }
    add_filter('eme_rsvp_paymentform_description_filter','my_eme_rsvp_payment_descr',10,3);
    • This reply was modified 6 years, 2 months ago by pvwij.
    Thread Starter pvwij

    (@pvwij)

    Is it possible that the following in the code of eme_payments.php is wrong:

    if (has_filter($filtername))
    $name=apply_filters($filtername,$name,$payment,$gateway);

    Missing spaces:
    $name = apply_filters($filtername,$name,$payment,$gateway);

    • This reply was modified 6 years, 2 months ago by pvwij.
    • This reply was modified 6 years, 2 months ago by pvwij.
    • This reply was modified 6 years, 2 months ago by pvwij.
    Plugin Author Franky

    (@liedekef)

    The spaces are unrelated. But I’ll test again this weekend.

    Thread Starter pvwij

    (@pvwij)

    Is my code as mentioned above correct? Is it technically valid? (I did read some information about filters)

    • This reply was modified 6 years, 2 months ago by pvwij.
    Plugin Author Franky

    (@liedekef)

    Seems to be, if in doubt:
    use print_r() on a variable (followed by a “die;”, so the code doesn’t continue and you can read the info on screen).
    Also, check your webserver logfiles for php errors/warnings.
    And: which gateway are you using (maybe there’s a bug just for a specific gateway)?

    Like I said: I’ll test later on …

Viewing 15 replies - 1 through 15 (of 29 total)
  • The topic ‘Payment description’ is closed to new replies.