Paypal Fix – Patch Part II.

  • In Progress
    Posted in: Fundingpress  
  • Member
    lukesteegen
    March 16, 2014 at 1:28 pm #30996

    Hi;

    Seems I am not allowed to put all of the instructions in one
    discussion.  So here is the second part to fixing the Paypal bug.
    After you’ve completed step one, complete the step below.
    (that fix has to go in the f-project.php file of course).
    Replace the code you removed with this code:

                <?php
                    global $post;
                    global $f_currency_signs;
                    $project_settings = (array) get_post_meta($post->ID, ‘settings’, true);
                    $project_expired = strtotime($project_settings) < time();
                    $project_currency_sign = $f_currency_signs[$project_settings];
                    $target= $project_settings;
                    $rewards = get_children(array(
                    ‘post_parent’ => $post->ID,
                    ‘post_type’ => ‘reward’,
                    ‘order’ => ‘ASC’,
                    ‘orderby’ => ‘meta_value_num’,
                    ‘meta_key’ => ‘funding_amount’,
                ));
                $funders = array();
                $funded_amount = 0;
                $chosen_reward = null;
                foreach($rewards as $this_reward){
                    $these_funders = get_children(array(
                        ‘post_parent’ => $this_reward->ID,
                        ‘post_type’ => ‘funder’,
                        ‘post_status’ => ‘publish’
                    ));
                    foreach($these_funders as $this_funder){
                        $funding_amount = get_post_meta($this_funder->ID, ‘funding_amount’, true);
                        $funders[] = $this_funder;
                        $funded_amount += $funding_amount;
                    }
                }?>
                <?php if($funded_amount == $target or $funded_amount > $target){ ?>
                    <div class=”project-successful”>
                        <strong><?php _e(‘Successfully Funded!’, ‘funding’); ?></strong>
                    </div>
                <?php }elseif($project_expired){ ?>
                            <div class=”project-unsuccessful”>
                                <strong><?php _e(‘Unsuccessful!’, ‘funding’); ?></strong>
                            </div>
                <?php } ?>
    Save the file and you’re done and your Paypal glitch should be fixed.
    PS – make a backup of the f-project.php file first BEFORE you make
    any changes.  Should you mess up,  you can always go back to the old
    setup.
    PSS.  This patch does work for my site beautifully.  I am making no
    guarantee however it will work for your site as well because I don’t know
    what changes, if any, you may have made to the FundingPress theme.
    Best of Luck everyone.
    Lode

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.