File tree Expand file tree Collapse file tree 4 files changed +26
-7
lines changed
Expand file tree Collapse file tree 4 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 1515 'sort ' => 1 ,
1616 'fields ' => [
1717 [
18+ 'name ' => 'status ' ,
19+ 'title ' => 'pwa::app.admin.system.status ' ,
20+ 'type ' => 'boolean '
21+ ], [
1822 'name ' => 'name ' ,
1923 'title ' => 'pwa::app.admin.system.name ' ,
2024 'type ' => 'text ' ,
Original file line number Diff line number Diff line change @@ -32,15 +32,17 @@ public function __construct(
3232 */
3333 public function storeCategoryIcon ($ category )
3434 {
35- $ data = request ()->all ();
35+ if ( core ()->getConfigData ('pwa.settings.general.status ' ) ) {
36+ $ data = request ()->all ();
3637
37- if (! $ category instanceof \Webkul \Category \Contracts \Category) {
38- $ category = $ this ->categoryRepository ->findOrFail ($ category );
39- }
40-
41- $ category ->category_product_in_pwa = ($ data ['add_in_pwa ' ] ?? 0 ) == "1 " ? 1 : 0 ;
42- $ category ->save ();
38+ if (! $ category instanceof \Webkul \Category \Contracts \Category) {
39+ $ category = $ this ->categoryRepository ->findOrFail ($ category );
40+ }
4341
42+ $ category ->category_product_in_pwa = ($ data ['add_in_pwa ' ] ?? 0 ) == "1 " ? 1 : 0 ;
43+ $ category ->save ();
44+ }
45+
4446 return $ category ;
4547 }
4648}
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ public function home()
3838 */
3939 public function index ()
4040 {
41+ if (! core ()->getConfigData ('pwa.settings.general.status ' ) ) {
42+ session ()->flash ('warning ' , trans ('pwa::app.shop.home.enable-pwa-status ' ));
43+
44+ return redirect ()->route ('shop.home.index ' );
45+ }
46+
4147 $ parsedUrl = parse_url (config ('app.url ' ));
4248
4349 $ urlPath = isset ($ parsedUrl ['path ' ]) ? $ parsedUrl ['path ' ] : '' ;
Original file line number Diff line number Diff line change 44 'admin ' => [
55 'system ' => [
66 'pwa ' => 'PWA ' ,
7+ 'status ' => 'Status ' ,
78 'btn-save ' => 'Save ' ,
89 'name ' => 'Name ' ,
910 'topic ' => 'Topic ' ,
6465 'target-url ' => 'Target URL ' ,
6566 'description ' => 'Description ' ,
6667 ]
68+ ],
69+
70+ 'shop ' => [
71+ 'home ' => [
72+ 'enable-pwa-status ' => 'Warning: Please enable pwa extension status from the configuration. ' ,
73+ ]
6774 ]
6875];
You can’t perform that action at this time.
0 commit comments