From 4c21d8ead60ff5fa39704a47ad28f35d8c8699d2 Mon Sep 17 00:00:00 2001 From: jitendra Date: Wed, 21 Nov 2018 16:44:07 +0530 Subject: [PATCH 1/7] Issues #134 fixed and Inventory source add/edit validation issue fixed --- .../common/create-country-state.blade.php | 25 --------- .../views/common/edit-country-state.blade.php | 28 ---------- .../inventory_sources/create.blade.php | 51 ++++++++++--------- .../settings/inventory_sources/edit.blade.php | 44 +++++++++------- packages/Webkul/Checkout/src/Cart.php | 3 +- ...411_create_cart_item_inventories_table.php | 34 +++++++++++++ ..._110040_create_inventory_sources_table.php | 16 +++--- .../Database/Seeders/InventoryTableSeeder.php | 8 +++ .../Controllers/InventorySourceController.php | 24 +++++++-- .../Http/Controllers/AccountController.php | 2 + .../src/Http/Controllers/UserController.php | 9 +++- 11 files changed, 133 insertions(+), 111 deletions(-) delete mode 100644 packages/Webkul/Admin/src/Resources/views/common/create-country-state.blade.php delete mode 100644 packages/Webkul/Admin/src/Resources/views/common/edit-country-state.blade.php create mode 100644 packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php diff --git a/packages/Webkul/Admin/src/Resources/views/common/create-country-state.blade.php b/packages/Webkul/Admin/src/Resources/views/common/create-country-state.blade.php deleted file mode 100644 index 7dbf7505b..000000000 --- a/packages/Webkul/Admin/src/Resources/views/common/create-country-state.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -
- - -
- -
- - -
- -@push('scripts') - - - -@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/common/edit-country-state.blade.php b/packages/Webkul/Admin/src/Resources/views/common/edit-country-state.blade.php deleted file mode 100644 index 0e9856886..000000000 --- a/packages/Webkul/Admin/src/Resources/views/common/edit-country-state.blade.php +++ /dev/null @@ -1,28 +0,0 @@ -
- country ?> - - - - -
- -
- - -
- -@push('scripts') - - - -@endpush \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php index fc4c9c493..6460692e3 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/create.blade.php @@ -74,24 +74,27 @@
-
- - +
+ + + @{{ errors.first('contact_name') }}
-
- - +
+ + + @{{ errors.first('contact_email') }}
-
- - +
+ + + @{{ errors.first('contact_number') }}
- +
@@ -100,26 +103,24 @@
- @include ('admin::common.create-country-state') + @include ('admin::customers.country-state', ['countryCode' => old('country'), 'stateCode' => old('state')]) -
- - +
+ + + @{{ errors.first('city') }}
-
- - +
+ + + @{{ errors.first('street') }}
-
- - -
- -
- - +
+ + + @{{ errors.first('postcode') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php index 71b752595..e1c7010a4 100644 --- a/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/settings/inventory_sources/edit.blade.php @@ -75,19 +75,22 @@
-
- - +
+ + + @{{ errors.first('contact_name') }}
-
- - +
+ + + @{{ errors.first('contact_email') }}
-
- - +
+ + + @{{ errors.first('contact_number') }}
@@ -101,21 +104,24 @@
- @include ('admin::common.edit-country-state', ['model' => $inventorySource]) + @include ('admin::customers.country-state', ['countryCode' => old('country') ?? $inventorySource->country, 'stateCode' => old('state') ?? $inventorySource->state]) -
- - +
+ + + @{{ errors.first('city') }}
-
- - +
+ + + @{{ errors.first('street') }}
-
- - +
+ + + @{{ errors.first('postcode') }}
diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index f3db9139d..ce1bcb055 100644 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -737,7 +737,8 @@ class Cart { * * @return boolean */ - public function validateItems() { + public function validateItems() + { $cart = $this->getCart(); //rare case of accident-->used when there are no items. diff --git a/packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php b/packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php new file mode 100644 index 000000000..f1f9418d9 --- /dev/null +++ b/packages/Webkul/Checkout/src/Database/Migrations/2018_11_21_144411_create_cart_item_inventories_table.php @@ -0,0 +1,34 @@ +increments('id'); + $table->integer('qty')->default(0); + $table->integer('inventory_source_id')->unsigned()->nullable(); + $table->integer('cart_item_id')->unsigned()->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cart_item_inventories'); + } +} diff --git a/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php b/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php index 01f3a947e..8a717dbaa 100644 --- a/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php +++ b/packages/Webkul/Inventory/src/Database/Migrations/2018_07_23_110040_create_inventory_sources_table.php @@ -18,15 +18,15 @@ class CreateInventorySourcesTable extends Migration $table->string('code')->unique(); $table->string('name'); $table->text('description')->nullable(); - $table->string('contact_name')->nullable(); - $table->string('contact_email')->nullable(); - $table->string('contact_number')->nullable(); + $table->string('contact_name'); + $table->string('contact_email'); + $table->string('contact_number'); $table->string('contact_fax')->nullable(); - $table->string('country')->nullable(); - $table->string('state')->nullable(); - $table->string('city')->nullable(); - $table->string('street')->nullable(); - $table->string('postcode')->nullable(); + $table->string('country'); + $table->string('state'); + $table->string('city'); + $table->string('street'); + $table->string('postcode'); $table->integer('priority')->default(0); $table->decimal('latitude', 10, 5)->nullable(); $table->decimal('longitude', 10, 5)->nullable(); diff --git a/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php b/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php index 7ae3ee6f8..e5493fcde 100644 --- a/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php +++ b/packages/Webkul/Inventory/src/Database/Seeders/InventoryTableSeeder.php @@ -15,7 +15,15 @@ class InventoryTableSeeder extends Seeder 'id' => 1, 'code' => 'default', 'name' => 'Default', + 'contact_name' => 'Detroit Warehouse', + 'contact_email' => 'warehouse@example.com', + 'contact_number' => 1234567899, 'status' => 1, + 'country' => 'US', + 'state' => 'MI', + 'street' => '12th Street', + 'city' => 'Detroit', + 'postcode' => '48127', ]); } } \ No newline at end of file diff --git a/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php b/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php index be70c4ec0..13bdb4e6b 100644 --- a/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php +++ b/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php @@ -69,8 +69,16 @@ class InventorySourceController extends Controller public function store() { $this->validate(request(), [ - 'code' => ['required', 'unique:inventory_sources,code', new \Webkul\Core\Contracts\Validations\Code], - 'name' => 'required' + 'code' => ['required', 'unique:inventory_sources,code', new \Webkul\Core\Contracts\Validations\Code], + 'name' => 'required', + 'contact_name' => 'required', + 'contact_email' => 'required', + 'contact_number' => 'required', + 'street' => 'required', + 'country' => 'required', + 'state' => 'required', + 'city' => 'required', + 'postcode' => 'required' ]); $this->inventorySource->create(request()->all()); @@ -103,8 +111,16 @@ class InventorySourceController extends Controller public function update(Request $request, $id) { $this->validate(request(), [ - 'code' => ['required', 'unique:inventory_sources,code,' . $id, new \Webkul\Core\Contracts\Validations\Code], - 'name' => 'required', + 'code' => ['required', 'unique:inventory_sources,code,' . $id, new \Webkul\Core\Contracts\Validations\Code], + 'name' => 'required', + 'contact_name' => 'required', + 'contact_email' => 'required', + 'contact_number' => 'required', + 'street' => 'required', + 'country' => 'required', + 'state' => 'required', + 'city' => 'required', + 'postcode' => 'required' ]); $this->inventorySource->update(request()->all(), $id); diff --git a/packages/Webkul/User/src/Http/Controllers/AccountController.php b/packages/Webkul/User/src/Http/Controllers/AccountController.php index 94b89fde9..0b4750928 100644 --- a/packages/Webkul/User/src/Http/Controllers/AccountController.php +++ b/packages/Webkul/User/src/Http/Controllers/AccountController.php @@ -60,6 +60,8 @@ class AccountController extends Controller if(!$data['password']) unset($data['password']); + else + $data['password'] = bcrypt($data['password']); $user->update($data); diff --git a/packages/Webkul/User/src/Http/Controllers/UserController.php b/packages/Webkul/User/src/Http/Controllers/UserController.php index f562b793b..e3e3c6392 100644 --- a/packages/Webkul/User/src/Http/Controllers/UserController.php +++ b/packages/Webkul/User/src/Http/Controllers/UserController.php @@ -87,7 +87,12 @@ class UserController extends Controller */ public function store(UserForm $request) { - $this->admin->create(request()->all()); + $data = request()->all(); + + if(isset($data['password']) && $data['password']) + $data['password'] = bcrypt($data['password']); + + $this->admin->create($data); session()->flash('success', 'User created successfully.'); @@ -122,6 +127,8 @@ class UserController extends Controller if(!$data['password']) unset($data['password']); + else + $data['password'] = bcrypt($data['password']); $this->admin->update($data, $id); From 43d0525887cce120630468eb951d883c99394c0e Mon Sep 17 00:00:00 2001 From: Prashant Singh <41140572+prashant-webkul@users.noreply.github.com> Date: Fri, 23 Nov 2018 11:13:46 +0530 Subject: [PATCH 2/7] Update readme visual changes. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 201f8a8a3..95c2c3c7a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png) +                  ![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png) 1. #### Introduction From 67a98e4ad1dcc25054d4c715ee11593bb8be8278 Mon Sep 17 00:00:00 2001 From: Prashant Singh <41140572+prashant-webkul@users.noreply.github.com> Date: Fri, 23 Nov 2018 11:14:30 +0530 Subject: [PATCH 3/7] visual changes in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95c2c3c7a..b7fc5b865 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -                  ![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png) +                       ![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png) 1. #### Introduction From c9f7d61705006d56d1b2b15013e7f0572c1d51e1 Mon Sep 17 00:00:00 2001 From: Prashant Singh <41140572+prashant-webkul@users.noreply.github.com> Date: Fri, 23 Nov 2018 13:57:13 +0530 Subject: [PATCH 4/7] updated readme --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index b7fc5b865..e3ab66a67 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,17 @@ php artisan storage:link > That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. +**Migration from v0.1.0 to v0.1.1** + +**Run commands below:** + +''' +php artisan migrate +''' + +''' +php artisan vendor:publish +''' # License From 75dc0a6ab3ddb3ceeb2ee4af92d46834295668ea Mon Sep 17 00:00:00 2001 From: Prashant Singh <41140572+prashant-webkul@users.noreply.github.com> Date: Fri, 23 Nov 2018 17:35:28 +0530 Subject: [PATCH 5/7] Updated readme with some readability enhancements Updated readme with some readability enhancements and inserted the link for forums. --- README.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e3ab66a67..172010e2d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ 4. #### Configuration -# 1. About Bagisto: +### 1. About Bagisto: [Bagisto](https://www.bagisto.com) is a hand tailored E-Commerce framework designed on some of the hottest opensource technologies such as [Laravel](https://laravel.com) a [PHP](https://secure.php.net/) framework, [Vue.js](https://vuejs.org) @@ -16,6 +16,8 @@ a [Node.js](https://nodejs.org) framework. **Bagisto is viable attempt to cut down your time, cost and workforce for building online stores or migrating from physical stores to the ever demanding online world. Your business whether small or huge it suits all and very simple to set it up.** +**We are also having a forum for any type of your concern, feature request discussions. Please visit: [Bagisto Forums](https://forums.bagisto.com/)** + It packs in lots of demanding features that allows your business to scale in no time: * Multiple Channels, Locale, Currencies. @@ -30,14 +32,13 @@ It packs in lots of demanding features that allows your business to scale in no * Orders Management System. * Customer Cart, Wishlist, Product Reviews. * Simple and Configurable Products. -* check out [more....](https://bagisto.com/features/). +* Check out [more....](https://bagisto.com/features/). **For Developers**: Dev guys can take advantage of two of the hottest frameworks used in this project Laravel and Vue.js, both of these frameworks have been used in Bagisto. Bagisto is using power of both of these frameworks and making best out of it out of the box. - -# 2. Requirements: +### 2. Requirements: * **OS**: Ubuntu 16.04 LTS or higher. * **SERVER**: Apache 2 or NGINX @@ -48,7 +49,7 @@ Bagisto is using power of both of these frameworks and making best out of it out * **Node**: 8.11.3 LTS or higher. * **Composer**: 1.6.5 or higher. -# 3. Configuration: +### 3. Configuration: **Run this Command** to download the project on to your local machine or server: ~~~ @@ -70,7 +71,7 @@ Although you have to set the mailer variables also for full functioning of your default. -# 4.Installation: +### 4.Installation: **1. Run the Command** ~~~ @@ -96,17 +97,14 @@ php artisan storage:link > That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. -**Migration from v0.1.0 to v0.1.1** + +# Migration from v0.1.0 to v0.1.1 **Run commands below:** -''' -php artisan migrate -''' +> **php artisan migrate** -''' -php artisan vendor:publish -''' +> **php artisan vendor:publish** # License From b3c6a04dc9cee8d28208419cc01b1e8c48c8bc46 Mon Sep 17 00:00:00 2001 From: Prashant Singh <41140572+prashant-webkul@users.noreply.github.com> Date: Fri, 23 Nov 2018 18:16:18 +0530 Subject: [PATCH 6/7] updated readme --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 172010e2d..a32b03713 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@                        ![Bagisto Logo](https://bagisto.com/wp-content/themes/bagisto/images/logo.png) -1. #### Introduction -2. #### Requirements -3. #### Installation -4. #### Configuration +# Topics +1. ### Introduction +2. ### Requirements +3. ### Installation +4. ### Configuration +5. ### Migration Guides +6. ### License -### 1. About Bagisto: +### 1. Introduction: [Bagisto](https://www.bagisto.com) is a hand tailored E-Commerce framework designed on some of the hottest opensource technologies such as [Laravel](https://laravel.com) a [PHP](https://secure.php.net/) framework, [Vue.js](https://vuejs.org) @@ -71,7 +74,7 @@ Although you have to set the mailer variables also for full functioning of your default. -### 4.Installation: +### 4. Installation: **1. Run the Command** ~~~ @@ -98,7 +101,7 @@ php artisan storage:link > That's it, now just execute the project on your specified domain entry point pointing to public folder inside installation directory. -# Migration from v0.1.0 to v0.1.1 +### 5. Migration from v0.1.0 to v0.1.1 **Run commands below:** @@ -107,5 +110,5 @@ php artisan storage:link > **php artisan vendor:publish** -# License +### 6. License Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://opensource.org/licenses/MIT). From 52ba991b4e00553b2d9d60af894379988e36d073 Mon Sep 17 00:00:00 2001 From: Prashant Singh <41140572+prashant-webkul@users.noreply.github.com> Date: Sun, 25 Nov 2018 20:45:02 +0530 Subject: [PATCH 7/7] Updated readme.md with coming soon things --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a32b03713..3c5d6dfc7 100644 --- a/README.md +++ b/README.md @@ -112,3 +112,6 @@ php artisan storage:link ### 6. License Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://opensource.org/licenses/MIT). + +### Coming Soon: +-> API support for core and numerous fixes.