diff --git a/CHANGELOG for v1.x.x.md b/CHANGELOG for v1.x.x.md index 2f4b434f9..eab1841e0 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,25 @@ * #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. + +* #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. + +* #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* 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 +} 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; + } } /** 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) { 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/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,