• Resolved haroonahmad

    (@haroonahmad)


    Hello, we manage our donations on networkforgood platform and want to use your plugin for the layouts that will be linked to the external link can we link donate button to the networkforgood campaigns ?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author WPCharitable

    (@wpcharitable)

    @haroonahmad Thanks for reaching out.

    In theory, you can change the donation button on Charitable’s campaign pages. Depending on Charitable’s settings, the button can launch a modal window or submit a form on a campaign page that brings the user to Charitable’s donation page. A template and some custom coding can change the behavior and you can add a button to link externally. Here’s the template in the Charitable plugin (which you would copy in your child theme, instructions in the comments of the file):

    /charitable/templates/campaign/donate-button.php

    Of course with this method Charitable wouldn’t be auto managing your donations or much else outside of the campaign landing page.

    Hope this helps!

    Plugin Author WPCharitable

    (@wpcharitable)

    I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

    Thread Starter haroonahmad

    (@haroonahmad)

    Followed your instructions and created a child theme and added the same folder structure inside the child theme and customized the donate-button.php button, below is the code

    <?php
    
    /**
    
    ?* Displays the donate button to be displayed on campaign pages.
    
    ?*
    
    
    ?*
    
    ?* @author ?WP Charitable LLC
    
    ?* @package Charitable/Templates/Campaign Page
    
    ?* @since ? 1.3.0
    
    ?* @version 1.7.0.9
    
    ?*/
    
    $campaign = $view_args['campaign'];
    
    $button_style = array_key_exists('button_colour', $view_args) ? 'style="background-color:' . $view_args['button_colour'] . ';"' : '';
    
    $button_text = array_key_exists('button_text', $view_args) ? $view_args['button_text'] : __( 'Donate', 'charitable' );
    
    $show_amount_field = array_key_exists('show_amount_field', $view_args) && $view_args['show_amount_field'];
    
    $button_text = esc_html(get_post_meta($campaign->ID, '_campaign_donate_button_text', true));
    
    $button_text = false === $button_text || '' === trim($button_text) ? __( 'Donate', 'charitable' ) : $button_text;
    
    $external_link = 'https://ssej.networkforgood.com/projects/108337-main-giving-page'; // Your external link URL
    
    ?>
    
    <a href="<?php echo esc_url($external_link); ?>" target="_blank" class="<?php echo esc_attr( charitable_get_button_class( 'donate' ) ); ?>"><?php echo wp_strip_all_tags( $button_text ); ?></a>

    it still didn’t worked for me still redirecting the donate button to the internal plugin page.

    • This reply was modified 1 year, 2 months ago by haroonahmad.
    Plugin Author WPCharitable

    (@wpcharitable)

    @haroonahmad When you say it doesn’t work, have you confirmed (after clearing any cache and confirming you placed the file in the correct place in your child/current theme) that your template is actually being used (do you see the link in the source code)? If not, then walk through where you are seeing the donation button on your site with urls to make sure we are talking about the same button/location. Thanks.

    Thread Starter haroonahmad

    (@haroonahmad)

    thank you i managed to remove that button and got an alternate solution for it, meanwhile when i am editing the campaigns and added extended description to the campaign i have added a text there and on live mode i see the lorem ipsum text underneath? where is this text coming from ?

    • This reply was modified 1 year, 2 months ago by haroonahmad.
    Plugin Author WPCharitable

    (@wpcharitable)

    @haroonahmad At first glance, I would check with Elementor documentation or support since that text is appearing within Elementor code when we do a view source of that over there. I hope this helps!

    Thread Starter haroonahmad

    (@haroonahmad)

    i don’t see any elementor or edit with elementor option there, i didn’t added this content anywhere just edited the campaign and edited my own content , this lorem ipsum text showing underneath .

    Thread Starter haroonahmad

    (@haroonahmad)

    issue is fixed.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Donate button linked to external link’ is closed to new replies.