• Resolved comptedev

    (@comptedev)


    hi,
    I added the following code in the function.php file of my theme

    `add_action( ‘give_fields_after_donation_levels’, function( $collection ) {
    $collection->append(
    // Select field with options.
    give_field( ‘select’, ‘myConference’ )
    ->options(
    [ ‘east’, __( ‘Eastern Conference’ ) ],
    [ ‘west’, __( ‘Western Conference’ ) ],
    [ ‘north’, __( ‘Northern Conference’ ) ],
    )
    ->label( __(‘conference’)
    );
    });

    there is a circle that turns, the form does not load.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rick Alday

    (@mrdaro)

    Hi @comptedev,

    Glad you reached out. I just noticed there’s a syntax error in our sample code that you copied too.

    The label line is missing a closing parenthesis.
    It should read like this:
    ->label( __(‘conference’))

    That should fix things.

    Thread Starter comptedev

    (@comptedev)

    hi,
    thank you for your reply,I just tested the code works now but randomly.

    sometimes the form loads and 10 minutes more the form no longer loads.

    when a person chooses an option this one does not appear, neither in the administration, nor in the mail

    cordialy

    Plugin Support Matheus Martins

    (@matheusfd)

    Hi, @comptedev.

    When something works for some time and then it doesn’t work, or when it works randomly, it’s usually related to cache.

    If you’re not familiar with caching, it’s a method of saving server resources by storing copies of a page or site, so that the next visitor’s visit doesn’t trigger a call to the server at all, they just get the copy that was saved.

    We put together this deep dive into what caching is and how it can cause problems: https://givewp.com/documentation/resources/caching/

    Caching works really well for speeding up sites, but when a saved copy of the site has sensitive information in it (like donor info) it’s important that GiveWP not share that with the next visitor.

    If GiveWP is not convinced that the browser requesting the data is the correct one, it defaults to not showing the data.

    In order to verify that my hypothesis is right here, we need to exclude any asset loaded by GiveWP from the cache.

    Caching is handled differently on various sites and web hosts, and most of them allow for excluding specific URLs or parts of URLs from caching. At the very least, you should exclude the following slugs from caching:
    /donations/
    /donation-confirmation/
    /donor-dashboard/

    Also, the following query strings:
    give-embed=donor-dashboard
    giveDonationFormInIframe=1

    Your host or the caching plugin/solution you are using can help with that. Some of them may require what’s called a “wildcard” like /donations/* to capture all subdirectories under the /donations/ folder.

    You can also temporarily disable caching on the site to confirm that the uncached site isn’t showing the problem.

    While fine-tuning cache falls outside the scope of the support we’re able to provide, your success with online donations is our number one priority, and we’re happy to provide any tips.

    If it still doesn’t fix the issue, we need a place where we can reliably replicate the issue.

    ?Please let us know if you have further questions or need additional assistance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘adding a button, the form does not load’ is closed to new replies.