commit
1f5ec6aa72
|
|
@ -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=""{{ __('bookingproduct::app.admin.catalog.products.available-to') }}"" 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=""{{ __('bookingproduct::app.admin.catalog.products.available-to') }}"" ref="available_to"/>
|
||||
</datetime>
|
||||
|
||||
<span class="control-error" v-if="errors.has('booking[available_to]')">@{{ errors.first('booking[available_to]') }}</span>
|
||||
|
|
|
|||
|
|
@ -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']);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue