diff --git a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php index 9911b58e7..8979bec31 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php @@ -134,10 +134,16 @@ class WishlistController extends Controller if(!isset($wishlistItem) || $wishlistItem->customer_id != auth()->guard('customer')->user()->id) { session()->flash('warning', trans('shop::app.security-warning')); - return redirect()->route( 'customer.wishlist.index'); + return redirect()->route('customer.wishlist.index'); } - $result = Cart::moveToCart($wishlistItem); + try { + $result = Cart::moveToCart($wishlistItem); + } catch (\Exception $e) { + session()->flash('warning', $e->getMessage()); + + return redirect()->back(); + } if ($result == 1) { if ($wishlistItem->delete()) { diff --git a/packages/Webkul/Shop/src/Http/Controllers/CartController.php b/packages/Webkul/Shop/src/Http/Controllers/CartController.php index e24d8058b..5db290c6d 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CartController.php @@ -16,7 +16,7 @@ use Cart; * Cart controller for the customer and guest users for adding and * removing the products in the cart. * - * @author Prashant Singh @prashant-webkul + * @author Prashant Singh @prashant-webkul * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) */ class CartController extends Controller