From 4510a42d3492c8b273ff6952454df8f205dd6f11 Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Tue, 24 Mar 2020 02:17:17 +0530 Subject: [PATCH 1/8] testing --- packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php index fd9a84761..59997b828 100644 --- a/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php @@ -13,6 +13,7 @@ class AddressDataGrid extends DataGrid */ public $index = 'address_id'; + /** * @var string */ @@ -168,4 +169,4 @@ class AddressDataGrid extends DataGrid 'method' => 'DELETE', ]); } -} \ No newline at end of file +} From 2334cf4cc79c28c1477750d3a7f8884e5da04ff9 Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 24 Mar 2020 10:52:45 +0530 Subject: [PATCH 2/8] Issue #2724 fixed --- .../Webkul/BookingProduct/src/Type/Booking.php | 18 +++++++++--------- .../src/Http/Controllers/CartController.php | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/Webkul/BookingProduct/src/Type/Booking.php b/packages/Webkul/BookingProduct/src/Type/Booking.php index 80e3dfc88..de6b83b40 100644 --- a/packages/Webkul/BookingProduct/src/Type/Booking.php +++ b/packages/Webkul/BookingProduct/src/Type/Booking.php @@ -163,19 +163,19 @@ class Booking extends Virtual return trans('shop::app.checkout.cart.integrity.missing_options'); } - $filtered = Arr::where($data['booking']['qty'], function ($qty, $key) { - return $qty != 0; - }); - - if (! count($filtered)) { - return trans('shop::app.checkout.cart.integrity.missing_options'); - } - $products = []; $bookingProduct = $this->getBookingProduct($data['product_id']); if ($bookingProduct->type == 'event') { + $filtered = Arr::where($data['booking']['qty'], function ($qty, $key) { + return $qty != 0; + }); + + if (! count($filtered)) { + return trans('shop::app.checkout.cart.integrity.missing_options'); + } + foreach ($data['booking']['qty'] as $ticketId => $qty) { if (! $qty) { continue; @@ -223,7 +223,7 @@ class Booking extends Virtual } if (isset($options1['booking']) && isset($options2['booking'])) { - return $options1['booking'] === $options2['booking']; + return $options1['booking'] == $options2['booking']; } elseif (! isset($options1['booking'])) { return false; } elseif (! isset($options2['booking'])) { diff --git a/packages/Webkul/Shop/src/Http/Controllers/CartController.php b/packages/Webkul/Shop/src/Http/Controllers/CartController.php index 74b3253b9..be59bc4bd 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CartController.php @@ -65,7 +65,7 @@ class CartController extends Controller */ public function add($id) { - try { + // try { $result = Cart::addProduct($id, request()->all()); if ($this->onWarningAddingToCart($result)) { @@ -87,13 +87,13 @@ class CartController extends Controller return redirect()->route('shop.checkout.onepage.index'); } } - } catch(\Exception $e) { - session()->flash('error', trans($e->getMessage())); + // } catch(\Exception $e) { + // session()->flash('error', trans($e->getMessage())); - $product = $this->productRepository->find($id); + // $product = $this->productRepository->find($id); - return redirect()->route('shop.productOrCategory.index', $product->url_key); - } + // return redirect()->route('shop.productOrCategory.index', $product->url_key); + // } return redirect()->back(); } From 6b3a30645c2c0fcb923d8bf883c16c7019725df9 Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 24 Mar 2020 11:03:36 +0530 Subject: [PATCH 3/8] Removed commented code fom cart controller --- .../Shop/src/Http/Controllers/CartController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/Webkul/Shop/src/Http/Controllers/CartController.php b/packages/Webkul/Shop/src/Http/Controllers/CartController.php index be59bc4bd..74b3253b9 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CartController.php @@ -65,7 +65,7 @@ class CartController extends Controller */ public function add($id) { - // try { + try { $result = Cart::addProduct($id, request()->all()); if ($this->onWarningAddingToCart($result)) { @@ -87,13 +87,13 @@ class CartController extends Controller return redirect()->route('shop.checkout.onepage.index'); } } - // } catch(\Exception $e) { - // session()->flash('error', trans($e->getMessage())); + } catch(\Exception $e) { + session()->flash('error', trans($e->getMessage())); - // $product = $this->productRepository->find($id); + $product = $this->productRepository->find($id); - // return redirect()->route('shop.productOrCategory.index', $product->url_key); - // } + return redirect()->route('shop.productOrCategory.index', $product->url_key); + } return redirect()->back(); } From 4b84b89251ae2174a3ff784bea60aa2302e9e0f1 Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 24 Mar 2020 11:05:34 +0530 Subject: [PATCH 4/8] Issue #2715 fixed --- .../src/Repositories/BookingProductRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/Webkul/BookingProduct/src/Repositories/BookingProductRepository.php b/packages/Webkul/BookingProduct/src/Repositories/BookingProductRepository.php index 29e1b7059..826a2d32e 100644 --- a/packages/Webkul/BookingProduct/src/Repositories/BookingProductRepository.php +++ b/packages/Webkul/BookingProduct/src/Repositories/BookingProductRepository.php @@ -174,6 +174,12 @@ class BookingProductRepository extends Repository $to = Carbon::createFromTimeString($timeInterval['to'])->getTimestamp(); + if ($from > $to) { + unset($slots[$key]); + + continue; + } + $isOverLapping = false; foreach ($tempSlots as $slot) { From f19206ab6efcb337490d0c3c2317311ad66c2c0f Mon Sep 17 00:00:00 2001 From: rahulshukla-home Date: Tue, 24 Mar 2020 11:26:03 +0530 Subject: [PATCH 5/8] Issue #2593 fixed --- .../Resources/views/products/list/layered-navigation.blade.php | 2 +- .../views/shop/products/list/layered-navigation.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php index c0fc79a5c..a623412f6 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/list/layered-navigation.blade.php @@ -163,7 +163,7 @@ data: function() { let maxPrice = '{{ core()->convertPrice($productFlatRepository->getCategoryProductMaximumPrice($category)) }}'; - maxPrice = (parseInt(maxPrice) !== 0) ? parseInt(maxPrice) : 500; + maxPrice = maxPrice ? ((parseInt(maxPrice) !== 0 || maxPrice) ? parseInt(maxPrice) : 500) : 500; return { appliedFilters: [], diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php index 77a6731eb..61ef99f65 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/list/layered-navigation.blade.php @@ -183,7 +183,7 @@ data: function() { let maxPrice = '{{ core()->convertPrice($productFlatRepository->getCategoryProductMaximumPrice($category)) }}'; - maxPrice = (parseInt(maxPrice) !== 0) ? parseInt(maxPrice) : 500; + maxPrice = maxPrice ? ((parseInt(maxPrice) !== 0 || maxPrice) ? parseInt(maxPrice) : 500) : 500; return { active: false, From 9b4412b55483df2c5f4eb3e240bd4489d25f2570 Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 24 Mar 2020 12:11:56 +0530 Subject: [PATCH 6/8] Updated changelog --- CHANGELOG for v1.x.x.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/CHANGELOG for v1.x.x.md b/CHANGELOG for v1.x.x.md index 2f4b434f9..32f39a178 100644 --- a/CHANGELOG for v1.x.x.md +++ b/CHANGELOG for v1.x.x.md @@ -2,7 +2,7 @@ #### This changelog consists the bug & security fixes and new features being included in the releases listed below. -## **v1.1.0 (20th of March 2020)** - *Release* +## **v1.1.0 (24th of March 2020)** - *Release* * [feature] Added new booking type product. @@ -10,6 +10,8 @@ * [feature] Impletment compare product feature. +* #2525 [fixed] - Add more settings to the installers + * #2541 [fixed] - Showing product's price with the price including tax * #2552 [fixed] - error mysql 8 @@ -72,14 +74,20 @@ * #2606 [fixed] - custom attributes are not Visible on Product View Page on Front-end +* #2607 [fixed] - Getting exception on editing category for pt_BR locale in php 7.4 + * #2608 [fixed] - Getting exception on creating category. * #2609 [fixed] - product removed from comparison page when update product by name * #2611 [fixed] - installer error +* #2612 [fixed] - available slots are not showing for current date even if slot time is not expired + * #2613 [fixed] - Propaganistas/Laravel-Intl is abandoned +* #2614 [fixed] - table booking slot time is expired still exist in cart + * #2619 [fixed] - Issue when category slug & product slug are same * #2621 [fixed] - i create a site and it is up kind of noting works @@ -150,7 +158,9 @@ * #2667 [fixed] - By default wishlist option is selected in cart -* #2669 [fixed] - Booking product should be removed from the cart when selected slot time expired +* #2670 [fixed] - Booking product should be removed from the cart when selected slot time expired + +* #2669 [fixed] - Browser compatibility issue * #2671 [fixed] - Error on moving booking product to wishlist @@ -164,7 +174,23 @@ * #2693 [fixed] - Booking product page - add to cart button js error -* #2707 [fixed] Getting exception when generate invoice in appointment booking +* #2704 [fixed] - product's assigned category can't be removed + +* #2707 [fixed] - Getting exception when generate invoice in appointment booking + +* #2715 [fixed] - Error message should throw if "To" time is less than "From". + +* #2716 [fixed] - After saving the default booking time product selected time for date range changes to 00:00:00 ,because of which not able to book appointment on frontend. + +* #2722 [fixed] - warning showing when update event booking cart quantity from the product page + +* #2723 [fixed] - Compare product icon on header showing counts of compare product but there are no product in compare list. + +* #2724 [fixed] - table bookings quantity should update in existing booking added in cart for same slot/date + +* #2726 [fixed] - is shop.js the vue framework ?? + +* #2732 [fixed] - missing product's quick view in category page ## **v1.0.0 (24th of February 2020)** - *Release* From 66213ab5f363acefed5f81521aad3024bf26bcee Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 24 Mar 2020 13:54:17 +0530 Subject: [PATCH 7/8] Issue #2717 fixed --- .../BookingProduct/src/Helpers/RentalSlot.php | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/packages/Webkul/BookingProduct/src/Helpers/RentalSlot.php b/packages/Webkul/BookingProduct/src/Helpers/RentalSlot.php index a6c82a26f..7351eed17 100644 --- a/packages/Webkul/BookingProduct/src/Helpers/RentalSlot.php +++ b/packages/Webkul/BookingProduct/src/Helpers/RentalSlot.php @@ -140,24 +140,46 @@ class RentalSlot extends Booking public function isSlotExpired($cartItem) { $bookingProduct = $this->bookingProductRepository->findOneByField('product_id', $cartItem['product_id']); - - $typeHelper = app($this->typeHelpers[$bookingProduct->type]); - $timeIntervals = $typeHelper->getSlotsByDate($bookingProduct, $cartItem['additional']['booking']['date']); + if (isset($cartItem['additional']['booking']['date'])) { + $timeIntervals = $this->getSlotsByDate($bookingProduct, $cartItem['additional']['booking']['date']); - $isExpired = true; + $isExpired = true; - foreach ($timeIntervals as $timeInterval) { - foreach ($timeInterval['slots'] as $slot) { - if ($slot['from_timestamp'] == $cartItem['additional']['booking']['slot']['from'] - && $slot['to_timestamp'] == $cartItem['additional']['booking']['slot']['to'] - ) { - $isExpired = false; + foreach ($timeIntervals as $timeInterval) { + foreach ($timeInterval['slots'] as $slot) { + if ($slot['from_timestamp'] == $cartItem['additional']['booking']['slot']['from'] + && $slot['to_timestamp'] == $cartItem['additional']['booking']['slot']['to'] + ) { + $isExpired = false; + } } } - } - return $isExpired; + return $isExpired; + } else { + $requestedFromDate = Carbon::createFromTimeString($cartItem['additional']['booking']['date_from'] . " 00:00:00"); + + $requestedToDate = Carbon::createFromTimeString($cartItem['additional']['booking']['date_to'] . " 23:59:59"); + + $availableFrom = ! $bookingProduct->available_every_week && $bookingProduct->available_from + ? Carbon::createFromTimeString($bookingProduct->available_from) + : Carbon::createFromTimeString($currentTime->format('Y-m-d 00:00:00')); + + $availableTo = ! $bookingProduct->available_every_week && $bookingProduct->available_from + ? Carbon::createFromTimeString($bookingProduct->available_to) + : Carbon::createFromTimeString('2080-01-01 00:00:00'); + + if ($requestedFromDate < $availableFrom + || $requestedFromDate > $availableTo + || $requestedToDate < $availableFrom + || $requestedToDate > $availableTo + ) { + return true; + } + + return false; + } } /** From 54de6667813e83619378a710ac12606ffff6e611 Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 24 Mar 2020 13:56:49 +0530 Subject: [PATCH 8/8] Updated changelog --- CHANGELOG for v1.x.x.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG for v1.x.x.md b/CHANGELOG for v1.x.x.md index 32f39a178..eab1841e0 100644 --- a/CHANGELOG for v1.x.x.md +++ b/CHANGELOG for v1.x.x.md @@ -182,6 +182,8 @@ * #2716 [fixed] - After saving the default booking time product selected time for date range changes to 00:00:00 ,because of which not able to book appointment on frontend. +* #2717 [fixed] - Getting error message on adding rental product in cart if rental booking is not available for that day. + * #2722 [fixed] - warning showing when update event booking cart quantity from the product page * #2723 [fixed] - Compare product icon on header showing counts of compare product but there are no product in compare list.