PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | api/User.php +10 -5 1.6.0 → 1.6.5 View file →
@@ -116,18 +116,23 @@
116 116 'user_id' => $userId
117 117 ]);
118 118
119 119 $this->updateUser($processedData, $userId);
120 - $this->setUserLoggedIn($userId);
120 + $storeSettings = new StoreSettings();
121 + $autoLogin = $storeSettings->get('auto_login_after_account_creation') === 'yes';
122 + if ($autoLogin) {
123 + $this->setUserLoggedIn($userId);
124 + }
121 125 $this->sendEmail($userId);
122 126
127 + $profilePage = $storeSettings->getCustomerProfilePage() . '#/profile';
123 128
124 - $checkoutPage = (new StoreSettings())->getCustomerProfilePage() . '#/profile';
125 -
126 129 return $this->sendSuccess([
127 - 'message' => __('User created successfully! You are now logged in.', 'fluent-cart'),
130 + 'message' => $autoLogin
131 + ? __('User created successfully! You are now logged in.', 'fluent-cart')
132 + : __('Your account has been created. Please check your email to set your password and log in.', 'fluent-cart'),
128 133 'code' => 'user_created',
129 - 'redirect_url' => $checkoutPage
134 + 'redirect_url' => $autoLogin ? $profilePage : wp_login_url($profilePage)
130 135 ]);
131 136 }
132 137
133 138 protected function sendEmail($userId)