Hi @vorticy,
Thanks for writing us here. We are looking into this and will get back to you soon.
Thanks!
@vorticy
We have filter hooks available for these fields already. We just haven’t gotten it documented yet. That’s always helpful, huh!?
The hook name for COMMENT1 is ae_pppf_custom_parameter, and the hook name for COMMENT2 is ae_pppf_comment2_parameter.
So this should get what you’re wanting done:
add_filter( 'ae_pppf_custom_parameter', 'own_ae_pppf_custom_parameter', 10, 2);
function own_ae_pppf_custom_parameter($customer_note , $order) {
return $order->get_order_number();
}
add_filter( 'ae_pppf_comment2_parameter', 'own_ae_pppf_comment2_parameter', 10, 2);
function own_ae_pppf_comment2_parameter($empty, $order) {
return 'My Website';
}
Just drop that into your (child) theme’s functions.php, or make yourself a little plugin file for it (which is what I prefer to do) and that should do it.
I did go ahead and get these hooks added to our current hook documentation.
It’s still not fully complete, but you can see quite a few hooks there you may not have known about.
Hi and thank you for the quick reply. Comment2 hook worked but Comment1 did not. Not sure if it has to with “ae_pppf_custom_parameter” being tied to Comment1 correctly or if the $order->get_order_number() is not returning anything.
Hi @vorticy,
Sorry for the confusion. I missed this part.
ae_pppf_comment1_parameter
Add data into the COMMENT1 field available in the PayPal Manager (PayFlow) account transaction details.
add_filter( 'ae_pppf_comment1_parameter', 'own_ae_pppf_comment1_parameter', 10, 2);
function own_ae_pppf_comment1_parameter($empty, $order) {
return 'My Website';
}
This code was for the custom parameter and not for comment-1. Please use the code above to forward anydata to comment one.
add_filter( 'ae_pppf_custom_parameter', 'own_ae_pppf_custom_parameter', 10, 2);
function own_ae_pppf_custom_parameter($customer_note , $order) {
return $order->get_order_number();
}
Let me know if you have any other questions or concerns.
Thanks!