• Resolved walfridooliveira

    (@walfridooliveira)


    How correct way to add a custom chebox using the hoock give_fields_donation_form_after_personal_info? I using function give_field, but a getting a fatal error. I using the code below:

    add_action( 'give_fields_donation_form_after_personal_info', function( $group ) {

    ? ? $group->append(

    ? ? ? ? give_field( 'text', 'giv-doc' )

    ? ? ? ? ? ? ->showInReceipt()

    ? ? ? ? ? ? ->minLength(2)

    ? ? ? ? ? ? ->label( __( 'Documento' ))

    ? ? ? ? ? ? ->maxLength(30)

    ? ? ? ? ? ? ->placeholder('CPF/CNPJ/Passaporte')

    ? ? ? ? ? ? ->storeAsDonorMeta()

    ? ? ? ? ? ? ->required()

    ? ? ? ? ? ? ->helpText( __( 'Documento de identifica??o CPF/CNPJ/Passaporte' ) )

    ? ? );

    ? ? $group->append(

    ? ? ? ? give_field( 'checkbox', 'email_authorization' )

    ? ? ? ? ->label( __( 'eu autorizo receber comunica??es sobre minhas doa??es' ))

    ? ? );

    });

Viewing 1 replies (of 1 total)
  • Plugin Support Matheus Martins

    (@matheusfd)

    Hi, @walfridooliveira.

    I’m glad you reached out. I can certainly help you.

    Thanks for reporting this, looks like we have a backwards compatibility conflict.

    We’ll work on getting a fix for this, but in the meantime you can resolve the issue by replacing your code with this:

    add_action( 'give_fields_donation_form_after_personal_info', function ( $group ) {
    $group->append(
    \Give\Framework\FieldsAPI\LegacyNodes\CheckboxGroup::make( 'make_CO2_certificate' )
    ->showInReceipt()
    ->label( __( 'Generate CO2 certificate'))
    );
    });

    Feel free to reach out to us if you have any further inquiries or require additional assistance. We’re always happy to help!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.