Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › Support for anonymous backers in crowdfunding layout
New Landing › How can we help? › Cardinal › Support for anonymous backers in crowdfunding layout
- This topic has 10 replies, 3 voices, and was last updated 10 years by Kyle – SUPPORT.
-
Posted in: Cardinal
-
July 9, 2014 at 9:08 pm #89619
Hey guys,
I’m currently using this theme for my crowdfunding site and user have realised that there isn’t an option for anonymous backers.
To remain anonymous when pledging, at the checkout there is a box which needs to be ticked.
How can I add support for this in Cardinal?
July 9, 2014 at 9:08 pm #89620This reply has been marked as private.July 9, 2014 at 9:09 pm #89621In the crowdfunding plugin there is this, if you look at the end there is the option for anon backers:
/** * Track number of purchases for each pledge amount. * * @since Astoundify Crowdfunding 0.9 * * @param int $payment the ID number of the payment * @param array $payment_data The payment data for the cart * @return void */ function atcf_log_pledge_limit( $payment_id, $new_status, $old_status ) { global $edd_logs; // Make sure that payments are only completed once if ( $old_status != 'pending' ) return; // Make sure the payment completion is only processed when new status is complete if ( in_array( $new_status, array( 'refunded', 'failed', 'revoked' ) ) ) return; if ( edd_is_test_mode() && ! apply_filters( 'edd_log_test_payment_stats', false ) ) return; atcf_update_backer_count( $payment_id, 'increase' ); } add_action( 'edd_update_payment_status', 'atcf_log_pledge_limit', 100, 3 ); function atcf_update_backer_count( $payment_id, $direction ) { $payment_data = edd_get_payment_meta( $payment_id ); $downloads = maybe_unserialize( $payment_data[ 'downloads' ] ); if ( ! is_array( $downloads ) ) return; foreach ( $downloads as $download ) { $variable_pricing = edd_get_variable_prices( $download[ 'id' ] ); foreach ( $variable_pricing as $key => $value ) { $what = $download[ 'options' ][ 'price_id' ]; if ( ! isset ( $variable_pricing[ $what ][ 'bought' ] ) ) $variable_pricing[ $what ][ 'bought' ] = 0; $current = $variable_pricing[ $what ][ 'bought' ]; if ( $key == $what ) { if ( 'increase' == $direction ) { $variable_pricing[ $what ][ 'bought' ] = $current + 1; } else { $variable_pricing[ $what ][ 'bought' ] = $current - 1; } } } update_post_meta( $download[ 'id' ], 'edd_variable_prices', $variable_pricing ); } } function atcf_edd_purchase_form_user_info() { if ( ! atcf_theme_supports( 'anonymous-backers' ) ) return; ?> <p id="edd-anon-wrap"> <label class="edd-label" for="edd-anon"> <input class="edd-input" type="checkbox" name="edd_anon" id="edd-anon" style="vertical-align: middle;" /> <?php _e( 'Remain anonymous? Hide name on donors list?', 'atcf' ); ?> </label> </p> <?php } add_action( 'edd_purchase_form_after_user_info', 'atcf_edd_purchase_form_user_info' ); /** * Save if the user wants to remain anonymous. * * This is up to the theme to actually honor. * * @since Astoundify Crowdfunding 1.2 * * @param arrray $payment_meta Array of payment meta about to be saved * @return array $payment_meta An updated array of payment meta */ function atcf_anon_save_meta( $payment_meta ) { $payment_meta[ 'anonymous' ] = isset ( $_POST[ 'edd_anon' ] ) ? 1 : 0; return $payment_meta; } add_filter( 'edd_payment_meta', 'atcf_anon_save_meta' );
July 10, 2014 at 2:00 am #89676Have added this to the list for an update, hopefully the next update, but might slip to the one after – will do my best!
– Ed
July 10, 2014 at 2:58 am #89681Thanks man, let me know if you need it tested.
July 10, 2014 at 11:13 am #89826No problem
– Kyle
July 12, 2014 at 9:19 pm #90546Just written up this functionality ๐
– Ed
July 13, 2014 at 12:03 am #90557Nice one! ๐ Can’t wait to try it out.
July 13, 2014 at 12:15 am #90560Hoping to release the update next week – the feature list is awesome ๐
– Ed
July 17, 2014 at 11:59 pm #92399Hey Ed,
This wasn’t added to the most recent update did it?
July 18, 2014 at 8:06 am #92451Hi
The big update is going out today and this will be included ๐
– Kyle
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.