From 63d86f5def375e4f7f00ebf7578f43f48ee272d6 Mon Sep 17 00:00:00 2001 From: nikolayandreev Date: Fri, 12 Feb 2021 15:22:38 +0200 Subject: [PATCH 1/7] Update getMaximamPrice() to return product price instead of getMinimalPrice() in AbstractType. Solving issue with Simple products where price and special_price were the same amount in the REST API. --- packages/Webkul/Product/src/Type/AbstractType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index 460dda2dd..adf2f27b4 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -536,7 +536,7 @@ abstract class AbstractType */ public function getMaximamPrice() { - return $this->getMinimalPrice(); + return $this->product->price; } /** From b3e1c63fd3d93c62aeba2eb325ded9f1d4028016 Mon Sep 17 00:00:00 2001 From: nikolayandreev Date: Mon, 15 Feb 2021 12:34:31 +0200 Subject: [PATCH 2/7] Add capability to serach via multiple categoryIds in the REST API --- .../Product/src/Repositories/ProductRepository.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index dbbc10a50..3a686f7e7 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -129,11 +129,11 @@ class ProductRepository extends Repository } /** - * @param int $categoryId + * @param string $categories * * @return \Illuminate\Support\Collection */ - public function getAll($categoryId = null) + public function getAll($categories = null) { $params = request()->input(); @@ -147,7 +147,7 @@ class ProductRepository extends Repository $page = Paginator::resolveCurrentPage('page'); - $repository = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($params, $categoryId) { + $repository = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($params, $categories) { $channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode()); $locale = request()->get('locale') ?: app()->getLocale(); @@ -161,8 +161,8 @@ class ProductRepository extends Repository ->where('product_flat.locale', $locale) ->whereNotNull('product_flat.url_key'); - if ($categoryId) { - $qb->where('product_categories.category_id', $categoryId); + if ($categories) { + $qb->whereIn('product_categories.category_id', explode(',', $categories)); } if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) { From d6398da5c35295ea6ab725e0a7a7334a7bac362c Mon Sep 17 00:00:00 2001 From: nikolayandreev Date: Mon, 15 Feb 2021 12:40:47 +0200 Subject: [PATCH 3/7] Changed ProductController key for API endpoint /products?category_id to /products?categories=1,2,3 or categories=1 --- packages/Webkul/API/Http/Controllers/Shop/ProductController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Webkul/API/Http/Controllers/Shop/ProductController.php b/packages/Webkul/API/Http/Controllers/Shop/ProductController.php index 051982e51..992dc66e6 100755 --- a/packages/Webkul/API/Http/Controllers/Shop/ProductController.php +++ b/packages/Webkul/API/Http/Controllers/Shop/ProductController.php @@ -34,7 +34,7 @@ class ProductController extends Controller */ public function index() { - return ProductResource::collection($this->productRepository->getAll(request()->input('category_id'))); + return ProductResource::collection($this->productRepository->getAll(request()->input('categories'))); } /** From 0f27f5c880ff1e8b9ff001503745513b5d8d8cc2 Mon Sep 17 00:00:00 2001 From: nikolayandreev Date: Mon, 22 Feb 2021 16:38:09 +0200 Subject: [PATCH 4/7] Added back getMinimalPrice in AbstractType --- packages/Webkul/Product/src/Type/AbstractType.php | 2 +- packages/Webkul/Product/src/Type/Downloadable.php | 10 ++++++++++ packages/Webkul/Product/src/Type/Simple.php | 10 ++++++++++ packages/Webkul/Product/src/Type/Virtual.php | 10 ++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index adf2f27b4..460dda2dd 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -536,7 +536,7 @@ abstract class AbstractType */ public function getMaximamPrice() { - return $this->product->price; + return $this->getMinimalPrice(); } /** diff --git a/packages/Webkul/Product/src/Type/Downloadable.php b/packages/Webkul/Product/src/Type/Downloadable.php index d35b2ba69..101df5a8e 100644 --- a/packages/Webkul/Product/src/Type/Downloadable.php +++ b/packages/Webkul/Product/src/Type/Downloadable.php @@ -288,4 +288,14 @@ class Downloadable extends AbstractType return $result; } + + /** + * Get product maximam price + * + * @return float + */ + public function getMaximamPrice() + { + return $this->product->price; + } } diff --git a/packages/Webkul/Product/src/Type/Simple.php b/packages/Webkul/Product/src/Type/Simple.php index 03eb5ccf8..12c25f8cd 100644 --- a/packages/Webkul/Product/src/Type/Simple.php +++ b/packages/Webkul/Product/src/Type/Simple.php @@ -63,4 +63,14 @@ class Simple extends AbstractType return $qty <= $this->totalQuantity() ? true : $backorders; } + + /** + * Get product maximam price + * + * @return float + */ + public function getMaximamPrice() + { + return $this->product->price; + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Type/Virtual.php b/packages/Webkul/Product/src/Type/Virtual.php index 50d5fac91..2c19a393e 100644 --- a/packages/Webkul/Product/src/Type/Virtual.php +++ b/packages/Webkul/Product/src/Type/Virtual.php @@ -71,4 +71,14 @@ class Virtual extends AbstractType { return $qty <= $this->totalQuantity() ? true : false; } + + /** + * Get product maximam price + * + * @return float + */ + public function getMaximamPrice() + { + return $this->product->price; + } } \ No newline at end of file From a3523703946fdb84ac67225c5ca575318e2faa07 Mon Sep 17 00:00:00 2001 From: nikolayandreev Date: Mon, 22 Feb 2021 16:39:19 +0200 Subject: [PATCH 5/7] Progress --- packages/Webkul/Product/src/Type/Simple.php | 2 +- packages/Webkul/Product/src/Type/Virtual.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Product/src/Type/Simple.php b/packages/Webkul/Product/src/Type/Simple.php index 12c25f8cd..100b2a228 100644 --- a/packages/Webkul/Product/src/Type/Simple.php +++ b/packages/Webkul/Product/src/Type/Simple.php @@ -73,4 +73,4 @@ class Simple extends AbstractType { return $this->product->price; } -} \ No newline at end of file +} diff --git a/packages/Webkul/Product/src/Type/Virtual.php b/packages/Webkul/Product/src/Type/Virtual.php index 2c19a393e..f8accd9db 100644 --- a/packages/Webkul/Product/src/Type/Virtual.php +++ b/packages/Webkul/Product/src/Type/Virtual.php @@ -81,4 +81,4 @@ class Virtual extends AbstractType { return $this->product->price; } -} \ No newline at end of file +} From 93a5ec7d56b56a970d02246b7de339b050f3bffd Mon Sep 17 00:00:00 2001 From: nikolayandreev Date: Tue, 23 Feb 2021 13:23:22 +0200 Subject: [PATCH 6/7] Revert the parameter rename, but keep new functionality --- .../API/Http/Controllers/Shop/ProductController.php | 2 +- .../Product/src/Repositories/ProductRepository.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/Webkul/API/Http/Controllers/Shop/ProductController.php b/packages/Webkul/API/Http/Controllers/Shop/ProductController.php index 992dc66e6..051982e51 100755 --- a/packages/Webkul/API/Http/Controllers/Shop/ProductController.php +++ b/packages/Webkul/API/Http/Controllers/Shop/ProductController.php @@ -34,7 +34,7 @@ class ProductController extends Controller */ public function index() { - return ProductResource::collection($this->productRepository->getAll(request()->input('categories'))); + return ProductResource::collection($this->productRepository->getAll(request()->input('category_id'))); } /** diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 3a686f7e7..4da361477 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -129,11 +129,11 @@ class ProductRepository extends Repository } /** - * @param string $categories + * @param string $categoryId * * @return \Illuminate\Support\Collection */ - public function getAll($categories = null) + public function getAll($categoryId = null) { $params = request()->input(); @@ -147,7 +147,7 @@ class ProductRepository extends Repository $page = Paginator::resolveCurrentPage('page'); - $repository = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($params, $categories) { + $repository = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($params, $categoryId) { $channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode()); $locale = request()->get('locale') ?: app()->getLocale(); @@ -161,8 +161,8 @@ class ProductRepository extends Repository ->where('product_flat.locale', $locale) ->whereNotNull('product_flat.url_key'); - if ($categories) { - $qb->whereIn('product_categories.category_id', explode(',', $categories)); + if ($categoryId) { + $qb->whereIn('product_categories.category_id', explode(',', $categoryId)); } if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) { From 1ce9b3787fb9b87ad48939a29b104eca882919f1 Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Tue, 23 Feb 2021 19:06:18 +0530 Subject: [PATCH 7/7] Sorted Missing Section Changelog --- CHANGELOG for v0.1.x.md | 92 ++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/CHANGELOG for v0.1.x.md b/CHANGELOG for v0.1.x.md index 271b7ef37..b6bf5b30d 100755 --- a/CHANGELOG for v0.1.x.md +++ b/CHANGELOG for v0.1.x.md @@ -450,10 +450,6 @@ This changelog consists the bug & security fixes and new features being included * [feature] - Added translations for Arabic and Brazilian languages(thanks to @cgartner-redstage). -* #633 [fixed] - Fixed database custom port issue in installer issue (thanks to @abdulhamid-alattar) - -* #652 [fixed] - Removed black bar in admin panel. - * #676 [fixed] - Can't filter by ID. * #671 [fixed] - Having these errors Undefined variable: key/value. @@ -462,14 +458,18 @@ This changelog consists the bug & security fixes and new features being included * #664 [fixed] - CSS issues -* #646 [fixed] - Warning: array_combine() expects parameter 1 to be array, null given ( install.php on line 32 ) +* #652 [fixed] - Removed black bar in admin panel. -* #639 [fixed] - Broken link of image, on edit page of attribute in case of Swatch Type "Image" when editing first time. +* #646 [fixed] - Warning: array_combine() expects parameter 1 to be array, null given ( install.php on line 32 ) * #642 [fixed] - Getting exception on search in Products, Categories, Shipments & Product Reviews datagrids. +* #639 [fixed] - Broken link of image, on edit page of attribute in case of Swatch Type "Image" when editing first time. + * #636 [fixed] - Getting exception in shipment grid. +* #633 [fixed] - Fixed database custom port issue in installer issue (thanks to @abdulhamid-alattar) + * #621 [Added] - Add a column in product grid to identify the attribute family used for creating that product. * #620 [fixed] - "Enter Key" is not working while searching the product. @@ -522,10 +522,10 @@ This changelog consists the bug & security fixes and new features being included * #551 [Fixed] - Able to delete root category. -* #545 [Fixed] - Installer doesn't launch admin panel of framework. - * #546 [Fixed] - Getting Exception while uploading category image after installing project using installer. +* #545 [Fixed] - Installer doesn't launch admin panel of framework. + * #534 [Fixed] - Product is displaying as out of stock if default Inventory is zero, while other Inventory sources have products. * #533 [Fixed] - Displaying incorrect number of product on front-end. @@ -544,64 +544,64 @@ This changelog consists the bug & security fixes and new features being included * [feature] - Faster and efficiently refactored datagrids for showing listing data. -* #191 [fixed] - Add a column Shipped to in Order Grid ,to display the name for whom order has been shipped. - -* #368 [fixed] - If products are added in shopping cart and those product get deleted from admin section then it still displays in cart. - -* #353 [fixed] - Getting exception in deleting currency. - -* #143 [fixed] - If user login from checkout page, then it should redirect to checkout page. - -* #402 [fixed] - Change the validation message on moving product from wish-list to cart if product added in wish-list is out of stock. - -* #530 [fixed] - Unable to delete any of the created attributes.Getting validation message that attribute is used in configurable product while attribute is not used for creating any product. - -* #514 [fixed] - Getting Exception on changing the status of Product(On mass update). - * #532 [fixed] - Pagination should not display if there is no product on other page.If 9 products are selected to show on a single page then until the limit reach pagination should not occur. -* #506 [fixed] - While Installing the framework through Installer if at any stage user click on back button and then click on continue to install, then in this case unable to install. - -* #513 [fixed] - Getting Exception in deleting categories. - * #531 [fixed] - Do not use short form of any words for notification. +* #530 [fixed] - Unable to delete any of the created attributes.Getting validation message that attribute is used in configurable product while attribute is not used for creating any product. + * #524 [fixed] - Getting Exception when login with user having custom role(ACL issue). -* #453 [fixed] - Installation of Master Branch. - -* #426 [fixed] - php artisan down does not work. - -* #396 [fixed] - Layout issue on changing locale. - -* #334 [fixed] - My Account Grid displays blank after the bagisto 0.1.2 installation. - -* #457 [fixed] - Admin add product "Undefined variable: configurableFamily". - -* #508 [fixed] - Correct the required php version in installer. - -* #519 [fixed] - Status column of Review remains blank if review is in Pending state. - * #523 [fixed] - Status column of review page remains blank if Status is change to disapprove(Mass update). +* #519 [fixed] - Status column of Review remains blank if review is in Pending state. + +* #514 [fixed] - Getting Exception on changing the status of Product(On mass update). + +* #513 [fixed] - Getting Exception in deleting categories. + +* #508 [fixed] - Correct the required php version in installer. + +* #506 [fixed] - While Installing the framework through Installer if at any stage user click on back button and then click on continue to install, then in this case unable to install. + +* #457 [fixed] - Admin add product "Undefined variable: configurableFamily". + +* #453 [fixed] - Installation of Master Branch. + * #438 [fixed] - Simple Select Attribute Issue -* #381 [fixed] - On front-end currency symbol display only for Indian Rupee and USD. If code is selected other than these two in currency then code displays before price. +* #426 [fixed] - php artisan down does not work. -* #301 [fixed] - Only customer that are on first page get exported. +* #402 [fixed] - Change the validation message on moving product from wish-list to cart if product added in wish-list is out of stock. * #399 [fixed] - Accepting future date of birth for customer. -* #369 [fixed] - Displaying incorrect response message on updating the status of products. +* #396 [fixed] - Layout issue on changing locale. -* #363 [fixed] - Unable to delete last tax rate. - -* #347 [fixed] - Pricing Issue. +* #381 [fixed] - On front-end currency symbol display only for Indian Rupee and USD. If code is selected other than these two in currency then code displays before price. * #378 [fixed] - Images that are applied on Category doesn't display in Edit Category Page. +* #369 [fixed] - Displaying incorrect response message on updating the status of products. + +* #368 [fixed] - If products are added in shopping cart and those product get deleted from admin section then it still displays in cart. + +* #363 [fixed] - Unable to delete last tax rate. + +* #353 [fixed] - Getting exception in deleting currency. + +* #347 [fixed] - Pricing Issue. + +* #334 [fixed] - My Account Grid displays blank after the bagisto 0.1.2 installation. + * #304 [fixed] - If a current user want to delete his account then in this case a password verification should be required before deleting the user. +* #301 [fixed] - Only customer that are on first page get exported. + +* #191 [fixed] - Add a column Shipped to in Order Grid ,to display the name for whom order has been shipped. + +* #143 [fixed] - If user login from checkout page, then it should redirect to checkout page. + ## **v0.1.3 (20th of December, 2018)** - *Release* * [feature] Mass selection features had been implemented in datagrid for deletion and mass updation purposes