Hi Guys,
I’m looking to populate my customers ccaps field with data they’ve chosen from a dropdown. There are three values they can choose. I’ve got as far as adding this custom function to my child themes functions.php file.
My custom field is called ‘fund’- I feel like I’m pretty close, but I can’t seem to get this working…Can anyone shed any light?
add_filter ("ws_plugin__s2member_pro_paypal_sp_checkout_post_attr", "my_paypal_pro_sp_checkout_form_attr");
function my_paypal_pro_sp_checkout_form_attr ($attr = array ())
{
if ($_POST["fund"] === "american")
{
$attr["ccaps"] = "american";
}
elseif ($_POST["fund"] === "chinese")
{
$attr["ccaps"] = "chinese";
}
elseif ($_POST["fund"] === "both")
{
$attr["ccaps"] = "spanish,chinese";
}
/**/
return (array)$attr;
}