| @@ -79,18 +79,36 @@ | ||
| 79 | 79 | 'link' => $baseUrl . 'products', |
| 80 | 80 | 'permission' => ['products/view'] |
| 81 | 81 | ]; |
| 82 | 82 | |
| 83 | + $children = []; | |
| 84 | + | |
| 85 | + // The parent link is not reachable on touch (the tap opens the dropdown), | |
| 86 | + // and the off-canvas menu renders children only — so list it as a child too. | |
| 87 | + $children['all_products'] = [ | |
| 88 | + 'label' => __('All Products', 'fluent-cart'), | |
| 89 | + 'link' => $baseUrl . 'products', | |
| 90 | + 'permission' => ['products/view'] | |
| 91 | + ]; | |
| 92 | + | |
| 93 | + // Attributes power the advanced-variations feature. | |
| 94 | + $children['product_attributes'] = [ | |
| 95 | + 'label' => __('Attributes', 'fluent-cart'), | |
| 96 | + 'link' => $baseUrl . 'products/attributes', | |
| 97 | + 'permission' => ['products/view'] | |
| 98 | + ]; | |
| 99 | + | |
| 100 | + // Inventory only when the advanced-inventory toggle is on. | |
| 83 | 101 | if (ModuleSettings::isActive('stock_management') && |
| 84 | 102 | ModuleSettings::getSettings('stock_management.enable_advanced_inventory') === 'yes') { |
| 85 | - $menu['children'] = [ | |
| 86 | - 'product_inventory' => [ | |
| 87 | - 'label' => __('Inventory', 'fluent-cart'), | |
| 88 | - 'link' => $baseUrl . 'products/inventory', | |
| 89 | - 'permission' => ['products/view'] | |
| 90 | - ] | |
| 103 | + $children['product_inventory'] = [ | |
| 104 | + 'label' => __('Inventory', 'fluent-cart'), | |
| 105 | + 'link' => $baseUrl . 'products/inventory', | |
| 106 | + 'permission' => ['products/view'] | |
| 91 | 107 | ]; |
| 92 | 108 | } |
| 109 | + | |
| 110 | + $menu['children'] = $children; | |
| 93 | 111 | |
| 94 | 112 | return $menu; |
| 95 | 113 | } |
| 96 | 114 | |