From f6e092f67dcdfe11d9def3c86211bd7a4d01225b Mon Sep 17 00:00:00 2001 From: asus Date: Tue, 12 Mar 2024 21:53:32 +0100 Subject: [PATCH] - moved reset field function outside renew_card file - created a patch for formbuilder calculation pbm --- plugins/cipf_plugin/fipfcard_plugin.php | 7 +++- plugins/cipf_plugin/php/renew_card.php | 32 ---------------- plugins/cipf_plugin/php/reset_card_form.php | 41 +++++++++++++++++++++ plugins/cipf_plugin/utils/plgntls_class.php | 2 +- 4 files changed, 47 insertions(+), 35 deletions(-) create mode 100644 plugins/cipf_plugin/php/reset_card_form.php diff --git a/plugins/cipf_plugin/fipfcard_plugin.php b/plugins/cipf_plugin/fipfcard_plugin.php index 4dbe7b5..8f7ba3c 100644 --- a/plugins/cipf_plugin/fipfcard_plugin.php +++ b/plugins/cipf_plugin/fipfcard_plugin.php @@ -45,12 +45,15 @@ include_once(PLGNTLS_class::root_path() . 'php/author_restriction.php'); include_once(PLGNTLS_class::root_path() . 'php/filter_mail.php'); include_once(PLGNTLS_class::root_path() . 'php/prof_check_page.php'); include_once(PLGNTLS_class::root_path() . 'php/renew_card.php'); +//include_once(PLGNTLS_class::root_path() . 'php/reset_card_form.php'); include_once(PLGNTLS_class::root_path() . 'php/partner_check_page.php'); // form builder patch : -//include_once(PLGNTLS_class::root_path() . 'php/form_builder_patch/url_validation.php'); -//include_once(PLGNTLS_class::root_path() . 'php/form_builder_patch/multiple_modals.php'); +/* +include_once(PLGNTLS_class::root_path() . 'php/form_builder_patch/url_validation.php'); +include_once(PLGNTLS_class::root_path() . 'php/form_builder_patch/multiple_modals.php'); +*/ include_once(PLGNTLS_class::root_path() . 'php/form_builder_patch/form_calculation.php'); diff --git a/plugins/cipf_plugin/php/renew_card.php b/plugins/cipf_plugin/php/renew_card.php index e9a891d..96dbb15 100644 --- a/plugins/cipf_plugin/php/renew_card.php +++ b/plugins/cipf_plugin/php/renew_card.php @@ -10,32 +10,6 @@ if (!defined('ABSPATH')) { -/* -* reset some fields for the form to buy the card -* - cgv -* - paiement -* - livraison -* - tarif -* this action is called if no redirection happens -* -*/ -function reset_some_fields_CIPF() { - PLGNTLS_class::debug_infos(); - $acf_cgv = PLGNTLS_class::ACF_PROF_CGV; - $acf_payement = PLGNTLS_class::ACF_CARD_PAYMENT_METHOD; - $acf_delivery = PLGNTLS_class::ACF_CARD_PRICE_DELIVERY; - $acf_price = PLGNTLS_class::ACF_CARD_PRICE_CHOICE; - - $user_id = get_current_user_id(); - update_field($acf_cgv['_name'] , array(""), 'user_'.$user_id); - update_field($acf_payement['_name'], array(""), 'user_'.$user_id); - update_field($acf_delivery['_name'], array(""), 'user_'.$user_id); - update_field($acf_price['_name'] , array(""), 'user_'.$user_id); -} - - - - /* * on renew page : @@ -91,12 +65,6 @@ function renew_page_restrictions_CIPF(){ } } */ - - /* - * if prof can renew its card, reset some form fields before - * - */ - reset_some_fields_CIPF(); } add_action('template_redirect', 'renew_page_restrictions_CIPF'); diff --git a/plugins/cipf_plugin/php/reset_card_form.php b/plugins/cipf_plugin/php/reset_card_form.php new file mode 100644 index 0000000..ef42dab --- /dev/null +++ b/plugins/cipf_plugin/php/reset_card_form.php @@ -0,0 +1,41 @@ + diff --git a/plugins/cipf_plugin/utils/plgntls_class.php b/plugins/cipf_plugin/utils/plgntls_class.php index 9dfbf68..fe42896 100644 --- a/plugins/cipf_plugin/utils/plgntls_class.php +++ b/plugins/cipf_plugin/utils/plgntls_class.php @@ -368,10 +368,10 @@ class PLGNTLS_class /* * uncomment to print all enqueued files, can be usefull */ + /* global $wp_scripts; error_log("wp_scripts->queue:"); error_log(json_encode($wp_scripts->queue)); - /* global $wp_styles; error_log("wp_styles->queue:"); error_log(json_encode($wp_styles->queue));