Closed benosho closed 4 years ago
Thanks for this, which payment gateway are you currently using?
I know sometimes that some gateways need to store the data when redirecting users to their payment page and redirecting back.
Your code seems correct here.
Many thanks for your feedback. I am using the payment gateway for Paystack (paystack.com). They have a plugin for this (https://github.com/PaystackHQ/Wordpress-Paid-Membership-Pro-Paystack/blob/master/class.pmprogateway_paystack.php). This is probably where to look for a solution.
@andrewlimaza I have the same issue at the moment.
@ngwebspinner Please, did you find a solution? Please share if you did.
Thanks
If you are using a custom payment gateway, the gateway needs to support the Register Helper Add On (in some cases).
Please feel free to open a new issue to support these payment gateways in the Register Helper.
Since we have not heard back from you about this issue, we are going to close this ticket. If this is still an issue that you are experiencing on your site, please create a new GitHub Issue in this repository or open a ticket in the PMPro Support Forum.
My code is shown below. The additional/extra/custom fields appear on the checkout page. Page is processed successfully through payment gateway (Paystack). New member is added but extra fields are empty. Email to admin show labels of extra fields but no values.
function my_pmprorh_init() {
// don't break if Register Helper is not loaded
if (!function_exists('pmprorh_add_registration_field')) { return false; }
// define the fields
$fields = array(); $fields[] = new PMProRH_Field('organisation_name', // input name, will also be used as meta key 'text', // type of field array( 'label' => 'Name of Organisation (required)', // custom field label 'size' => 40, // input size 'class' => 'org-name', // custom class 'profile' => true, // show in user profile 'required' => true, // make this field required )); $fields[] = new PMProRH_Field('organisation_type', // input name, will also be used as meta key 'text', // type of field array( 'label' => 'Type of Organisation (required)', // custom field label 'size' => 40, // input size 'class' => 'org-type', // custom class 'profile' => true, // show in user profile 'required' => true, // make this field required )); $fields[] = new PMProRH_Field('organisation_web', // input name, will also be used as meta key 'text', // type of field array( 'label' => 'Website', // custom field label 'size' => 40, // input size 'class' => 'org-website', // custom class 'profile' => true, // show in user profile )); $fields[] = new PMProRH_Field('designation', // input name, will also be used as meta key 'text', // type of field array( 'label' => 'Designation (required)', // custom field label 'size' => 40, // input size 'class' => 'designation', // custom class 'profile' => true, // show in user profile 'required' => true, // make this field required )); $fields[] = new PMProRH_Field('establishment_date', // input name, will also be used as meta key 'text', // type of field array( 'label' => 'Date of Establishment -- if a start-up, please indicate', // custom field label 'size' => 40, // input size 'class' => 'estab-date', // custom class 'profile' => true, // show in user profile 'required' => false, // make this field required )); $fields[] = new PMProRH_Field('organisation_profile', // input name, will also be used as meta key 'textarea', // type of field array( 'label' => 'Organisational Profile -- provide a short profile of your organisation (required)', // custom field label 'rows' => 10, // number of rows 'cols' => 80, // number of columns 'class' => 'org-profile', // custom class 'profile' => true, // show in user profile 'required' => true, // make this field required )); $fields[] = new PMProRH_Field('referral', // input name, will also be used as meta key 'text', // type of field array( 'label' => 'Referral Code', // custom field label 'profile' => 'only_admin'
// only show in profile for admins
));
// add the fields into a new checkout_boxes are of the checkout page
foreach($fields as $field) pmprorh_add_registration_field('checkout_boxes', // location on checkout page $field
// PMProRH_Field object
);
// that's it. see the PMPro Register Helper readme for more information and examples.
}
add_action('init', 'my_pmprorh_init');