fix: use SPA page (store) for reset password URL
Changed from /my-account to /store page URL: - Now reads spa_page from woonoow_appearance_settings - Uses get_permalink() on the configured SPA page ID - Fallback to home_url if SPA not configured - Reset URL format: /store/#/reset-password?key=...&login=...
This commit is contained in:
@@ -327,19 +327,21 @@ class EmailManager {
|
|||||||
return $message; // Use WordPress default
|
return $message; // Use WordPress default
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build reset URL - use customer-facing SPA route on my-account page
|
// Build reset URL - use SPA page from appearance settings
|
||||||
// The my-account page loads the customer-spa which has the reset-password route
|
// The SPA page (e.g., /store/) loads customer-spa which has /reset-password route
|
||||||
$myaccount_page_id = function_exists('wc_get_page_id') ? wc_get_page_id('myaccount') : 0;
|
$appearance_settings = get_option('woonoow_appearance_settings', []);
|
||||||
if ($myaccount_page_id > 0) {
|
$spa_page_id = $appearance_settings['general']['spa_page'] ?? 0;
|
||||||
$myaccount_url = get_permalink($myaccount_page_id);
|
|
||||||
|
if ($spa_page_id > 0) {
|
||||||
|
$spa_url = get_permalink($spa_page_id);
|
||||||
} else {
|
} else {
|
||||||
// Fallback to home URL if my-account page doesn't exist
|
// Fallback to home URL if SPA page not configured
|
||||||
$myaccount_url = home_url('/');
|
$spa_url = home_url('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build SPA reset password URL with hash router format
|
// Build SPA reset password URL with hash router format
|
||||||
// Format: /my-account/#/reset-password?key=KEY&login=LOGIN
|
// Format: /store/#/reset-password?key=KEY&login=LOGIN
|
||||||
$reset_link = rtrim($myaccount_url, '/') . '#/reset-password?key=' . $key . '&login=' . rawurlencode($user_login);
|
$reset_link = rtrim($spa_url, '/') . '#/reset-password?key=' . $key . '&login=' . rawurlencode($user_login);
|
||||||
|
|
||||||
// Create a pseudo WC_Customer for template rendering
|
// Create a pseudo WC_Customer for template rendering
|
||||||
$customer = null;
|
$customer = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user