Changeset 2907071
- Timestamp:
- 05/02/2023 03:14:16 PM (3 years ago)
- Location:
- sprinque
- Files:
-
- 14 edited
- 1 copied
-
tags/1.3.1 (copied) (copied from sprinque/trunk)
-
tags/1.3.1/assets/css/frontend.css (modified) (2 diffs)
-
tags/1.3.1/assets/css/frontend.scss (modified) (2 diffs)
-
tags/1.3.1/assets/js/frontend.js (modified) (8 diffs)
-
tags/1.3.1/include/payment_method.php (modified) (2 diffs)
-
tags/1.3.1/readme.txt (modified) (2 diffs)
-
tags/1.3.1/sprinque.php (modified) (2 diffs)
-
tags/1.3.1/templates/frontend/srinque_pay_modal_form.php (modified) (1 diff)
-
trunk/assets/css/frontend.css (modified) (2 diffs)
-
trunk/assets/css/frontend.scss (modified) (2 diffs)
-
trunk/assets/js/frontend.js (modified) (8 diffs)
-
trunk/include/payment_method.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sprinque.php (modified) (2 diffs)
-
trunk/templates/frontend/srinque_pay_modal_form.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sprinque/tags/1.3.1/assets/css/frontend.css
r2903962 r2907071 363 363 } 364 364 .modal-form.modal-form_show.modal-form_anim .modal-form-inner { 365 top: 50%;365 top: 20px; 366 366 opacity: 1; 367 367 box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px; … … 398 398 top: 30%; 399 399 left: 50%; 400 transform: translate(calc(-50% - 32px), calc(-50% - 32px));400 transform: translate(calc(-50% - 32px), 0); 401 401 } 402 402 .modal-form-inner:focus { -
sprinque/tags/1.3.1/assets/css/frontend.scss
r2903962 r2907071 410 410 } 411 411 .modal-form-inner { 412 top: 50%;412 top: 20px; 413 413 opacity: 1; 414 414 box-shadow: rgb(0 0 0 / 20%) 0px 11px 15px -7px, rgb(0 0 0 / 14%) 0px 24px 38px 3px, rgb(0 0 0 / 12%) 0px 9px 46px 8px; … … 454 454 top: 30%; 455 455 left: 50%; 456 transform: translate(calc(-50% - 32px), calc(-50% - 32px));456 transform: translate(calc(-50% - 32px), 0); 457 457 @media screen and (max-width: 575.98px) { 458 458 padding: 16px; -
sprinque/tags/1.3.1/assets/js/frontend.js
r2903962 r2907071 138 138 } 139 139 140 updateRegistrationNumberRequiredMark(); 141 140 142 toggle_radio_buttons(); 141 143 } … … 149 151 $('#register_buyer_company').prop('disabled', isRegisterNewBusinessFieldsVal); 150 152 }); 153 } 154 155 function updateRegistrationNumberRequiredMark() { 156 if (countries.length < 1) { 157 return ; 158 } 159 160 const country_code = $('#select_country_pay').val(); 161 const country = countries.find(country => country.code === country_code); 162 const is_registration_number_required = country.is_registration_number_required; 163 164 if (is_registration_number_required) { 165 $('.registration-number-required').show(); 166 } else { 167 $('.registration-number-required, #reg_number_warning').hide(); 168 } 151 169 } 152 170 … … 397 415 398 416 $("body").on("input", "#reg_number_pay", function(event) { 399 const country_code = $('#select_country_pay').val().toLowerCase(); 417 let country_code_upper = $('#select_country_pay').val(); 418 const country_code = country_code_upper.toLowerCase(); 400 419 const reg_number = $(this).val(); 401 420 let language = document.documentElement.lang; … … 403 422 language = language.split('-'); 404 423 language = language.shift(); 405 const validation = Sprinque.checkRegNumber(reg_number, country_code, language); 406 407 if (!validation.isValid) { 408 $('#reg_number_warning') 409 .show() 410 .text(validation.message); 424 425 const country = countries.find(country => country.code === country_code_upper); 426 if (country.is_registration_number_required) { 427 const validation = Sprinque.checkRegNumber(reg_number, country_code, language); 428 429 if (!validation.isValid) { 430 $('#reg_number_warning') 431 .show() 432 .text(validation.message); 433 } else { 434 $('#reg_number_warning').hide(); 435 } 411 436 } else { 412 437 $('#reg_number_warning').hide(); … … 477 502 var company_name = $('#company_name_pay').val(); 478 503 504 const country = countries.find(country => country.code === country_code); 505 const is_registration_number_value = country.is_registration_number_required ? reg_number.length > 0 : true; 506 479 507 $('.error-confirm-order').hide(); 480 508 481 if( reg_number.length > 0&& company_name.length > 1 && country_code.length > 0) {509 if(is_registration_number_value && company_name.length > 1 && country_code.length > 0) { 482 510 $('.register_new_business').show(); 483 511 $('.search_already_added_company').hide(); … … 523 551 } 524 552 553 const country = countries.find(country => country.code === country_code); 554 const is_registration_number_value = country.is_registration_number_required ? registration_number.length > 0 : true; 555 525 556 // Here the problem on js layer 526 557 $('.error-register-fields').hide(); 527 558 528 if(business_name.length > 1 && registration_number.length > 0&& country_code.length > 0 && zip_code.length > 0 && city.length > 0559 if(business_name.length > 1 && is_registration_number_value && country_code.length > 0 && zip_code.length > 0 && city.length > 0 529 560 && address_line1.length > 0 && first_name.length > 0 && last_name.length > 0 && email.length > 0) { 530 561 $.ajax({ … … 725 756 const credit_bureau_id = $selectedCompany.data('credit-bureau-id').toString(); 726 757 758 const country = countries.find(country => country.code === country_code); 759 const is_registration_number_value = country.is_registration_number_required ? registration_number.length > 0 : true; 760 727 761 $('.error-confirm-order').hide(); 728 762 729 if(business_name.length > 1 && registration_number.length > 0&& country_code.length > 0 && zip_code.length > 0 && city.length > 0763 if(business_name.length > 1 && is_registration_number_value && country_code.length > 0 && zip_code.length > 0 && city.length > 0 730 764 && address_line1.length > 0 && first_name.length > 0 && last_name.length > 0 && email.length > 0) { 731 765 … … 1046 1080 countries = response; 1047 1081 toggle_radio_buttons(); 1082 updateRegistrationNumberRequiredMark(); 1048 1083 } 1049 1084 } -
sprinque/tags/1.3.1/include/payment_method.php
r2903962 r2907071 247 247 $email = sanitize_text_field( $_POST['email'] ); 248 248 $phone_number = sanitize_text_field($_POST['phone']); 249 $phone_number = str_replace( ' ', '', $phone_number);249 $phone_number = str_replace([' ', '/', '-'], '', $phone_number); 250 250 $phone = $phone_number; 251 251 $country = sanitize_text_field( $_POST['country_code'] ); … … 427 427 $fee /= 100.0; 428 428 $data['order_amount'] *= 1.0 + $fee; 429 $data['order_amount'] = round($data['order_amount'], 2); 429 430 } 430 431 } -
sprinque/tags/1.3.1/readme.txt
r2903962 r2907071 6 6 Tested up to: 6.0 7 7 Requires PHP: 5.3 8 Stable tag: 1.3. 08 Stable tag: 1.3.1 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 51 51 == Changelog == 52 53 = 1.3.1 - May 2, 2023 = 54 * Round order_amount to 2 decimals; 55 * Reg number required condition; 56 * Remove ' ', '/', '-' in phone number; 57 * Changed top position of the modal; 52 58 53 59 = 1.3.0 - April 25, 2023 = -
sprinque/tags/1.3.1/sprinque.php
r2903962 r2907071 5 5 Description: Sprinque for WordPress is a plugin that allows you to offer your business buyers net payment terms (15, 30, 60, 90 days) and thereby grow conversion and retention. 6 6 Author: Sprinque 7 Version: 1.3. 07 Version: 1.3.1 8 8 Text Domain: sprinque 9 9 Domain Path: /languages 10 10 */ 11 11 12 define( 'PLUGIN_SRINQUE_VERSION', '1.3. 0' );12 define( 'PLUGIN_SRINQUE_VERSION', '1.3.1' ); 13 13 define( 'PLUGIN_SRINQUE_DIR', __DIR__ ); 14 14 define( 'PLUGIN_SRINQUE_PATH', plugins_url( '', __FILE__ ) ); … … 402 402 $calculated_fee = $total * $fee_percents; 403 403 $total += $calculated_fee; 404 $total = round($total, 2); 404 405 405 406 // Prepare Data to Send -
sprinque/tags/1.3.1/templates/frontend/srinque_pay_modal_form.php
r2903962 r2907071 42 42 <div class="error-confirm-order" style="display: none;"><?php _e( "Not all required fields are filled", 'sprinque' ); ?></div> 43 43 <div class="field-group"> 44 <label><?php _e( "Registration number", 'sprinque' ); ?> *</label>44 <label><?php _e( "Registration number", 'sprinque' ); ?><span class="registration-number-required">*</span></label> 45 45 <input type="text" id="reg_number_pay" placeholder="<?php _e( "Registration number", 'sprinque' ); ?>"> 46 46 <div class="field-warning" id="reg_number_warning"> -
sprinque/trunk/assets/css/frontend.css
r2903962 r2907071 363 363 } 364 364 .modal-form.modal-form_show.modal-form_anim .modal-form-inner { 365 top: 50%;365 top: 20px; 366 366 opacity: 1; 367 367 box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px; … … 398 398 top: 30%; 399 399 left: 50%; 400 transform: translate(calc(-50% - 32px), calc(-50% - 32px));400 transform: translate(calc(-50% - 32px), 0); 401 401 } 402 402 .modal-form-inner:focus { -
sprinque/trunk/assets/css/frontend.scss
r2903962 r2907071 410 410 } 411 411 .modal-form-inner { 412 top: 50%;412 top: 20px; 413 413 opacity: 1; 414 414 box-shadow: rgb(0 0 0 / 20%) 0px 11px 15px -7px, rgb(0 0 0 / 14%) 0px 24px 38px 3px, rgb(0 0 0 / 12%) 0px 9px 46px 8px; … … 454 454 top: 30%; 455 455 left: 50%; 456 transform: translate(calc(-50% - 32px), calc(-50% - 32px));456 transform: translate(calc(-50% - 32px), 0); 457 457 @media screen and (max-width: 575.98px) { 458 458 padding: 16px; -
sprinque/trunk/assets/js/frontend.js
r2903962 r2907071 138 138 } 139 139 140 updateRegistrationNumberRequiredMark(); 141 140 142 toggle_radio_buttons(); 141 143 } … … 149 151 $('#register_buyer_company').prop('disabled', isRegisterNewBusinessFieldsVal); 150 152 }); 153 } 154 155 function updateRegistrationNumberRequiredMark() { 156 if (countries.length < 1) { 157 return ; 158 } 159 160 const country_code = $('#select_country_pay').val(); 161 const country = countries.find(country => country.code === country_code); 162 const is_registration_number_required = country.is_registration_number_required; 163 164 if (is_registration_number_required) { 165 $('.registration-number-required').show(); 166 } else { 167 $('.registration-number-required, #reg_number_warning').hide(); 168 } 151 169 } 152 170 … … 397 415 398 416 $("body").on("input", "#reg_number_pay", function(event) { 399 const country_code = $('#select_country_pay').val().toLowerCase(); 417 let country_code_upper = $('#select_country_pay').val(); 418 const country_code = country_code_upper.toLowerCase(); 400 419 const reg_number = $(this).val(); 401 420 let language = document.documentElement.lang; … … 403 422 language = language.split('-'); 404 423 language = language.shift(); 405 const validation = Sprinque.checkRegNumber(reg_number, country_code, language); 406 407 if (!validation.isValid) { 408 $('#reg_number_warning') 409 .show() 410 .text(validation.message); 424 425 const country = countries.find(country => country.code === country_code_upper); 426 if (country.is_registration_number_required) { 427 const validation = Sprinque.checkRegNumber(reg_number, country_code, language); 428 429 if (!validation.isValid) { 430 $('#reg_number_warning') 431 .show() 432 .text(validation.message); 433 } else { 434 $('#reg_number_warning').hide(); 435 } 411 436 } else { 412 437 $('#reg_number_warning').hide(); … … 477 502 var company_name = $('#company_name_pay').val(); 478 503 504 const country = countries.find(country => country.code === country_code); 505 const is_registration_number_value = country.is_registration_number_required ? reg_number.length > 0 : true; 506 479 507 $('.error-confirm-order').hide(); 480 508 481 if( reg_number.length > 0&& company_name.length > 1 && country_code.length > 0) {509 if(is_registration_number_value && company_name.length > 1 && country_code.length > 0) { 482 510 $('.register_new_business').show(); 483 511 $('.search_already_added_company').hide(); … … 523 551 } 524 552 553 const country = countries.find(country => country.code === country_code); 554 const is_registration_number_value = country.is_registration_number_required ? registration_number.length > 0 : true; 555 525 556 // Here the problem on js layer 526 557 $('.error-register-fields').hide(); 527 558 528 if(business_name.length > 1 && registration_number.length > 0&& country_code.length > 0 && zip_code.length > 0 && city.length > 0559 if(business_name.length > 1 && is_registration_number_value && country_code.length > 0 && zip_code.length > 0 && city.length > 0 529 560 && address_line1.length > 0 && first_name.length > 0 && last_name.length > 0 && email.length > 0) { 530 561 $.ajax({ … … 725 756 const credit_bureau_id = $selectedCompany.data('credit-bureau-id').toString(); 726 757 758 const country = countries.find(country => country.code === country_code); 759 const is_registration_number_value = country.is_registration_number_required ? registration_number.length > 0 : true; 760 727 761 $('.error-confirm-order').hide(); 728 762 729 if(business_name.length > 1 && registration_number.length > 0&& country_code.length > 0 && zip_code.length > 0 && city.length > 0763 if(business_name.length > 1 && is_registration_number_value && country_code.length > 0 && zip_code.length > 0 && city.length > 0 730 764 && address_line1.length > 0 && first_name.length > 0 && last_name.length > 0 && email.length > 0) { 731 765 … … 1046 1080 countries = response; 1047 1081 toggle_radio_buttons(); 1082 updateRegistrationNumberRequiredMark(); 1048 1083 } 1049 1084 } -
sprinque/trunk/include/payment_method.php
r2903962 r2907071 247 247 $email = sanitize_text_field( $_POST['email'] ); 248 248 $phone_number = sanitize_text_field($_POST['phone']); 249 $phone_number = str_replace( ' ', '', $phone_number);249 $phone_number = str_replace([' ', '/', '-'], '', $phone_number); 250 250 $phone = $phone_number; 251 251 $country = sanitize_text_field( $_POST['country_code'] ); … … 427 427 $fee /= 100.0; 428 428 $data['order_amount'] *= 1.0 + $fee; 429 $data['order_amount'] = round($data['order_amount'], 2); 429 430 } 430 431 } -
sprinque/trunk/readme.txt
r2903962 r2907071 6 6 Tested up to: 6.0 7 7 Requires PHP: 5.3 8 Stable tag: 1.3. 08 Stable tag: 1.3.1 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 50 50 51 51 == Changelog == 52 53 = 1.3.1 - May 2, 2023 = 54 * Round order_amount to 2 decimals; 55 * Reg number required condition; 56 * Remove ' ', '/', '-' in phone number; 57 * Changed top position of the modal; 52 58 53 59 = 1.3.0 - April 25, 2023 = -
sprinque/trunk/sprinque.php
r2903962 r2907071 5 5 Description: Sprinque for WordPress is a plugin that allows you to offer your business buyers net payment terms (15, 30, 60, 90 days) and thereby grow conversion and retention. 6 6 Author: Sprinque 7 Version: 1.3. 07 Version: 1.3.1 8 8 Text Domain: sprinque 9 9 Domain Path: /languages 10 10 */ 11 11 12 define( 'PLUGIN_SRINQUE_VERSION', '1.3. 0' );12 define( 'PLUGIN_SRINQUE_VERSION', '1.3.1' ); 13 13 define( 'PLUGIN_SRINQUE_DIR', __DIR__ ); 14 14 define( 'PLUGIN_SRINQUE_PATH', plugins_url( '', __FILE__ ) ); … … 402 402 $calculated_fee = $total * $fee_percents; 403 403 $total += $calculated_fee; 404 $total = round($total, 2); 404 405 405 406 // Prepare Data to Send -
sprinque/trunk/templates/frontend/srinque_pay_modal_form.php
r2903962 r2907071 42 42 <div class="error-confirm-order" style="display: none;"><?php _e( "Not all required fields are filled", 'sprinque' ); ?></div> 43 43 <div class="field-group"> 44 <label><?php _e( "Registration number", 'sprinque' ); ?> *</label>44 <label><?php _e( "Registration number", 'sprinque' ); ?><span class="registration-number-required">*</span></label> 45 45 <input type="text" id="reg_number_pay" placeholder="<?php _e( "Registration number", 'sprinque' ); ?>"> 46 46 <div class="field-warning" id="reg_number_warning">
Note: See TracChangeset
for help on using the changeset viewer.