Merge branch 'master' of https://github.com/bagisto/bagisto
This commit is contained in:
commit
c539e017fe
|
|
@ -215,18 +215,24 @@ class CartController extends Controller
|
|||
|
||||
public function buyNow($id, $quantity = 1)
|
||||
{
|
||||
Event::fire('checkout.cart.add.before', $id);
|
||||
try {
|
||||
Event::fire('checkout.cart.add.before', $id);
|
||||
|
||||
$result = Cart::proceedToBuyNow($id, $quantity);
|
||||
$result = Cart::proceedToBuyNow($id, $quantity);
|
||||
|
||||
Event::fire('checkout.cart.add.after', $result);
|
||||
Event::fire('checkout.cart.add.after', $result);
|
||||
|
||||
Cart::collectTotals();
|
||||
Cart::collectTotals();
|
||||
|
||||
if (! $result) {
|
||||
return redirect()->back();
|
||||
} else {
|
||||
return redirect()->route('shop.checkout.onepage.index');
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
session()->flash('error', trans($e->getMessage()));
|
||||
|
||||
if (! $result) {
|
||||
return redirect()->back();
|
||||
} else {
|
||||
return redirect()->route('shop.checkout.onepage.index');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue