Paypal Fix – Patch Only – Part 1.

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

    Hello everyone who uses the FundingPress theme.

    You may (or not) be aware that the current FundingPress theme has a glitch
    in that when at the Paypal screen and a funders clicks the browser back button or
    closes the browser all together, the pledge made by the funder gets added to
    the project even though Paypal never approved the funds.
    Here’s a fix I applied to my site and after testing it for quite a bit now seems
    to take care of that problem and allow only actual Paypal approved payments
    to be added to the project.
    To apply the fix you must modify the ‘f-project.php’ file located in the 
    yourdomain.com/wp-content/themes/funding_press/funding/tpl/   directory.
    Look for this set of 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;
                    if(!empty($rewards)){
                    $keys = array_keys($rewards);
                    $lowest_reward = $keys[0];
                    $funding_minimum = get_post_meta($lowest_reward, ‘funding_amount’, true);}else{
                    $lowest_reward = 0;
                    $funding_minimum = get_post_meta($lowest_reward, ‘funding_amount’, true);}
                    $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’ => ‘published’
                       ));
                    foreach($these_funders as $this_funder){
                        $funding_amount = get_post_meta($this_funder->ID, ‘funding_amount’, true);
                        $funders[] = $this_funder;
                        $funded_amount += $funding_amount;
                    }

                }?>

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

Comments are closed.