Forum Replies Created

Viewing 1 replies (of 1 total)
  • mjacksonpop

    (@mjacksonpop)

    I have the same issue after install update…
    Looking the code i see that in inlcudes/class-campaign.php the function backers_per_price() no longer exists…
    so i check on old versions and copy the function in line 200 aprox…
    after

    public function updates() {
    		return $this->__get( 'campaign_updates' );
    	}
    /**
    	 * Campaign Backers Per Price
    	 *
    	 * Get all of the backers, then figure out what they purchased. Increment
    	 * a counter for each price point, so they can be displayed elsewhere.
    	 * Not 100% because keys can change in EDD, but it's the best way I think.
    	 *
    	 * @since Astoundify Crowdfunding 0.1-alpha
    	 *
    	 * @return array $totals The number of backers for each price point
    	 */
    	public function backers_per_price() {
    		$backers = $this->backers();
    		$prices  = edd_get_variable_prices( $this->ID );
    		$totals  = array();
    
    		if ( ! is_array( $backers ) )
    			$backers = array();
    
    		foreach ( $prices as $price ) {
    			$totals[$price[ 'amount' ]] = 0;
    		}
    
    		foreach ( $backers as $log ) {
    			$payment_id = get_post_meta( $log->ID, '_edd_log_payment_id', true );
    
    			$payment    = get_post( $payment_id );
    
    			if ( empty( $payment ) )
    				continue;
    
    			$cart_items = edd_get_payment_meta_cart_details( $payment_id );
    
    			foreach ( $cart_items as $item ) {
    				if ( isset ( $item[ 'item_number' ][ 'options' ][ 'atcf_extra_price' ] ) ) {
    					$price_id = $item[ 'price' ] - $item[ 'item_number' ][ 'options' ][ 'atcf_extra_price' ];
    				} else
    					$price_id = $item[ 'price' ];
    
    				$totals[$price_id] = isset ( $totals[$price_id] ) ? $totals[$price_id] + 1 : 1;
    			}
    		}
    
    		return $totals;
    	}

    hope it helps! i have long days trying to find the fix!

    bye

    Martin

Viewing 1 replies (of 1 total)