• Resolved punkum

    (@punkum)


    We are wanting to run a fundraising campaign and show donors how close to our goal we are.
    We have installed WP Charitable to help us with this.

    At this stage, we have added a shortcode form to the bottom of our ‘regular’ Donate page PLUS the github progress bar shortcode snippet to our functions.php file (thats the first progress bar displayed) & [charitable_progress_bar campaign_id=3667] under the payment block.
    AND we also tried adding the progressbar snippet [charitable_stat display=progress display=total goal=3000] under that.
    Paypal is connected to a sandbox / test mode with a donation of $10 which is showing on the progress bar. But the campaign total is NOT showing on either bar.
    How do we show the total with the Progress Bar?

    (NOTE THE TOP “donate” buttons a LIVE to paypal and do not pertain to this question.)

    The page I need help with: [log in to see the link]

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

    (@wpcharitable)

    Hello @punkum

    1. I see you might be referring to this when you mention github snippet (if not direct me then to the location please):

    https://github.com/Charitable/library/blob/88926857be2984f4df82d4685463135ce458f285/campaigns/add-campaign-progress-bar-shortcode.php

    All this does is output a template, so in theory you could copy this file in the plugin:

    /plugins/charitable/templates/campaign/progress-bar.php

    and paste it into your theme:

    yourtheme/charitable/campaign/progress-bar.php

    If you notice in PHP ‘get_percent_donated_raw’ is being outputted. If you added one or more of the following (and using HTML and CSS) you should be able to output more information including donation amounts:

    <?php

    echo $campaign->get_donated_amount();
    echo $campaign->get_donated_amount_formatted();
    echo $campaign->get_donation_summary();

    ?>

    Please note because the github snippets might be delayed in being updated to be fully compatible with the last version charitable, these snippets on Github are not officially supported. But the above should work.

    2. According to the [charitable_stat] shortcode documentation (https://www.wpcharitable.com/documentation/stats-shortcode/) there isn’t an option to show a campaign’s total. I’ll rely this information to our team – this might be a nice feature to have.

    Please let me know if you have any further questions or if I can help out further. ??

    Thread Starter punkum

    (@punkum)

    Hi & thanks for responding.

    So… the short answer is I CANT display a progress bar with the total campaign goal visible with this plugin and/or the shortcodes & snippets available?

    Just want to be clear I’m understanding you correctly before I go figure out an alternative solution.

    Plugin Author WPCharitable

    (@wpcharitable)

    @punkum

    The methods for showing campaign total aren’t available in the [charitable_stat] shortcode. However you could try to display total information with the [campaign] shortcode:

    https://www.wpcharitable.com/documentation/the-campaigns-shortcode/

    So something like this:

    [campaigns number=1 id=123]

    Would display amount total, donated, and a progress bar in a “card” display (so you won’t get JUST the progress bar but with some CSS you can hide and/or adjust the look). See if this works for you.

    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!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display Progress Bar with campaign values?’ is closed to new replies.