Skip to content

Commit

Permalink
Fix: profile completion checker for setup wizard (#2166)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aunshon authored Feb 8, 2024
1 parent 9b8a7e8 commit f4e6850
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions includes/Vendor/SetupWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,13 +650,13 @@ public function dokan_setup_payment_save() {
}
}

if ( $has_bank_information ) {
if ( $has_bank_information && ! empty( $dokan_settings['profile_completion']['progress_vals']['payment_method_val'] ) ) {
$dokan_settings['profile_completion']['bank'] = $dokan_settings['profile_completion']['progress_vals']['payment_method_val'];
$dokan_settings['profile_completion']['paypal'] = 0;
}
}

if ( ! empty( $_POST['settings']['paypal']['email'] ) ) {
if ( ! empty( $_POST['settings']['paypal']['email'] ) && ! empty( $dokan_settings['profile_completion']['progress_vals']['payment_method_val'] ) ) {
$dokan_settings['payment']['paypal'] = [
'email' => sanitize_email( wp_unslash( $_POST['settings']['paypal']['email'] ) ),
];
Expand All @@ -667,7 +667,7 @@ public function dokan_setup_payment_save() {
// Check any payment methods setups and add manually value on Profile Completion also increase progress value
if ( ! empty( $dokan_settings['profile_completion']['paypal'] ) || ! empty( $dokan_settings['profile_completion']['bank'] ) ) {
$profile_settings = get_user_meta( $this->store_id, 'dokan_profile_settings', true );
if ( ! empty( $profile_settings['profile_completion']['progress'] ) ) {
if ( ! empty( $profile_settings['profile_completion']['progress'] ) && ! empty( $dokan_settings['profile_completion']['progress_vals']['payment_method_val'] ) ) {
$dokan_settings['profile_completion']['progress'] = $profile_settings['profile_completion']['progress'] + $dokan_settings['profile_completion']['progress_vals']['payment_method_val'];
}
}
Expand Down

0 comments on commit f4e6850

Please sign in to comment.