fixe small pbm with card change

This commit is contained in:
asus
2024-04-09 20:11:58 +02:00
parent db4cd0ad55
commit e77e41073f
2 changed files with 23 additions and 22 deletions

View File

@@ -113,6 +113,9 @@ function get_paypal_price_CIPF($user_id = null) {
if (is_paypal_force_1_cent_CIPF($user_id)) {
$price = "0.01";
}
else if (is_acf_prof_change_card_CIPF($user_id)) {
$price = "5";
}
else {
$price = get_card_price_CIPF($user_id);
}

View File

@@ -57,7 +57,6 @@ function get_field_init_CIPF($acf_field_name, $acf_id) {
Plgntls::debug_infos();
$acf_state = get_field($acf_field_name, $acf_id);
error_log("acf_state: " . json_encode($acf_state));
if ($acf_state !== null) {
return $acf_state;
}
@@ -72,7 +71,6 @@ error_log("acf_state: " . json_encode($acf_state));
update_field($acf_field_name, '', $acf_id);
$acf_object = get_field_object($acf_field_name, $acf_id);
error_log("acf_object: " . json_encode($acf_object));
$default = '';
if (isset($acf_object['default_value'])) {
@@ -571,26 +569,26 @@ function get_card_price_CIPF($user_id = null) {
$acf_id = 'user_'.$user_id;
return get_acf_field_CIPF($acf_card_price_total, $acf_id);
}
//function set_card_price_CIPF($value, $user_id = null) {
// Plgntls::debug_infos();
// $acf_card_price_total = Cipf::ACF_CARD_PRICE_TOTAL;
//
// if (is_null($user_id)) {
// $user_id = get_current_user_id();
// }
// $acf_id = 'user_'.$user_id;
// set_acf_field_CIPF($acf_card_price_total, $value, $acf_id);
//}
//function reset_card_price_CIPF($user_id = null) {
// Plgntls::debug_infos();
// $acf_card_price_total = Cipf::ACF_CARD_PRICE_TOTAL;
//
// if (is_null($user_id)) {
// $user_id = get_current_user_id();
// }
// $acf_id = 'user_'.$user_id;
// set_acf_field_CIPF($acf_card_price_total, 0, $acf_id);
//}
function set_card_price_CIPF($value, $user_id = null) {
Plgntls::debug_infos();
$acf_card_price_total = Cipf::ACF_CARD_PRICE_TOTAL;
if (is_null($user_id)) {
$user_id = get_current_user_id();
}
$acf_id = 'user_'.$user_id;
set_acf_field_CIPF($acf_card_price_total, $value, $acf_id);
}
function reset_card_price_CIPF($user_id = null) {
Plgntls::debug_infos();
$acf_card_price_total = Cipf::ACF_CARD_PRICE_TOTAL;
if (is_null($user_id)) {
$user_id = get_current_user_id();
}
$acf_id = 'user_'.$user_id;
set_acf_field_CIPF($acf_card_price_total, 0, $acf_id);
}