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 | app/Http/Controllers/DashboardController.php +93 -9 1.3.21 → 1.6.5 View file →
@@ -20,8 +20,9 @@
20 20 'title' => __('Setup Pages', 'fluent-cart'),
21 21 'text' => __("Customers to find what they're looking for by organising.", 'fluent-cart'),
22 22 'icon' => 'Cart',
23 23 'completed' => false,
24 + 'hash_id' => '',
24 25 'url' => $baseUrl . "settings/store-settings/pages_setup"
25 26 ],
26 27 'store_info' => [
27 28 'title' => __('Add Details to Store', 'fluent-cart'),
@@ -27,9 +28,10 @@
27 28 'title' => __('Add Details to Store', 'fluent-cart'),
28 29 'text' => __('Store details such as addresses, company info etc.', 'fluent-cart'),
29 30 'icon' => 'StoreIcon',
30 31 'completed' => false,
31 - 'url' => $baseUrl . "settings/store-settings/"
32 + 'hash_id' => '',
33 + 'url' => $baseUrl . "settings/store-settings"
32 34 ],
33 35 'product_info' => [
34 36 'title' => __('Add Your First Product', 'fluent-cart'),
35 37 'text' => __('Share your brand story and build trust with customers.', 'fluent-cart'),
@@ -34,8 +36,9 @@
34 36 'title' => __('Add Your First Product', 'fluent-cart'),
35 37 'text' => __('Share your brand story and build trust with customers.', 'fluent-cart'),
36 38 'icon' => 'ShoppingCartIcon',
37 39 'completed' => false,
40 + 'hash_id' => '',
38 41 'url' => $baseUrl . "products"
39 42 ],
40 43
41 44
@@ -43,8 +46,9 @@
43 46 'title' => __('Setup Payment Methods', 'fluent-cart'),
44 47 'text' => __("Choose from fast & secure online and offline payment.", 'fluent-cart'),
45 48 'icon' => 'PaymentIcon',
46 49 'completed' => true,
50 + 'hash_id' => '',
47 51 'url' => $baseUrl . "settings/payments"
48 52 ],
49 53 ];
50 54
@@ -59,11 +63,25 @@
59 63 $completed++;
60 64 $steps['product_info']['completed'] = true;
61 65 }
62 66
63 - if ($this->isAllPageSetUpDone($settings)) {
67 + $missingPage = $this->getMissingPageSetup($settings);
68 +
69 + if (!$missingPage) {
64 70 $completed++;
65 71 $steps['page_setup']['completed'] = true;
72 + } else {
73 + // Let whichever plugin registered the missing page (via
74 + // fluent_cart/generatable_pages) decide where it should be
75 + // resolved. Core stays agnostic of third-party settings screens.
76 + $steps['page_setup']['url'] = apply_filters(
77 + 'fluent_cart/dashboard/page_setup_redirect_url',
78 + $steps['page_setup']['url'],
79 + [
80 + 'missing_page' => $missingPage,
81 + 'base_url' => $baseUrl,
82 + ]
83 + );
66 84 }
67 85
68 86 if (!$this->isAnyPaymentModuleEnabled()) {
69 87 $steps['setup_payments']['completed'] = false;
@@ -70,9 +88,57 @@
70 88 } else {
71 89 $completed++;
72 90 }
73 91
92 + if (defined('BRICKS_VERSION')) {
93 + $steps['install_bricks_addon'] = [
94 + 'title' => __('Install Bricks Addon', 'fluent-cart'),
95 + 'text' => __('Design your store pages with FluentCart elements in Bricks.', 'fluent-cart'),
96 + 'icon' => 'AppsLine',
97 + 'completed' => false,
98 + 'hash_id' => 'fluent-cart-bricks-blocks',
99 + 'url' => $baseUrl . "settings/addons"
100 + ];
74 101
102 + if (defined('FLUENT_CART_BRICKS_BLOCKS_VERSION')) {
103 + $steps['install_bricks_addon']['completed'] = true;
104 + $completed++;
105 + }
106 + }
107 +
108 + if (defined('ELEMENTOR_VERSION')) {
109 + $steps['install_elementor_addon'] = [
110 + 'title' => __('Install Elementor Addon', 'fluent-cart'),
111 + 'text' => __('Design your store pages with FluentCart widgets in Elementor.', 'fluent-cart'),
112 + 'icon' => 'AppsLine',
113 + 'completed' => false,
114 + 'hash_id' => 'fluent-cart-elementor-blocks',
115 + 'url' => $baseUrl . "settings/addons"
116 + ];
117 +
118 + if (defined('FLUENTCART_ELEMENTOR_BLOCKS_VERSION')) {
119 + $steps['install_elementor_addon']['completed'] = true;
120 + $completed++;
121 + }
122 + }
123 +
124 + if (strpos(get_template(), 'Divi') !== false) {
125 + $steps['install_divi_addon'] = [
126 + 'title' => __('Install Divi Addon', 'fluent-cart'),
127 + 'text' => __('Design your store pages with FluentCart modules in Divi.', 'fluent-cart'),
128 + 'icon' => 'AppsLine',
129 + 'completed' => false,
130 + 'hash_id' => 'fluent-cart-divi-modules',
131 + 'url' => $baseUrl . "settings/addons"
132 + ];
133 +
134 + // FLUENTCART_DIVI_BLOCKS_VERSION covers installs from before the slug rename
135 + if (defined('FLUENTCART_DIVI_MODULES_VERSION') || defined('FLUENTCART_DIVI_BLOCKS_VERSION')) {
136 + $steps['install_divi_addon']['completed'] = true;
137 + $completed++;
138 + }
139 + }
140 +
75 141 return $this->response->json([
76 142 'data' => [
77 143 'steps' => $steps,
78 144 'completed' => $completed
@@ -96,18 +162,36 @@
96 162 return Product::query()->count() > 0;
97 163 }
98 164
99 165
100 - private function isAllPageSetUpDone(array $settings): bool
166 + private function getMissingPageSetup(array $settings): ?array
101 167 {
102 - $pages = (new Pages())->getGeneratablePage();
103 - foreach ($pages as $pageKey => $page) {
104 - $pageKey = "{$pageKey}_page_id";
105 - if (empty(Arr::get($settings, $pageKey))) {
106 - return false;
168 + $pagesInstance = new Pages();
169 + $pages = $pagesInstance->getGeneratablePage();
170 +
171 + // Core pages must be checked first regardless of the order a
172 + // fluent_cart/generatable_pages listener leaves the filtered array
173 + // in, so an add-on can never take priority over a missing core page.
174 + $orderedKeys = array_unique(array_merge(
175 + array_keys($pagesInstance->corePages()),
176 + array_keys($pages)
177 + ));
178 +
179 + foreach ($orderedKeys as $pageKey) {
180 + if (!isset($pages[$pageKey])) {
181 + continue;
107 182 }
183 +
184 + $settingKey = "{$pageKey}_page_id";
185 + if (empty(Arr::get($settings, $settingKey))) {
186 + return array_merge($pages[$pageKey], [
187 + 'key' => $pageKey,
188 + 'setting_key' => $settingKey,
189 + ]);
190 + }
108 191 }
109 - return true;
192 +
193 + return null;
110 194 }
111 195
112 196 private function isAnyPaymentModuleEnabled(): bool
113 197 {