Merge branch 'master' of https://github.com/bagisto/bagisto into patch-1

This commit is contained in:
Shubham Mehrotra 2020-03-24 16:27:30 +05:30
commit f7187a3f2f
7 changed files with 84 additions and 27 deletions

View File

@ -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*

View File

@ -13,6 +13,7 @@ class AddressDataGrid extends DataGrid
*/
public $index = 'address_id';
/**
* @var string
*/
@ -168,4 +169,4 @@ class AddressDataGrid extends DataGrid
'method' => 'DELETE',
]);
}
}
}

View File

@ -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;
}
}
/**

View File

@ -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) {

View File

@ -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'])) {

View File

@ -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: [],

View File

@ -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,