I need you to setup / create a form within caldera forms plugin.
The data needed for calculation comes from givewp and affiliatewp plugins user data plus a user input (a floating number field in the form eg 0,1).
The calculation for the affiliatewp processor [Total] field is:
(givewp total donated + affiliatewp unpaid referrals) * user input
After succesful form submission the total unpaid referrals amount should be increased by [Total]
I don´t know how (or if i have to) setup "magic tags" or "variables" or use "html input" within caldera forms and how to construct the calculation fields. So this is entirely up to you. In the end it just need to work.
I could imagine that for an experienced wp coder this is easy as pie.
#### Resources: ####
## Retrieve total donated amount ##
$user = wp_get_current_user();
$donor = new Give_Donor( $user->ID, true );
$donor_total_donation_amount = $donor->id ? give_format_amount( $donor->purchase_value, array( 'currency' => give_get_option('currency') ) ) : 0;
## retrieve unpaid referrals ##
function affwp_get_affiliate_unpaid_earnings( $affiliate, $formatted = false ) {
if ( ! $affiliate = affwp_get_affiliate( $affiliate ) ) {
return false;
}
$earnings = $affiliate->unpaid_earnings;
if ( $formatted ) {
$earnings = affwp_currency_filter( affwp_format_amount( $earnings ) );
}
return $earnings;
}
## increase unpaid referral amount ##
function affwp_increase_affiliate_unpaid_earnings( $affiliate, $amount, $replace = false ) {
if ( ! $affiliate = affwp_get_affiliate( $affiliate ) ) {
return false;
}
if ( empty( $amount ) || floatval( $amount ) <= 0 ) {
return false;
}
if ( false === $replace ) {
$unpaid_earnings = affwp_get_affiliate_unpaid_earnings( $affiliate );
} else {
$unpaid_earnings = 0;
}
$unpaid_earnings += $amount;
$unpaid_earnings = round( $unpaid_earnings, affwp_get_decimal_count() );
if ( affiliate_wp()->affiliates->update( $affiliate->ID, array( 'unpaid_earnings' => $unpaid_earnings ), '', 'affiliate' ) ) {
return $unpaid_earnings;
} else {
return false;
}
}
## links ## really don´t know if helpful, but seems could be ##
[login to view URL]
[login to view URL]
[login to view URL]
[login to view URL]
Hello,
Hope you are doing well.
I have read your job details and understood it. So basically i have done this not exact thing but almost same with gravity forms with custom inputs and custom form notifications. I will start on this job right away and can finish it by next few hours.
Thanks
$40 USD σε 1 ημέρα
4,9 (29 αξιολογήσεις)
4,7
4,7
4 freelancers δίνουν μια μέση προσφορά $33 USD για αυτή τη δουλειά
Hello,
I have reviewed the job post and I am interested to complete your requirements. I have great working experience with Wordpress, plugin development and customization, programming for a multitude of different projects. Implemented code based on project specifications,Tested and documented code.
Please contact me if you would like to schedule an interview or have any questions about my skills or experience.
Thanks
Seemant