Issue #2672 fixed
This commit is contained in:
parent
96ab5e390e
commit
bf5ad13dac
|
|
@ -176,7 +176,7 @@ class RentalSlot extends Booking
|
|||
$from = Carbon::createFromTimeString($item->additional['booking']['date_from'] . " 00:00:00");
|
||||
$to = Carbon::createFromTimeString($item->additional['booking']['date_to'] . " 24:00:00");
|
||||
|
||||
$price += $item->product->getTypeInstance()->getFinalPrice() + $bookingProduct->rental_slot->daily_price * $to->diffInDays($from);
|
||||
$price += $bookingProduct->rental_slot->daily_price * $to->diffInDays($from);
|
||||
} else {
|
||||
$from = Carbon::createFromTimestamp($item->additional['booking']['slot']['from']);
|
||||
$to = Carbon::createFromTimestamp($item->additional['booking']['slot']['to']);
|
||||
|
|
|
|||
|
|
@ -1039,7 +1039,7 @@ class Cart
|
|||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
if (! $found) {
|
||||
$this->wishlistRepository->create([
|
||||
'channel_id' => $cart->channel_id,
|
||||
'customer_id' => $this->getCurrentCustomer()->user()->id,
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class CartController extends Controller
|
|||
|
||||
if ($this->onWarningAddingToCart($result)) {
|
||||
session()->flash('warning', $result['warning']);
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +83,7 @@ class CartController extends Controller
|
|||
|
||||
if (request()->get('is_buy_now')) {
|
||||
Event::dispatch('shop.item.buy-now', $id);
|
||||
|
||||
return redirect()->route('shop.checkout.onepage.index');
|
||||
}
|
||||
}
|
||||
|
|
@ -205,10 +207,11 @@ class CartController extends Controller
|
|||
/**
|
||||
* Returns true, if result of adding product to cart is an array and contains a key "warning"
|
||||
*
|
||||
* @param array $result
|
||||
* @return bool
|
||||
* @param array $result
|
||||
* @return boolean
|
||||
*/
|
||||
private function onWarningAddingToCart($result): bool {
|
||||
private function onWarningAddingToCart($result): bool
|
||||
{
|
||||
return is_array($result) && isset($result['warning']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue