From 308f8a41d2e7558438ffea195e15e8a0243193a3 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 17:15:17 +0530 Subject: [PATCH 01/28] updated readme --- README.md | 93 +++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index ae51f948a..41479eef6 100755 --- a/README.md +++ b/README.md @@ -13,10 +13,10 @@ # Topics 1. ### [Introduction](#1-introduction-) 2. ### [Requirements](#2-requirements-) -3. ### [Configuration](#3-configuration-) -4. ### [Installation](#4-installation-) -5. ### [License](#5-license-) -6. ### [Miscellaneous](#6-miscellaneous-) +3. ### [Installation & Configuration](#3-configuration-) + +4. ### [License](#4-license-) +5. ### [Miscellaneous](#5-miscellaneous-) ### 1. Introduction : @@ -55,22 +55,54 @@ Bagisto is using power of both of these frameworks and making best out of it out * **SERVER**: Apache 2 or NGINX * **RAM**: 2 GB or higher. * **PHP**: 7.1.17 or higher. -* **Processor**: Clock Cycle 1Ghz or higher. +* **Processor**: Clock Cycle 1 Ghz or higher. * **Mysql**: 5.7.23 or higher. * **Node**: 8.11.3 LTS or higher. * **Composer**: 1.6.5 or higher. -### 3. Configuration : +### 3. Installation & Configuration : -**Run this Command** to download the project on to your local machine or server: +**Execute these Commands Below As In Their Order** to download the project on to your local machine or server: > Note: If you have downloaded zip file then ignore this. ~~~ -composer create-project bagisto/bagisto +1. composer create-project bagisto/bagisto ~~~ -if the above command's process was successful, you will find directory **bagisto** and all of the code will be inside it. +~~~ +2. php artisan migrate +~~~ + +~~~ +3. php artisan db:seed +~~~ + +~~~ +4. php artisan vendor:publish +-> Press 0 and then press enter to publish all assets and configurations. +~~~ + +~~~ +5. php artisan storage:link +~~~ + +~~~ +6. composer dump-autoload +~~~ + +> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. + +> **Note: you can fetch your admin panel by follow below url:** +~~~ +http(s)://example.com/admin/login +~~~ +~~~ +email:admin@example.com +password:admin123 +~~~ + + Press 0 and then press enter to publish all assets and configurations. -~~~ -``` -php artisan storage:link -``` - -``` -composer dump-autoload -``` - -> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. - -> **Note: you can fetch your admin panel by follow below url:** -~~~ -http(s)://example.com/admin/login -~~~ -~~~ -email:admin@example.com -password:admin123 -~~~ +default. --> ### 5. License : Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE). From 1326d7ec283d1b250899cfb2f4704e7dad76b7c4 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 17:21:26 +0530 Subject: [PATCH 02/28] more changes --- README.md | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 41479eef6..fe708980a 100755 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ # Topics 1. ### [Introduction](#1-introduction-) 2. ### [Requirements](#2-requirements-) -3. ### [Installation & Configuration](#3-configuration-) +3. ### [Installation & Configuration](#3-installation--configuration-) 4. ### [License](#4-license-) 5. ### [Miscellaneous](#5-miscellaneous-) @@ -62,31 +62,51 @@ Bagisto is using power of both of these frameworks and making best out of it out ### 3. Installation & Configuration : -**Execute these Commands Below As In Their Order** to download the project on to your local machine or server: - -> Note: If you have downloaded zip file then ignore this. +**Execute these Commands Below As In Their Order** +This downloads the code to your local machine or server: ~~~ 1. composer create-project bagisto/bagisto ~~~ +##### Now configure your database: +if the above command's process was successful, you will find directory **bagisto** and all of the code will be inside it. + +After it set your **.env** variable, especially the ones below: + +* **APP_URL** +* **DB_CONNECTION** +* **DB_HOST** +* **DB_PORT** +* **DB_DATABASE** +* **DB_USERNAME** +* **DB_PASSWORD** + +Although you have to set the mailer variables also for full functioning of your store for sending emails at various events by +default. + +This command is responsible for creating all necessary tables in your database: ~~~ 2. php artisan migrate ~~~ +This command is responsible for inserting demo data in your database tables: ~~~ 3. php artisan db:seed ~~~ +This command will publish all the media, frontend scripts, styles and configurations: ~~~ 4. php artisan vendor:publish -> Press 0 and then press enter to publish all assets and configurations. ~~~ +This command is necessary to make symlink between your public folder and storage folder: ~~~ 5. php artisan storage:link ~~~ +It regenerates the autoloading class map, in case some package doesn't get discovered: ~~~ 6. composer dump-autoload ~~~ @@ -102,21 +122,6 @@ email:admin@example.com password:admin123 ~~~ - - ### 5. License : Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE). From 102a43697a2d73ec831797b7968681be4e115cbf Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 17:38:08 +0530 Subject: [PATCH 03/28] more changes in readme --- README.md | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index fe708980a..8224dfe25 100755 --- a/README.md +++ b/README.md @@ -64,15 +64,15 @@ Bagisto is using power of both of these frameworks and making best out of it out **Execute these Commands Below As In Their Order** -This downloads the code to your local machine or server: ~~~ 1. composer create-project bagisto/bagisto ~~~ -##### Now configure your database: -if the above command's process was successful, you will find directory **bagisto** and all of the code will be inside it. +**Now configure your database** -After it set your **.env** variable, especially the ones below: +If the above command was completed successfully, then you'll find directory **bagisto** and all of the code will be inside it. + +Find file **.env** inside **bagisto** directory and set the environment variables listed below: * **APP_URL** * **DB_CONNECTION** @@ -82,46 +82,55 @@ After it set your **.env** variable, especially the ones below: * **DB_USERNAME** * **DB_PASSWORD** -Although you have to set the mailer variables also for full functioning of your store for sending emails at various events by -default. +Although, mailer environment variables are also required to be set up as **Bagisto** requires emails to send to customers and admins for various functionalities that are built in. -This command is responsible for creating all necessary tables in your database: ~~~ 2. php artisan migrate ~~~ -This command is responsible for inserting demo data in your database tables: ~~~ 3. php artisan db:seed ~~~ -This command will publish all the media, frontend scripts, styles and configurations: ~~~ 4. php artisan vendor:publish -> Press 0 and then press enter to publish all assets and configurations. ~~~ -This command is necessary to make symlink between your public folder and storage folder: ~~~ 5. php artisan storage:link ~~~ -It regenerates the autoloading class map, in case some package doesn't get discovered: ~~~ 6. composer dump-autoload ~~~ -> That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. +To execute **Bagisto**: + +On server: -> **Note: you can fetch your admin panel by follow below url:** ~~~ -http(s)://example.com/admin/login +Open the specified entry point in your hosts file in browser or make entry in hosts file if not done. ~~~ + +On local: + +~~~ +php artisan serve +~~~ + +*How to log in as admin* + +> *http(s)://example.com/admin/login:* + ~~~ email:admin@example.com password:admin123 ~~~ +> *http(s)://example.com/customer/register* + + ### 5. License : Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE). From da84f49cf17672c0a624526053129dbb5c7760e6 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:16:21 +0530 Subject: [PATCH 04/28] installer description added in readme --- README.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8224dfe25..d99cb7cd1 100755 --- a/README.md +++ b/README.md @@ -62,7 +62,27 @@ Bagisto is using power of both of these frameworks and making best out of it out ### 3. Installation & Configuration : -**Execute these Commands Below As In Their Order** +**1. Try our new GUI installer to install the Bagisto** + +#### 1. Download zip from the link below: + +[Bagisto](https://github.com/bagisto/bagisto/archive/v0.1.4.zip) + +#### 2. Extract the contents of zip and execute the project in browser: + +~~~ +http(s)://localhost/bagisto/public +~~~ + +or + +~~~ +http(s)://example.com/public +~~~ + +**2. Try our old fashioned way to install Bagisto** + +***Execute these commands below as in their order*** ~~~ 1. composer create-project bagisto/bagisto @@ -119,15 +139,19 @@ On local: php artisan serve ~~~ -*How to log in as admin* +**How to log in as admin:** -> *http(s)://example.com/admin/login:* +> *http(s)://example.com/admin/login* ~~~ email:admin@example.com password:admin123 ~~~ +**How to log in as customer:** + +*You can directly register as customer and then login.* + > *http(s)://example.com/customer/register* From 9ff7ad1d61be71d032e3fbe43a3d0cff37e1bab5 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:17:42 +0530 Subject: [PATCH 05/28] installer description added in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d99cb7cd1..15b6b3e50 100755 --- a/README.md +++ b/README.md @@ -64,11 +64,11 @@ Bagisto is using power of both of these frameworks and making best out of it out **1. Try our new GUI installer to install the Bagisto** -#### 1. Download zip from the link below: +##### 1. Download zip from the link below: [Bagisto](https://github.com/bagisto/bagisto/archive/v0.1.4.zip) -#### 2. Extract the contents of zip and execute the project in browser: +##### 2. Extract the contents of zip and execute the project in browser: ~~~ http(s)://localhost/bagisto/public From 3870102a5093d2c3fbe354ba1a33927ee2fa2547 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:21:47 +0530 Subject: [PATCH 06/28] made more cometic changes in readme --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 15b6b3e50..714cbf254 100755 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Bagisto is using power of both of these frameworks and making best out of it out ### 3. Installation & Configuration : -**1. Try our new GUI installer to install the Bagisto** +**1. Try our new GUI installer to install the Bagisto:** ##### 1. Download zip from the link below: @@ -80,7 +80,7 @@ or http(s)://example.com/public ~~~ -**2. Try our old fashioned way to install Bagisto** +**2. Try our old fashioned way to install Bagisto:** ***Execute these commands below as in their order*** @@ -125,20 +125,22 @@ Although, mailer environment variables are also required to be set up as **Bagis 6. composer dump-autoload ~~~ -To execute **Bagisto**: -On server: +**To execute Bagisto**: + +**On server:** ~~~ Open the specified entry point in your hosts file in browser or make entry in hosts file if not done. ~~~ -On local: +**On local:** ~~~ php artisan serve ~~~ + **How to log in as admin:** > *http(s)://example.com/admin/login* From b7917350ed8ad3a26a3da2f4ecce19637184491a Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:23:21 +0530 Subject: [PATCH 07/28] updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 714cbf254..3a8d45339 100755 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ http(s)://example.com/public **2. Try our old fashioned way to install Bagisto:** -***Execute these commands below as in their order*** +#### Execute these commands below as in their order ~~~ 1. composer create-project bagisto/bagisto From 3a83be0980d245c42df583cda327cc6df06e4475 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:25:10 +0530 Subject: [PATCH 08/28] updated readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3a8d45339..deaa3aed8 100755 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Bagisto is using power of both of these frameworks and making best out of it out ### 3. Installation & Configuration : -**1. Try our new GUI installer to install the Bagisto:** +**1. Try our new GUI installer to install Bagisto:** ##### 1. Download zip from the link below: @@ -82,13 +82,13 @@ http(s)://example.com/public **2. Try our old fashioned way to install Bagisto:** -#### Execute these commands below as in their order +##### Execute these commands below as in their order ~~~ 1. composer create-project bagisto/bagisto ~~~ -**Now configure your database** +**Now configure your database:** If the above command was completed successfully, then you'll find directory **bagisto** and all of the code will be inside it. @@ -128,13 +128,13 @@ Although, mailer environment variables are also required to be set up as **Bagis **To execute Bagisto**: -**On server:** +#####On server: ~~~ Open the specified entry point in your hosts file in browser or make entry in hosts file if not done. ~~~ -**On local:** +#####On local: ~~~ php artisan serve From ad0a61ac71c454de7bca4a06ab1fe6a8ef2a52fa Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:26:00 +0530 Subject: [PATCH 09/28] updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index deaa3aed8..b1c0a8e40 100755 --- a/README.md +++ b/README.md @@ -128,13 +128,13 @@ Although, mailer environment variables are also required to be set up as **Bagis **To execute Bagisto**: -#####On server: +##### On server: ~~~ Open the specified entry point in your hosts file in browser or make entry in hosts file if not done. ~~~ -#####On local: +##### On local: ~~~ php artisan serve From 0406f8d8ba4322e2b0a95812ffe848cb687ca666 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Tue, 5 Feb 2019 18:28:03 +0530 Subject: [PATCH 10/28] updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b1c0a8e40..afc63901c 100755 --- a/README.md +++ b/README.md @@ -64,11 +64,11 @@ Bagisto is using power of both of these frameworks and making best out of it out **1. Try our new GUI installer to install Bagisto:** -##### 1. Download zip from the link below: +##### a. Download zip from the link below: [Bagisto](https://github.com/bagisto/bagisto/archive/v0.1.4.zip) -##### 2. Extract the contents of zip and execute the project in browser: +##### b. Extract the contents of zip and execute the project in browser: ~~~ http(s)://localhost/bagisto/public From 437548f5333fe0ac4b17371721af2659b79ca5d6 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 6 Feb 2019 14:02:36 +0530 Subject: [PATCH 11/28] minor updates in installer --- public/installer/AdminConfig.php | 2 +- public/installer/Classes/Requirement.php | 37 ++++++++++++------------ public/installer/Environment.php | 6 ++-- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/public/installer/AdminConfig.php b/public/installer/AdminConfig.php index b492a27e4..fc9769197 100755 --- a/public/installer/AdminConfig.php +++ b/public/installer/AdminConfig.php @@ -97,7 +97,7 @@ $data = array(); $conn->close(); } else { - $data['support_error'] = 'It only support mysql Database Connection.If You still want to continue, press OK otherwise change your database connection'; + $data['support_error'] = 'Bagisto currently support MySQL only. Press OK to still continue or change you DB connection to MySQL'; } // if there are no errors process our form, then return a message diff --git a/public/installer/Classes/Requirement.php b/public/installer/Classes/Requirement.php index f961df41d..7c2d42fe2 100755 --- a/public/installer/Classes/Requirement.php +++ b/public/installer/Classes/Requirement.php @@ -20,9 +20,9 @@ class Requirement { 'JSON', 'cURL', ], - 'apache' => [ - 'mod_rewrite', - ] + // 'apache' => [ + // 'mod_rewrite', + // ] ]; $results = []; @@ -43,24 +43,25 @@ class Requirement { $results['errors'] = true; } } - break; + break; + // check apache requirements - case 'apache': - foreach ($requirements[$type] as $requirement) { - // if function doesn't exist we can't check apache modules - if(function_exists('apache_get_modules')) - { - $results['requirements'][$type][$requirement] = true; + // case 'apache': + // foreach ($requirements[$type] as $requirement) { + // // if function doesn't exist we can't check apache modules + // if(function_exists('apache_get_modules')) + // { + // $results['requirements'][$type][$requirement] = true; - if(!in_array($requirement,apache_get_modules())) - { - $results['requirements'][$type][$requirement] = false; + // if(!in_array($requirement,apache_get_modules())) + // { + // $results['requirements'][$type][$requirement] = false; - $results['errors'] = true; - } - } - } - break; + // $results['errors'] = true; + // } + // } + // } + //break; } } diff --git a/public/installer/Environment.php b/public/installer/Environment.php index 5653c9974..9fa35d7e5 100755 --- a/public/installer/Environment.php +++ b/public/installer/Environment.php @@ -22,8 +22,8 @@
-
@@ -71,7 +71,7 @@
From de6507ff08a1d9155f4a3ce284eeaed706d0d9fe Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 6 Feb 2019 16:28:00 +0530 Subject: [PATCH 12/28] Fixed Issue #551 - Root Category Getting Deleted --- packages/Webkul/Admin/src/Resources/lang/en/app.php | 3 ++- .../src/Http/Controllers/CategoryController.php | 12 ++++++++---- .../User/src/Http/Controllers/SessionController.php | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 1ed083603..881faf279 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -763,6 +763,7 @@ return [ 'attribute-error' => ':name is used in configurable products.', 'attribute-product-error' => ':name is used in products.', 'customer-associate' => ':name can not be deleted because customer is associated with this group.', - 'currency-delete-error' => 'This currency is set as channel base currency so it can not be deleted.' + 'currency-delete-error' => 'This currency is set as channel base currency so it can not be deleted.', + 'delete-category-root' => 'Cannot delete the root category' ], ]; \ No newline at end of file diff --git a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php index 59e786257..856395556 100755 --- a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php +++ b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php @@ -137,11 +137,15 @@ class CategoryController extends Controller { Event::fire('catalog.category.delete.before', $id); - $this->category->delete($id); + if(strtolower($this->category->find($id)->name) == "root") { + session()->flash('warning', trans('admin::app.response.delete-category-root', ['name' => 'Category'])); + } else { + session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category'])); - Event::fire('catalog.category.delete.after', $id); + $this->category->delete($id); - session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category'])); + Event::fire('catalog.category.delete.after', $id); + } return redirect()->back(); } @@ -154,7 +158,7 @@ class CategoryController extends Controller public function massDestroy() { $suppressFlash = false; - if (request()->isMethod('delete')) { + if (request()->isMethod('delete') || request()->isMethod('post')) { $indexes = explode(',', request()->input('indexes')); foreach ($indexes as $key => $value) { diff --git a/packages/Webkul/User/src/Http/Controllers/SessionController.php b/packages/Webkul/User/src/Http/Controllers/SessionController.php index 514ec3893..c8282a467 100755 --- a/packages/Webkul/User/src/Http/Controllers/SessionController.php +++ b/packages/Webkul/User/src/Http/Controllers/SessionController.php @@ -46,7 +46,7 @@ class SessionController extends Controller return redirect()->route('admin.dashboard.index'); } else { session()->put('url.intended', url()->previous()); - + return view($this->_config['view']); } From a3a651b570e031603c4e6ec9bfcc3f126a608b5b Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 6 Feb 2019 17:24:06 +0530 Subject: [PATCH 13/28] Changed the default app environment to production for hiding dev dependencies --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index ec44a1259..ec6628b1b 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ APP_NAME=Laravel -APP_ENV=local +APP_ENV=production APP_KEY= APP_DEBUG=true APP_URL=http://localhost From b80d2746af11777a34a9dfe8207c4b18578f284e Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 6 Feb 2019 18:18:15 +0530 Subject: [PATCH 14/28] MariaDB min version added in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index afc63901c..e54896c5b 100755 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ 1. ### [Introduction](#1-introduction-) 2. ### [Requirements](#2-requirements-) 3. ### [Installation & Configuration](#3-installation--configuration-) - 4. ### [License](#4-license-) 5. ### [Miscellaneous](#5-miscellaneous-) @@ -56,7 +55,8 @@ Bagisto is using power of both of these frameworks and making best out of it out * **RAM**: 2 GB or higher. * **PHP**: 7.1.17 or higher. * **Processor**: Clock Cycle 1 Ghz or higher. -* **Mysql**: 5.7.23 or higher. +* **For MySQL users**: 5.7.23 or higher. +* **For MariaDB users**: 10.2.7 or Higher. * **Node**: 8.11.3 LTS or higher. * **Composer**: 1.6.5 or higher. From b1b39d2c7491ffcf5e4c849390a208b559940035 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Wed, 6 Feb 2019 18:49:59 +0530 Subject: [PATCH 15/28] Fixed issue #545 as Admins don't require intended url functionality only customers do --- .../Webkul/User/src/Http/Controllers/SessionController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/Webkul/User/src/Http/Controllers/SessionController.php b/packages/Webkul/User/src/Http/Controllers/SessionController.php index c8282a467..b54159fa4 100755 --- a/packages/Webkul/User/src/Http/Controllers/SessionController.php +++ b/packages/Webkul/User/src/Http/Controllers/SessionController.php @@ -45,11 +45,8 @@ class SessionController extends Controller if (auth()->guard('admin')->check()) { return redirect()->route('admin.dashboard.index'); } else { - session()->put('url.intended', url()->previous()); - return view($this->_config['view']); } - } /** From 69aeb2a25477b2f93aafe720438493fdf0c67291 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 7 Feb 2019 13:58:14 +0530 Subject: [PATCH 16/28] added a function to find the state by code and country code --- packages/Webkul/Core/src/Core.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index 9f75c789e..d82f557ef 100755 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -591,6 +591,24 @@ class Core return $collection; } + /** + * Retrieve all grouped states by country code + * + * @return Collection + */ + public function findStateByCountryCode($countryCode = null, $stateCode = null) + { + $collection = array(); + + $collection = $this->countryStateRepository->findByField(['country_code' => $countryCode, 'code' => $stateCode]); + + if(count($collection)) { + return $collection->first(); + } else { + return false; + } + } + /** * Returns time intervals * From 003f2e0b42edc7eaad520e7f4073a72bfcc3c1a8 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Thu, 7 Feb 2019 15:22:20 +0530 Subject: [PATCH 17/28] updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e54896c5b..bdd552d95 100755 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Bagisto is using power of both of these frameworks and making best out of it out ##### a. Download zip from the link below: -[Bagisto](https://github.com/bagisto/bagisto/archive/v0.1.4.zip) +[Download](https://github.com/bagisto/bagisto/archive/v0.1.4.zip) ##### b. Extract the contents of zip and execute the project in browser: From cd6d6c89a87da07e5abcb32ccec940cca51fe0ca Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 8 Feb 2019 13:02:25 +0530 Subject: [PATCH 18/28] Fixed the issue #555 --- packages/Webkul/Ui/src/Resources/lang/en/app.php | 1 + .../Ui/src/Resources/views/datagrid/table.blade.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Ui/src/Resources/lang/en/app.php b/packages/Webkul/Ui/src/Resources/lang/en/app.php index bbd4c7b89..44e3423c0 100755 --- a/packages/Webkul/Ui/src/Resources/lang/en/app.php +++ b/packages/Webkul/Ui/src/Resources/lang/en/app.php @@ -2,6 +2,7 @@ return [ 'datagrid' => [ 'actions' => 'Actions', + 'id' => 'Index columns have value greater than zero only', 'massaction' => [ 'mass-delete-confirm' => 'Do you really want to delete these selected :resource?', diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php index 3486697af..3189dd275 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php @@ -228,6 +228,7 @@ template: '#datagrid-filters', data: () => ({ + filterIndex: @json($results['index']), gridCurrentData: @json($results['records']), massActions: @json($results['massactions']), massActionsToggle: false, @@ -338,7 +339,15 @@ if (this.type == 'string') { this.formURL(this.columnOrAlias, this.stringCondition, this.stringValue, label) } else if (this.type == 'number') { - this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label); + indexConditions = true; + if (this.filterIndex == this.columnOrAlias && (this.numberValue == 0 || this.numberValue < 0)) { + indexConditions = false; + + alert('index columns can have values greater than zero only'); + } + + if(indexConditions) + this.formURL(this.columnOrAlias, this.numberCondition, this.numberValue, label); } else if (this.type == 'boolean') { this.formURL(this.columnOrAlias, this.booleanCondition, this.booleanValue, label); } else if (this.type == 'datetime') { From af5f039cb93c0c7392a02b774c72ff9444e9a09b Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 8 Feb 2019 15:32:33 +0530 Subject: [PATCH 19/28] category creation fix --- .../Admin/src/Resources/lang/en/app.php | 3 +- .../Http/Controllers/CategoryController.php | 15 +- .../Core/src/Data/currency_symbols.json | 1064 +++++++++++++++++ ...3748_create_currency_code_symbol_table.php | 38 + .../Seeders/CurrenySymbolTableSeeder.php | 18 + .../src/Database/Seeders/DatabaseSeeder.php | 1 + .../Core/src/Models/CurrencyCodeSymbol.php | 11 + 7 files changed, 1148 insertions(+), 2 deletions(-) create mode 100644 packages/Webkul/Core/src/Data/currency_symbols.json create mode 100644 packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php create mode 100644 packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php create mode 100644 packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 881faf279..3638551af 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -764,6 +764,7 @@ return [ 'attribute-product-error' => ':name is used in products.', 'customer-associate' => ':name can not be deleted because customer is associated with this group.', 'currency-delete-error' => 'This currency is set as channel base currency so it can not be deleted.', - 'delete-category-root' => 'Cannot delete the root category' + 'delete-category-root' => 'Cannot delete the root category', + 'create-root-failure' => 'Category with name root already exists' ], ]; \ No newline at end of file diff --git a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php index 856395556..0d727865f 100755 --- a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php +++ b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php @@ -5,6 +5,7 @@ namespace Webkul\Category\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\Response; use Webkul\Category\Repositories\CategoryRepository as Category; +use Webkul\Category\Models\CategoryTranslation; use Illuminate\Support\Facades\Event; /** @@ -74,9 +75,21 @@ class CategoryController extends Controller $this->validate(request(), [ 'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug], 'name' => 'required', - 'image.*' => 'mimes:jpeg,jpg,bmp,png' + 'image.*' => 'mimes:jpeg, jpg, bmp, png' ]); + if (strtolower(request()->input('name')) == 'root') { + $categoryTransalation = new CategoryTranslation(); + + $result = $categoryTransalation->where('name', request()->input('name'))->get(); + + if(count($result) > 0) { + session()->flash('error', trans('admin::app.response.create-root-failure')); + + return redirect()->back(); + } + } + $category = $this->category->create(request()->all()); session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Category'])); diff --git a/packages/Webkul/Core/src/Data/currency_symbols.json b/packages/Webkul/Core/src/Data/currency_symbols.json new file mode 100644 index 000000000..9ead0f85b --- /dev/null +++ b/packages/Webkul/Core/src/Data/currency_symbols.json @@ -0,0 +1,1064 @@ +{ + "USD": { + "symbol": "$", + "name": "US Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "USD", + "name_plural": "US dollars" + }, + "CAD": { + "symbol": "CA$", + "name": "Canadian Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "CAD", + "name_plural": "Canadian dollars" + }, + "EUR": { + "symbol": "€", + "name": "Euro", + "symbol_native": "€", + "decimal_digits": 2, + "rounding": 0, + "code": "EUR", + "name_plural": "euros" + }, + "AED": { + "symbol": "AED", + "name": "United Arab Emirates Dirham", + "symbol_native": "د.إ.‏", + "decimal_digits": 2, + "rounding": 0, + "code": "AED", + "name_plural": "UAE dirhams" + }, + "AFN": { + "symbol": "Af", + "name": "Afghan Afghani", + "symbol_native": "؋", + "decimal_digits": 0, + "rounding": 0, + "code": "AFN", + "name_plural": "Afghan Afghanis" + }, + "ALL": { + "symbol": "ALL", + "name": "Albanian Lek", + "symbol_native": "Lek", + "decimal_digits": 0, + "rounding": 0, + "code": "ALL", + "name_plural": "Albanian lekë" + }, + "AMD": { + "symbol": "AMD", + "name": "Armenian Dram", + "symbol_native": "դր.", + "decimal_digits": 0, + "rounding": 0, + "code": "AMD", + "name_plural": "Armenian drams" + }, + "ARS": { + "symbol": "AR$", + "name": "Argentine Peso", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "ARS", + "name_plural": "Argentine pesos" + }, + "AUD": { + "symbol": "AU$", + "name": "Australian Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "AUD", + "name_plural": "Australian dollars" + }, + "AZN": { + "symbol": "man.", + "name": "Azerbaijani Manat", + "symbol_native": "ман.", + "decimal_digits": 2, + "rounding": 0, + "code": "AZN", + "name_plural": "Azerbaijani manats" + }, + "BAM": { + "symbol": "KM", + "name": "Bosnia-Herzegovina Convertible Mark", + "symbol_native": "KM", + "decimal_digits": 2, + "rounding": 0, + "code": "BAM", + "name_plural": "Bosnia-Herzegovina convertible marks" + }, + "BDT": { + "symbol": "Tk", + "name": "Bangladeshi Taka", + "symbol_native": "৳", + "decimal_digits": 2, + "rounding": 0, + "code": "BDT", + "name_plural": "Bangladeshi takas" + }, + "BGN": { + "symbol": "BGN", + "name": "Bulgarian Lev", + "symbol_native": "лв.", + "decimal_digits": 2, + "rounding": 0, + "code": "BGN", + "name_plural": "Bulgarian leva" + }, + "BHD": { + "symbol": "BD", + "name": "Bahraini Dinar", + "symbol_native": "د.ب.‏", + "decimal_digits": 3, + "rounding": 0, + "code": "BHD", + "name_plural": "Bahraini dinars" + }, + "BIF": { + "symbol": "FBu", + "name": "Burundian Franc", + "symbol_native": "FBu", + "decimal_digits": 0, + "rounding": 0, + "code": "BIF", + "name_plural": "Burundian francs" + }, + "BND": { + "symbol": "BN$", + "name": "Brunei Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "BND", + "name_plural": "Brunei dollars" + }, + "BOB": { + "symbol": "Bs", + "name": "Bolivian Boliviano", + "symbol_native": "Bs", + "decimal_digits": 2, + "rounding": 0, + "code": "BOB", + "name_plural": "Bolivian bolivianos" + }, + "BRL": { + "symbol": "R$", + "name": "Brazilian Real", + "symbol_native": "R$", + "decimal_digits": 2, + "rounding": 0, + "code": "BRL", + "name_plural": "Brazilian reals" + }, + "BWP": { + "symbol": "BWP", + "name": "Botswanan Pula", + "symbol_native": "P", + "decimal_digits": 2, + "rounding": 0, + "code": "BWP", + "name_plural": "Botswanan pulas" + }, + "BYR": { + "symbol": "BYR", + "name": "Belarusian Ruble", + "symbol_native": "BYR", + "decimal_digits": 0, + "rounding": 0, + "code": "BYR", + "name_plural": "Belarusian rubles" + }, + "BZD": { + "symbol": "BZ$", + "name": "Belize Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "BZD", + "name_plural": "Belize dollars" + }, + "CDF": { + "symbol": "CDF", + "name": "Congolese Franc", + "symbol_native": "FrCD", + "decimal_digits": 2, + "rounding": 0, + "code": "CDF", + "name_plural": "Congolese francs" + }, + "CHF": { + "symbol": "CHF", + "name": "Swiss Franc", + "symbol_native": "CHF", + "decimal_digits": 2, + "rounding": 0.05, + "code": "CHF", + "name_plural": "Swiss francs" + }, + "CLP": { + "symbol": "CL$", + "name": "Chilean Peso", + "symbol_native": "$", + "decimal_digits": 0, + "rounding": 0, + "code": "CLP", + "name_plural": "Chilean pesos" + }, + "CNY": { + "symbol": "CN¥", + "name": "Chinese Yuan", + "symbol_native": "CN¥", + "decimal_digits": 2, + "rounding": 0, + "code": "CNY", + "name_plural": "Chinese yuan" + }, + "COP": { + "symbol": "CO$", + "name": "Colombian Peso", + "symbol_native": "$", + "decimal_digits": 0, + "rounding": 0, + "code": "COP", + "name_plural": "Colombian pesos" + }, + "CRC": { + "symbol": "₡", + "name": "Costa Rican Colón", + "symbol_native": "₡", + "decimal_digits": 0, + "rounding": 0, + "code": "CRC", + "name_plural": "Costa Rican colóns" + }, + "CVE": { + "symbol": "CV$", + "name": "Cape Verdean Escudo", + "symbol_native": "CV$", + "decimal_digits": 2, + "rounding": 0, + "code": "CVE", + "name_plural": "Cape Verdean escudos" + }, + "CZK": { + "symbol": "Kč", + "name": "Czech Republic Koruna", + "symbol_native": "Kč", + "decimal_digits": 2, + "rounding": 0, + "code": "CZK", + "name_plural": "Czech Republic korunas" + }, + "DJF": { + "symbol": "Fdj", + "name": "Djiboutian Franc", + "symbol_native": "Fdj", + "decimal_digits": 0, + "rounding": 0, + "code": "DJF", + "name_plural": "Djiboutian francs" + }, + "DKK": { + "symbol": "Dkr", + "name": "Danish Krone", + "symbol_native": "kr", + "decimal_digits": 2, + "rounding": 0, + "code": "DKK", + "name_plural": "Danish kroner" + }, + "DOP": { + "symbol": "RD$", + "name": "Dominican Peso", + "symbol_native": "RD$", + "decimal_digits": 2, + "rounding": 0, + "code": "DOP", + "name_plural": "Dominican pesos" + }, + "DZD": { + "symbol": "DA", + "name": "Algerian Dinar", + "symbol_native": "د.ج.‏", + "decimal_digits": 2, + "rounding": 0, + "code": "DZD", + "name_plural": "Algerian dinars" + }, + "EEK": { + "symbol": "Ekr", + "name": "Estonian Kroon", + "symbol_native": "kr", + "decimal_digits": 2, + "rounding": 0, + "code": "EEK", + "name_plural": "Estonian kroons" + }, + "EGP": { + "symbol": "EGP", + "name": "Egyptian Pound", + "symbol_native": "ج.م.‏", + "decimal_digits": 2, + "rounding": 0, + "code": "EGP", + "name_plural": "Egyptian pounds" + }, + "ERN": { + "symbol": "Nfk", + "name": "Eritrean Nakfa", + "symbol_native": "Nfk", + "decimal_digits": 2, + "rounding": 0, + "code": "ERN", + "name_plural": "Eritrean nakfas" + }, + "ETB": { + "symbol": "Br", + "name": "Ethiopian Birr", + "symbol_native": "Br", + "decimal_digits": 2, + "rounding": 0, + "code": "ETB", + "name_plural": "Ethiopian birrs" + }, + "GBP": { + "symbol": "£", + "name": "British Pound Sterling", + "symbol_native": "£", + "decimal_digits": 2, + "rounding": 0, + "code": "GBP", + "name_plural": "British pounds sterling" + }, + "GEL": { + "symbol": "GEL", + "name": "Georgian Lari", + "symbol_native": "GEL", + "decimal_digits": 2, + "rounding": 0, + "code": "GEL", + "name_plural": "Georgian laris" + }, + "GHS": { + "symbol": "GH₵", + "name": "Ghanaian Cedi", + "symbol_native": "GH₵", + "decimal_digits": 2, + "rounding": 0, + "code": "GHS", + "name_plural": "Ghanaian cedis" + }, + "GNF": { + "symbol": "FG", + "name": "Guinean Franc", + "symbol_native": "FG", + "decimal_digits": 0, + "rounding": 0, + "code": "GNF", + "name_plural": "Guinean francs" + }, + "GTQ": { + "symbol": "GTQ", + "name": "Guatemalan Quetzal", + "symbol_native": "Q", + "decimal_digits": 2, + "rounding": 0, + "code": "GTQ", + "name_plural": "Guatemalan quetzals" + }, + "HKD": { + "symbol": "HK$", + "name": "Hong Kong Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "HKD", + "name_plural": "Hong Kong dollars" + }, + "HNL": { + "symbol": "HNL", + "name": "Honduran Lempira", + "symbol_native": "L", + "decimal_digits": 2, + "rounding": 0, + "code": "HNL", + "name_plural": "Honduran lempiras" + }, + "HRK": { + "symbol": "kn", + "name": "Croatian Kuna", + "symbol_native": "kn", + "decimal_digits": 2, + "rounding": 0, + "code": "HRK", + "name_plural": "Croatian kunas" + }, + "HUF": { + "symbol": "Ft", + "name": "Hungarian Forint", + "symbol_native": "Ft", + "decimal_digits": 0, + "rounding": 0, + "code": "HUF", + "name_plural": "Hungarian forints" + }, + "IDR": { + "symbol": "Rp", + "name": "Indonesian Rupiah", + "symbol_native": "Rp", + "decimal_digits": 0, + "rounding": 0, + "code": "IDR", + "name_plural": "Indonesian rupiahs" + }, + "ILS": { + "symbol": "₪", + "name": "Israeli New Sheqel", + "symbol_native": "₪", + "decimal_digits": 2, + "rounding": 0, + "code": "ILS", + "name_plural": "Israeli new sheqels" + }, + "INR": { + "symbol": "Rs", + "name": "Indian Rupee", + "symbol_native": "টকা", + "decimal_digits": 2, + "rounding": 0, + "code": "INR", + "name_plural": "Indian rupees" + }, + "IQD": { + "symbol": "IQD", + "name": "Iraqi Dinar", + "symbol_native": "د.ع.‏", + "decimal_digits": 0, + "rounding": 0, + "code": "IQD", + "name_plural": "Iraqi dinars" + }, + "IRR": { + "symbol": "IRR", + "name": "Iranian Rial", + "symbol_native": "﷼", + "decimal_digits": 0, + "rounding": 0, + "code": "IRR", + "name_plural": "Iranian rials" + }, + "ISK": { + "symbol": "Ikr", + "name": "Icelandic Króna", + "symbol_native": "kr", + "decimal_digits": 0, + "rounding": 0, + "code": "ISK", + "name_plural": "Icelandic krónur" + }, + "JMD": { + "symbol": "J$", + "name": "Jamaican Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "JMD", + "name_plural": "Jamaican dollars" + }, + "JOD": { + "symbol": "JD", + "name": "Jordanian Dinar", + "symbol_native": "د.أ.‏", + "decimal_digits": 3, + "rounding": 0, + "code": "JOD", + "name_plural": "Jordanian dinars" + }, + "JPY": { + "symbol": "¥", + "name": "Japanese Yen", + "symbol_native": "¥", + "decimal_digits": 0, + "rounding": 0, + "code": "JPY", + "name_plural": "Japanese yen" + }, + "KES": { + "symbol": "Ksh", + "name": "Kenyan Shilling", + "symbol_native": "Ksh", + "decimal_digits": 2, + "rounding": 0, + "code": "KES", + "name_plural": "Kenyan shillings" + }, + "KHR": { + "symbol": "KHR", + "name": "Cambodian Riel", + "symbol_native": "៛", + "decimal_digits": 2, + "rounding": 0, + "code": "KHR", + "name_plural": "Cambodian riels" + }, + "KMF": { + "symbol": "CF", + "name": "Comorian Franc", + "symbol_native": "FC", + "decimal_digits": 0, + "rounding": 0, + "code": "KMF", + "name_plural": "Comorian francs" + }, + "KRW": { + "symbol": "₩", + "name": "South Korean Won", + "symbol_native": "₩", + "decimal_digits": 0, + "rounding": 0, + "code": "KRW", + "name_plural": "South Korean won" + }, + "KWD": { + "symbol": "KD", + "name": "Kuwaiti Dinar", + "symbol_native": "د.ك.‏", + "decimal_digits": 3, + "rounding": 0, + "code": "KWD", + "name_plural": "Kuwaiti dinars" + }, + "KZT": { + "symbol": "KZT", + "name": "Kazakhstani Tenge", + "symbol_native": "тңг.", + "decimal_digits": 2, + "rounding": 0, + "code": "KZT", + "name_plural": "Kazakhstani tenges" + }, + "LBP": { + "symbol": "LB£", + "name": "Lebanese Pound", + "symbol_native": "ل.ل.‏", + "decimal_digits": 0, + "rounding": 0, + "code": "LBP", + "name_plural": "Lebanese pounds" + }, + "LKR": { + "symbol": "SLRs", + "name": "Sri Lankan Rupee", + "symbol_native": "SL Re", + "decimal_digits": 2, + "rounding": 0, + "code": "LKR", + "name_plural": "Sri Lankan rupees" + }, + "LTL": { + "symbol": "Lt", + "name": "Lithuanian Litas", + "symbol_native": "Lt", + "decimal_digits": 2, + "rounding": 0, + "code": "LTL", + "name_plural": "Lithuanian litai" + }, + "LVL": { + "symbol": "Ls", + "name": "Latvian Lats", + "symbol_native": "Ls", + "decimal_digits": 2, + "rounding": 0, + "code": "LVL", + "name_plural": "Latvian lati" + }, + "LYD": { + "symbol": "LD", + "name": "Libyan Dinar", + "symbol_native": "د.ل.‏", + "decimal_digits": 3, + "rounding": 0, + "code": "LYD", + "name_plural": "Libyan dinars" + }, + "MAD": { + "symbol": "MAD", + "name": "Moroccan Dirham", + "symbol_native": "د.م.‏", + "decimal_digits": 2, + "rounding": 0, + "code": "MAD", + "name_plural": "Moroccan dirhams" + }, + "MDL": { + "symbol": "MDL", + "name": "Moldovan Leu", + "symbol_native": "MDL", + "decimal_digits": 2, + "rounding": 0, + "code": "MDL", + "name_plural": "Moldovan lei" + }, + "MGA": { + "symbol": "MGA", + "name": "Malagasy Ariary", + "symbol_native": "MGA", + "decimal_digits": 0, + "rounding": 0, + "code": "MGA", + "name_plural": "Malagasy Ariaries" + }, + "MKD": { + "symbol": "MKD", + "name": "Macedonian Denar", + "symbol_native": "MKD", + "decimal_digits": 2, + "rounding": 0, + "code": "MKD", + "name_plural": "Macedonian denari" + }, + "MMK": { + "symbol": "MMK", + "name": "Myanma Kyat", + "symbol_native": "K", + "decimal_digits": 0, + "rounding": 0, + "code": "MMK", + "name_plural": "Myanma kyats" + }, + "MOP": { + "symbol": "MOP$", + "name": "Macanese Pataca", + "symbol_native": "MOP$", + "decimal_digits": 2, + "rounding": 0, + "code": "MOP", + "name_plural": "Macanese patacas" + }, + "MUR": { + "symbol": "MURs", + "name": "Mauritian Rupee", + "symbol_native": "MURs", + "decimal_digits": 0, + "rounding": 0, + "code": "MUR", + "name_plural": "Mauritian rupees" + }, + "MXN": { + "symbol": "MX$", + "name": "Mexican Peso", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "MXN", + "name_plural": "Mexican pesos" + }, + "MYR": { + "symbol": "RM", + "name": "Malaysian Ringgit", + "symbol_native": "RM", + "decimal_digits": 2, + "rounding": 0, + "code": "MYR", + "name_plural": "Malaysian ringgits" + }, + "MZN": { + "symbol": "MTn", + "name": "Mozambican Metical", + "symbol_native": "MTn", + "decimal_digits": 2, + "rounding": 0, + "code": "MZN", + "name_plural": "Mozambican meticals" + }, + "NAD": { + "symbol": "N$", + "name": "Namibian Dollar", + "symbol_native": "N$", + "decimal_digits": 2, + "rounding": 0, + "code": "NAD", + "name_plural": "Namibian dollars" + }, + "NGN": { + "symbol": "₦", + "name": "Nigerian Naira", + "symbol_native": "₦", + "decimal_digits": 2, + "rounding": 0, + "code": "NGN", + "name_plural": "Nigerian nairas" + }, + "NIO": { + "symbol": "C$", + "name": "Nicaraguan Córdoba", + "symbol_native": "C$", + "decimal_digits": 2, + "rounding": 0, + "code": "NIO", + "name_plural": "Nicaraguan córdobas" + }, + "NOK": { + "symbol": "Nkr", + "name": "Norwegian Krone", + "symbol_native": "kr", + "decimal_digits": 2, + "rounding": 0, + "code": "NOK", + "name_plural": "Norwegian kroner" + }, + "NPR": { + "symbol": "NPRs", + "name": "Nepalese Rupee", + "symbol_native": "नेरू", + "decimal_digits": 2, + "rounding": 0, + "code": "NPR", + "name_plural": "Nepalese rupees" + }, + "NZD": { + "symbol": "NZ$", + "name": "New Zealand Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "NZD", + "name_plural": "New Zealand dollars" + }, + "OMR": { + "symbol": "OMR", + "name": "Omani Rial", + "symbol_native": "ر.ع.‏", + "decimal_digits": 3, + "rounding": 0, + "code": "OMR", + "name_plural": "Omani rials" + }, + "PAB": { + "symbol": "B/.", + "name": "Panamanian Balboa", + "symbol_native": "B/.", + "decimal_digits": 2, + "rounding": 0, + "code": "PAB", + "name_plural": "Panamanian balboas" + }, + "PEN": { + "symbol": "S/.", + "name": "Peruvian Nuevo Sol", + "symbol_native": "S/.", + "decimal_digits": 2, + "rounding": 0, + "code": "PEN", + "name_plural": "Peruvian nuevos soles" + }, + "PHP": { + "symbol": "₱", + "name": "Philippine Peso", + "symbol_native": "₱", + "decimal_digits": 2, + "rounding": 0, + "code": "PHP", + "name_plural": "Philippine pesos" + }, + "PKR": { + "symbol": "PKRs", + "name": "Pakistani Rupee", + "symbol_native": "₨", + "decimal_digits": 0, + "rounding": 0, + "code": "PKR", + "name_plural": "Pakistani rupees" + }, + "PLN": { + "symbol": "zł", + "name": "Polish Zloty", + "symbol_native": "zł", + "decimal_digits": 2, + "rounding": 0, + "code": "PLN", + "name_plural": "Polish zlotys" + }, + "PYG": { + "symbol": "₲", + "name": "Paraguayan Guarani", + "symbol_native": "₲", + "decimal_digits": 0, + "rounding": 0, + "code": "PYG", + "name_plural": "Paraguayan guaranis" + }, + "QAR": { + "symbol": "QR", + "name": "Qatari Rial", + "symbol_native": "ر.ق.‏", + "decimal_digits": 2, + "rounding": 0, + "code": "QAR", + "name_plural": "Qatari rials" + }, + "RON": { + "symbol": "RON", + "name": "Romanian Leu", + "symbol_native": "RON", + "decimal_digits": 2, + "rounding": 0, + "code": "RON", + "name_plural": "Romanian lei" + }, + "RSD": { + "symbol": "din.", + "name": "Serbian Dinar", + "symbol_native": "дин.", + "decimal_digits": 0, + "rounding": 0, + "code": "RSD", + "name_plural": "Serbian dinars" + }, + "RUB": { + "symbol": "RUB", + "name": "Russian Ruble", + "symbol_native": "руб.", + "decimal_digits": 2, + "rounding": 0, + "code": "RUB", + "name_plural": "Russian rubles" + }, + "RWF": { + "symbol": "RWF", + "name": "Rwandan Franc", + "symbol_native": "FR", + "decimal_digits": 0, + "rounding": 0, + "code": "RWF", + "name_plural": "Rwandan francs" + }, + "SAR": { + "symbol": "SR", + "name": "Saudi Riyal", + "symbol_native": "ر.س.‏", + "decimal_digits": 2, + "rounding": 0, + "code": "SAR", + "name_plural": "Saudi riyals" + }, + "SDG": { + "symbol": "SDG", + "name": "Sudanese Pound", + "symbol_native": "SDG", + "decimal_digits": 2, + "rounding": 0, + "code": "SDG", + "name_plural": "Sudanese pounds" + }, + "SEK": { + "symbol": "Skr", + "name": "Swedish Krona", + "symbol_native": "kr", + "decimal_digits": 2, + "rounding": 0, + "code": "SEK", + "name_plural": "Swedish kronor" + }, + "SGD": { + "symbol": "S$", + "name": "Singapore Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "SGD", + "name_plural": "Singapore dollars" + }, + "SOS": { + "symbol": "Ssh", + "name": "Somali Shilling", + "symbol_native": "Ssh", + "decimal_digits": 0, + "rounding": 0, + "code": "SOS", + "name_plural": "Somali shillings" + }, + "SYP": { + "symbol": "SY£", + "name": "Syrian Pound", + "symbol_native": "ل.س.‏", + "decimal_digits": 0, + "rounding": 0, + "code": "SYP", + "name_plural": "Syrian pounds" + }, + "THB": { + "symbol": "฿", + "name": "Thai Baht", + "symbol_native": "฿", + "decimal_digits": 2, + "rounding": 0, + "code": "THB", + "name_plural": "Thai baht" + }, + "TND": { + "symbol": "DT", + "name": "Tunisian Dinar", + "symbol_native": "د.ت.‏", + "decimal_digits": 3, + "rounding": 0, + "code": "TND", + "name_plural": "Tunisian dinars" + }, + "TOP": { + "symbol": "T$", + "name": "Tongan Paʻanga", + "symbol_native": "T$", + "decimal_digits": 2, + "rounding": 0, + "code": "TOP", + "name_plural": "Tongan paʻanga" + }, + "TRY": { + "symbol": "TL", + "name": "Turkish Lira", + "symbol_native": "TL", + "decimal_digits": 2, + "rounding": 0, + "code": "TRY", + "name_plural": "Turkish Lira" + }, + "TTD": { + "symbol": "TT$", + "name": "Trinidad and Tobago Dollar", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "TTD", + "name_plural": "Trinidad and Tobago dollars" + }, + "TWD": { + "symbol": "NT$", + "name": "New Taiwan Dollar", + "symbol_native": "NT$", + "decimal_digits": 2, + "rounding": 0, + "code": "TWD", + "name_plural": "New Taiwan dollars" + }, + "TZS": { + "symbol": "TSh", + "name": "Tanzanian Shilling", + "symbol_native": "TSh", + "decimal_digits": 0, + "rounding": 0, + "code": "TZS", + "name_plural": "Tanzanian shillings" + }, + "UAH": { + "symbol": "₴", + "name": "Ukrainian Hryvnia", + "symbol_native": "₴", + "decimal_digits": 2, + "rounding": 0, + "code": "UAH", + "name_plural": "Ukrainian hryvnias" + }, + "UGX": { + "symbol": "USh", + "name": "Ugandan Shilling", + "symbol_native": "USh", + "decimal_digits": 0, + "rounding": 0, + "code": "UGX", + "name_plural": "Ugandan shillings" + }, + "UYU": { + "symbol": "$U", + "name": "Uruguayan Peso", + "symbol_native": "$", + "decimal_digits": 2, + "rounding": 0, + "code": "UYU", + "name_plural": "Uruguayan pesos" + }, + "UZS": { + "symbol": "UZS", + "name": "Uzbekistan Som", + "symbol_native": "UZS", + "decimal_digits": 0, + "rounding": 0, + "code": "UZS", + "name_plural": "Uzbekistan som" + }, + "VEF": { + "symbol": "Bs.F.", + "name": "Venezuelan Bolívar", + "symbol_native": "Bs.F.", + "decimal_digits": 2, + "rounding": 0, + "code": "VEF", + "name_plural": "Venezuelan bolívars" + }, + "VND": { + "symbol": "₫", + "name": "Vietnamese Dong", + "symbol_native": "₫", + "decimal_digits": 0, + "rounding": 0, + "code": "VND", + "name_plural": "Vietnamese dong" + }, + "XAF": { + "symbol": "FCFA", + "name": "CFA Franc BEAC", + "symbol_native": "FCFA", + "decimal_digits": 0, + "rounding": 0, + "code": "XAF", + "name_plural": "CFA francs BEAC" + }, + "XOF": { + "symbol": "CFA", + "name": "CFA Franc BCEAO", + "symbol_native": "CFA", + "decimal_digits": 0, + "rounding": 0, + "code": "XOF", + "name_plural": "CFA francs BCEAO" + }, + "YER": { + "symbol": "YR", + "name": "Yemeni Rial", + "symbol_native": "ر.ي.‏", + "decimal_digits": 0, + "rounding": 0, + "code": "YER", + "name_plural": "Yemeni rials" + }, + "ZAR": { + "symbol": "R", + "name": "South African Rand", + "symbol_native": "R", + "decimal_digits": 2, + "rounding": 0, + "code": "ZAR", + "name_plural": "South African rand" + }, + "ZMK": { + "symbol": "ZK", + "name": "Zambian Kwacha", + "symbol_native": "ZK", + "decimal_digits": 0, + "rounding": 0, + "code": "ZMK", + "name_plural": "Zambian kwachas" + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php b/packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php new file mode 100644 index 000000000..da97e3c60 --- /dev/null +++ b/packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php @@ -0,0 +1,38 @@ +increments('id'); + $table->string('symbol')->nullable(); + $table->string('name')->nullable(); + $table->string('symbol_native')->nullable(); + $table->string('decimal_digits')->nullable(); + $table->string('rounding')->nullable(); + $table->string('code')->nullable(); + $table->string('name_plural')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('currency_code_symbol'); + } +} diff --git a/packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php b/packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php new file mode 100644 index 000000000..66ba6c885 --- /dev/null +++ b/packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php @@ -0,0 +1,18 @@ +delete(); + + $currencies = json_decode(file_get_contents(__DIR__ . '/../../Data/currency_symbols.json'), true); + + DB::table('currency_code_symbol')->insert($currencies); + } +} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php index 919a033ef..e3dee9748 100755 --- a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php @@ -15,6 +15,7 @@ class DatabaseSeeder extends Seeder { $this->call(LocalesTableSeeder::class); $this->call(CurrencyTableSeeder::class); + $this->call(CurrenySymbolTableSeeder::class); $this->call(CountriesTableSeeder::class); $this->call(StatesTableSeeder::class); $this->call(ChannelTableSeeder::class); diff --git a/packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php b/packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php new file mode 100644 index 000000000..d16a46354 --- /dev/null +++ b/packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php @@ -0,0 +1,11 @@ + Date: Fri, 8 Feb 2019 15:44:00 +0530 Subject: [PATCH 20/28] Disapproved functionality for customer review implemented --- .../Admin/src/DataGrids/CustomerReviewDataGrid.php | 2 ++ packages/Webkul/Admin/src/Resources/lang/en/app.php | 3 ++- .../views/customers/reviews/edit.blade.php | 13 +++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index 0937531ed..3e83d295b 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -76,6 +76,8 @@ class CustomerReviewDataGrid extends DataGrid return 'Approved'; else if ($value->product_review_status == "pending") return 'Pending'; + else if ($value->product_review_status == "disapproved") + return 'Disapproved'; }, ]); } diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index 3638551af..dfecde79e 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -701,7 +701,8 @@ return [ 'status' => 'Status', 'comment' => 'Comment', 'pending' => 'Pending', - 'approved' => 'Approved' + 'approved' => 'Approve', + 'disapproved' => 'Disapprove' ], 'subscribers' => [ diff --git a/packages/Webkul/Admin/src/Resources/views/customers/reviews/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/customers/reviews/edit.blade.php index 43d6a3ae6..33f882d23 100755 --- a/packages/Webkul/Admin/src/Resources/views/customers/reviews/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/customers/reviews/edit.blade.php @@ -12,7 +12,7 @@

