Merge pull request #2743 from jitendra-webkul/1.0

Issue #2722 fixed
This commit is contained in:
Jitendra Singh 2020-03-23 22:57:33 +05:30 committed by GitHub
commit 1f5ec6aa72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -71,7 +71,7 @@
<label class="required">{{ __('bookingproduct::app.admin.catalog.products.available-to') }}</label>
<datetime>
<input type="text" v-validate="'required|date_format:yyyy-MM-dd HH:mm:ss|after:available_from'" name="booking[available_to]" v-model="booking.available_to" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.available-to') }}&quot;" ref="available_from"/>
<input type="text" v-validate="'required|date_format:yyyy-MM-dd HH:mm:ss|after:available_from'" name="booking[available_to]" v-model="booking.available_to" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.available-to') }}&quot;" ref="available_to"/>
</datetime>
<span class="control-error" v-if="errors.has('booking[available_to]')">@{{ errors.first('booking[available_to]') }}</span>

View File

@ -2,6 +2,7 @@
namespace Webkul\BookingProduct\Type;
use Illuminate\Support\Arr;
use Webkul\Attribute\Repositories\AttributeRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Product\Repositories\ProductAttributeValueRepository;
@ -162,6 +163,14 @@ 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']);

View File

@ -165,9 +165,9 @@ class Cart
'cart_id' => $cart->id
]));
} else {
if ($cartItem->product->getTypeInstance()->showQuantityBox() === false) {
return ['warning' => __('shop::app.checkout.cart.integrity.qty_impossible')];
}
// if ($cartItem->product->getTypeInstance()->showQuantityBox() === false) {
// return ['warning' => __('shop::app.checkout.cart.integrity.qty_impossible')];
// }
$cartItem = $this->cartItemRepository->update($cartProduct, $cartItem->id);
}