fix: Dashboard path and guest wishlist access
Issue 1 - Dashboard Always Active: Problem: Dashboard menu showed active on all routes Root Cause: Navigation tree used path='/' which matched all routes Solution: Changed dashboard path from '/' to '/dashboard' in NavigationRegistry - Main menu path: '/' → '/dashboard' - Overview submenu: '/' → '/dashboard' - SPA already had redirect from '/' to '/dashboard' Result: Dashboard only active on dashboard routes ✅ Issue 2 - Guest Wishlist Blocked: Problem: Heart icon required login despite enable_guest_wishlist setting Root Cause: Wishlist icon had user?.isLoggedIn check in frontend Solution: Removed isLoggedIn check from wishlist icon visibility - Backend already checks enable_guest_wishlist setting in check_permission() - Frontend now shows icon when module enabled + show_in_header setting - Guests can click and access wishlist (backend enforces permission) Result: Guest wishlist fully functional ✅ Files Modified (2): - includes/Compat/NavigationRegistry.php (dashboard path) - customer-spa/src/layouts/BaseLayout.tsx (removed login check) - admin-spa/dist/app.js + customer-spa/dist/app.js (rebuilt) Both issues resolved!
This commit is contained in:
@@ -135,7 +135,7 @@ function ClassicLayout({ children }: BaseLayoutProps) {
|
|||||||
))}
|
))}
|
||||||
|
|
||||||
{/* Wishlist */}
|
{/* Wishlist */}
|
||||||
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && user?.isLoggedIn && (
|
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && (
|
||||||
<Link to="/my-account/wishlist" className="flex items-center gap-2 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
<Link to="/my-account/wishlist" className="flex items-center gap-2 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
||||||
<Heart className="h-5 w-5" />
|
<Heart className="h-5 w-5" />
|
||||||
<span className="hidden lg:block">Wishlist</span>
|
<span className="hidden lg:block">Wishlist</span>
|
||||||
|
|||||||
@@ -109,10 +109,10 @@ class NavigationRegistry {
|
|||||||
[
|
[
|
||||||
'key' => 'dashboard',
|
'key' => 'dashboard',
|
||||||
'label' => __('Dashboard', 'woonoow'),
|
'label' => __('Dashboard', 'woonoow'),
|
||||||
'path' => '/',
|
'path' => '/dashboard',
|
||||||
'icon' => 'layout-dashboard',
|
'icon' => 'layout-dashboard',
|
||||||
'children' => [
|
'children' => [
|
||||||
['label' => __('Overview', 'woonoow'), 'mode' => 'spa', 'path' => '/', 'exact' => true],
|
['label' => __('Overview', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard', 'exact' => true],
|
||||||
['label' => __('Revenue', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard/revenue'],
|
['label' => __('Revenue', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard/revenue'],
|
||||||
['label' => __('Orders', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard/orders'],
|
['label' => __('Orders', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard/orders'],
|
||||||
['label' => __('Products', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard/products'],
|
['label' => __('Products', 'woonoow'), 'mode' => 'spa', 'path' => '/dashboard/products'],
|
||||||
|
|||||||
Reference in New Issue
Block a user