- + {{ __('admin::app.customers.reviews.edit-title') }}

@@ -51,12 +51,17 @@
From 4661e5b738b84d16866e432ccd1e231d20816baa Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 8 Feb 2019 15:46:43 +0530 Subject: [PATCH 21/28] mass updated for product review updated for customer review datagrid --- .../Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php | 5 +++-- .../Webkul/Product/src/Http/Controllers/ReviewController.php | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php index 3e83d295b..e7626b969 100755 --- a/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/CustomerReviewDataGrid.php @@ -110,8 +110,9 @@ class CustomerReviewDataGrid extends DataGrid 'action' => route('admin.customer.review.massupdate'), 'method' => 'PUT', 'options' => [ - 'Disapprove' => 0, - 'Approve' => 1 + 'Pending' => 0, + 'Approve' => 1, + 'Disapprove' => 2 ] ]); } diff --git a/packages/Webkul/Product/src/Http/Controllers/ReviewController.php b/packages/Webkul/Product/src/Http/Controllers/ReviewController.php index 0e93fd66c..ca2a85b6b 100755 --- a/packages/Webkul/Product/src/Http/Controllers/ReviewController.php +++ b/packages/Webkul/Product/src/Http/Controllers/ReviewController.php @@ -183,6 +183,8 @@ class ReviewController extends Controller Event::fire('customer.review.update.after', $review); } else if ($data['update-options'] == 0) { $review->update(['status' => 'pending']); + } else if ($data['update-options'] == 2) { + $review->update(['status' => 'disapproved']); } else { continue; } From b72123db513f1ba7c445d3b62560d3348befa227 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 8 Feb 2019 16:05:50 +0530 Subject: [PATCH 22/28] Currency symbol table implemented with relationship with currency as a fallback if the symbol for the currency is not found --- packages/Webkul/Core/src/Models/Currency.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/Webkul/Core/src/Models/Currency.php b/packages/Webkul/Core/src/Models/Currency.php index 481df77da..41319b69a 100755 --- a/packages/Webkul/Core/src/Models/Currency.php +++ b/packages/Webkul/Core/src/Models/Currency.php @@ -4,6 +4,7 @@ namespace Webkul\Core\Models; use Illuminate\Database\Eloquent\Model; use Webkul\Core\Models\CurrencyExchangeRate; +use Webkul\Core\Models\CurrencyCodeSymbol; class Currency extends Model { @@ -23,4 +24,8 @@ class Currency extends Model { return $this->hasOne(CurrencyExchangeRate::class, 'target_currency'); } + + public function getCurrencySymbol() { + return $this->hasOne(CurrencyCodeSymbol::class, 'code', 'code'); + } } \ No newline at end of file From fa8aa2f66e8a9c91c933819181c4b96868439e46 Mon Sep 17 00:00:00 2001 From: jitendra Date: Mon, 11 Feb 2019 13:03:17 +0530 Subject: [PATCH 23/28] Issue #556 fixed' --- .../Shop/src/Resources/views/checkout/total/summary.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php index 4a3632d68..941772b4c 100755 --- a/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/total/summary.blade.php @@ -13,7 +13,7 @@ @if ($cart->selected_shipping_rate)
- +
@endif From e4dc9da03fbefb9978bed64a105e29053313a230 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Mon, 11 Feb 2019 13:19:49 +0530 Subject: [PATCH 24/28] Removed the currency symbol table migration and seeder --- .env.example | 2 +- ...3748_create_currency_code_symbol_table.php | 38 ------------------- .../Seeders/CurrenySymbolTableSeeder.php | 18 --------- .../Core/src/Models/CurrencyCodeSymbol.php | 11 ------ 4 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php delete mode 100644 packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php delete mode 100644 packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php diff --git a/.env.example b/.env.example index ec6628b1b..ec44a1259 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ APP_NAME=Laravel -APP_ENV=production +APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost diff --git a/packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php b/packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php deleted file mode 100644 index da97e3c60..000000000 --- a/packages/Webkul/Core/src/Database/Migrations/2019_02_08_133748_create_currency_code_symbol_table.php +++ /dev/null @@ -1,38 +0,0 @@ -increments('id'); - $table->string('symbol')->nullable(); - $table->string('name')->nullable(); - $table->string('symbol_native')->nullable(); - $table->string('decimal_digits')->nullable(); - $table->string('rounding')->nullable(); - $table->string('code')->nullable(); - $table->string('name_plural')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('currency_code_symbol'); - } -} diff --git a/packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php b/packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php deleted file mode 100644 index 66ba6c885..000000000 --- a/packages/Webkul/Core/src/Database/Seeders/CurrenySymbolTableSeeder.php +++ /dev/null @@ -1,18 +0,0 @@ -delete(); - - $currencies = json_decode(file_get_contents(__DIR__ . '/../../Data/currency_symbols.json'), true); - - DB::table('currency_code_symbol')->insert($currencies); - } -} \ No newline at end of file diff --git a/packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php b/packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php deleted file mode 100644 index d16a46354..000000000 --- a/packages/Webkul/Core/src/Models/CurrencyCodeSymbol.php +++ /dev/null @@ -1,11 +0,0 @@ - Date: Mon, 11 Feb 2019 13:31:05 +0530 Subject: [PATCH 25/28] Dead code removed from currency seeder and model --- packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php | 1 - packages/Webkul/Core/src/Models/Currency.php | 5 ----- 2 files changed, 6 deletions(-) diff --git a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php index e3dee9748..919a033ef 100755 --- a/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Webkul/Core/src/Database/Seeders/DatabaseSeeder.php @@ -15,7 +15,6 @@ class DatabaseSeeder extends Seeder { $this->call(LocalesTableSeeder::class); $this->call(CurrencyTableSeeder::class); - $this->call(CurrenySymbolTableSeeder::class); $this->call(CountriesTableSeeder::class); $this->call(StatesTableSeeder::class); $this->call(ChannelTableSeeder::class); diff --git a/packages/Webkul/Core/src/Models/Currency.php b/packages/Webkul/Core/src/Models/Currency.php index 41319b69a..481df77da 100755 --- a/packages/Webkul/Core/src/Models/Currency.php +++ b/packages/Webkul/Core/src/Models/Currency.php @@ -4,7 +4,6 @@ namespace Webkul\Core\Models; use Illuminate\Database\Eloquent\Model; use Webkul\Core\Models\CurrencyExchangeRate; -use Webkul\Core\Models\CurrencyCodeSymbol; class Currency extends Model { @@ -24,8 +23,4 @@ class Currency extends Model { return $this->hasOne(CurrencyExchangeRate::class, 'target_currency'); } - - public function getCurrencySymbol() { - return $this->hasOne(CurrencyCodeSymbol::class, 'code', 'code'); - } } \ No newline at end of file From 2b382df075f8aa2cc7fc0f485cd75fb96ef1728c Mon Sep 17 00:00:00 2001 From: jitendra Date: Mon, 11 Feb 2019 15:02:34 +0530 Subject: [PATCH 26/28] Issue #532 fixed --- packages/Webkul/Product/src/Repositories/ProductRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index fbf544a2a..13c6c3975 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -470,7 +470,7 @@ class ProductRepository extends Repository } }); - return $qb; + return $qb->groupBy('product_flat.id'); })->paginate(isset($params['limit']) ? $params['limit'] : 9); return $results; From b32cff235960ee8fbfe1f3f03f1cdeeefaea3168 Mon Sep 17 00:00:00 2001 From: jitendra Date: Mon, 11 Feb 2019 15:10:47 +0530 Subject: [PATCH 27/28] Installer issue fixed --- public/installer/install.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/installer/install.php b/public/installer/install.php index c763cf083..dc9ce0a90 100755 --- a/public/installer/install.php +++ b/public/installer/install.php @@ -11,12 +11,13 @@ if (file_exists($envFile)) { // reading env content - $str= file_get_contents($envFile); + $str = file_get_contents($envFile); // converting env content to key/value pair $data = explode(PHP_EOL,$str); $databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION']; + $key = $value = []; if ($data) { foreach ($data as $line) { $rowValues = explode('=', $line); From 7bfb216bb01458bc81fcdcee749f13772a0ed24f Mon Sep 17 00:00:00 2001 From: jitendra Date: Mon, 11 Feb 2019 15:13:38 +0530 Subject: [PATCH 28/28] Dashboard sql issue fixed --- .../Webkul/Admin/src/Http/Controllers/DashboardController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php index 216ad02c4..ca55db876 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php @@ -215,7 +215,7 @@ class DashboardController extends Controller ->addSelect(DB::raw('SUM(qty_ordered) as total_qty_ordered')) ->addSelect(DB::raw('COUNT(products.id) as total_products')) ->addSelect('order_items.id', 'categories.id as category_id', 'category_translations.name') - ->groupBy('category_id') + ->groupBy('categories.id') ->orderBy('total_qty_ordered', 'DESC') ->limit(5) ->get();