Payment description
-
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.
-
This is currently not possible with EME. You can make a feature request at https://www.e-dynamics.be/wordpress
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_filterThe filter has 3 arguments: the current description, the payment variable and the gateway name. The doc will contain sufficient examples to work with this.
Can you explain me more about usage of eme_rsvp_paymentform_description_filter and
eme_member_paymentform_description_filterDocumentation has been added:
https://www.e-dynamics.be/wordpress/category/documentation/12-hooks-and-filters/I am not familiar with filters. What can I use here:
$description = …. // change thisCan you help me with an example?
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).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');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.
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);So if I add that line of code the payment description will be $description ?
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 7 years, 5 months ago by
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);The spaces are unrelated. But I’ll test again this weekend.
Is my code as mentioned above correct? Is it technically valid? (I did read some information about filters)
-
This reply was modified 7 years, 5 months ago by
pvwij.
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 …
-
This reply was modified 7 years, 5 months ago by
The topic ‘Payment description’ is closed to new replies.