I really want to use this plugin instead of woocommerce gateway.
this is a simple code plugin, can you look at it? for now, my problem is it is not working with if booking a recurring appointment, even the balance is insufficient, the customer still can booking a recurring appointment as long as the balance is enough for 1 appointment. for example: if a employee for a service the price is $2, and the customer mycred balance is 2, if this customer book a recurring appointment, no matter recurring for how many days, it is not showing the warning of insufficient balance, but it still can book it directly.
I guess the problem maybe because of this $amount is the unit price? it didn't include the price of recurring appointments?
Thanks for reaching out to us. Apologies, but I'm not sure if i understand your request correctly. I see that you are mentioning "my creds"? This is not a feature in Amelia, and we do not have any options for "credits" when it comes to Amelia. Certainly, you can use WooCoomerce with Amelia, as a payment method, and you can also use recurring appointment options within Amelia. Can you please provide more details regarding your issue??
May I ask what is the $amout in amelia_before_payment hook passed? is it passing a single amount for an appointment? what can I do for recurring appointment?
For example:
for single booking if the price is $2, the $amount will be $2. right?
if recurring 2 times, so totally 3 appointments, the $amout I think it will be still $2, it is not calculated the recurring times. how can I calculate for all 3 appointments in the code I provided
Apologies for the delayed answer. Developers are still working on this use case and I'll make sure that i forward the information as soon as i have it.
Thank you again for your patience and understanding.
This hook should be fired for every recurring appointment, therefore you will need a global variable to keep track of the total amount and compare that to the amount of credit.
I really want to use this plugin instead of woocommerce gateway.
this is a simple code plugin, can you look at it? for now, my problem is it is not working with if booking a recurring appointment, even the balance is insufficient, the customer still can booking a recurring appointment as long as the balance is enough for 1 appointment. for example: if a employee for a service the price is $2, and the customer mycred balance is 2, if this customer book a recurring appointment, no matter recurring for how many days, it is not showing the warning of insufficient balance, but it still can book it directly.
I guess the problem maybe because of this $amount is the unit price? it didn't include the price of recurring appointments?
add_filter( 'amelia_before_payment', 'mycred_amelia_before_payment_func', 10, 2 );
function mycred_amelia_before_payment_func( $paymentData, $amount ) {
$mycred = mycred();
$user_balance = $mycred->get_users_balance( get_current_user_id() );
if ( $paymentData['gateway'] == 'onSite' && floatval( $user_balance ) >= $amount ) {
$paymentData['amount'] = $amount;
$paymentData['status'] = 'paid';
mycred_add(
'amelia_booking_payment',
get_current_user_id(),
( -1 * $amount ),
'Payment for booking.',
$paymentData['customerBookingId'],
''
);
}
return $paymentData;
}
can you fix this for me? thank you very much!!!
Attached files: mycred-amelia.zip
Hello Li,
Thanks for reaching out to us. Apologies, but I'm not sure if i understand your request correctly. I see that you are mentioning "my creds"? This is not a feature in Amelia, and we do not have any options for "credits" when it comes to Amelia. Certainly, you can use WooCoomerce with Amelia, as a payment method, and you can also use recurring appointment options within Amelia. Can you please provide more details regarding your issue??
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Stefan,
Thanks for your reply, let me ask in another way.
May I ask what is the $amout in amelia_before_payment hook passed? is it passing a single amount for an appointment? what can I do for recurring appointment?
For example:
for single booking if the price is $2, the $amount will be $2. right?
if recurring 2 times, so totally 3 appointments, the $amout I think it will be still $2, it is not calculated the recurring times. how can I calculate for all 3 appointments in the code I provided
Hello Li,
Let me double-check with the developers for a precise answer. I will let you know as soon as i have feedback.
Thank you for your patience and understanding.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Ok, thank you very much!!!
Hello Li,
Apologies for the delayed answer. Developers are still working on this use case and I'll make sure that i forward the information as soon as i have it.
Thank you again for your patience and understanding.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello Li,
Apologies again for the delayed answer.
This hook should be fired for every recurring appointment, therefore you will need a global variable to keep track of the total amount and compare that to the amount of credit.
I hope it helps.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables