Add new payout fields

I manage to create a new field at payout forms using the next code:

add_filter(
	'hivepress/v1/forms/payout_request',
	function( $form ) {
		$form['fields']['banco'] = [
			'label'		=> 'Entidad Bancaria',
			'type'		=> 'text',
			'_order'	=> '10',
		];	
		return $form;
	}
);
add_filter(
	'hivepress/v1/forms/payout_request',
	function( $form ) {
		$form['fields']['banco']['required'] = true;
		return $form;
	},
	1000
);

How can I show this info in the Payout wordpress section?

I recommend using vendor attributes for this purpose, e.g. add custom attributes for the payment method credentials that you allow for payouts in Vendors/Attributes, mark them as Editable and Required. This way vendors will have to fill these fields, and they will not have to fill them every time on requesting a payout. As a site admin, you’ll be able to always check them in the vendor profile in WordPress/Vendors section.

Adding custom fields to the payout form, validating, saving and displaying the field values somewhere would require advanced customizations.

I had already thought about that, but that would make the form to complete the profile very extensive since I am using the social links and bookings plugin that also add fields.

The fields should be required to request a payment but not to post a listing, that would help more people post listings without having to enter their bank information first.

Sorry, there’s no simple code snippet for adding, validating, saving and displaying custom payout fields in the current version, please consider using vendor attributes - users will have to set them once, and they will not be added to the Add Listings form (they will be in the Complete Profile form, and it appears only if some fields are still not set for a vendor).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.