commit
e9608d87ef
|
|
@ -1124,7 +1124,7 @@ class Cart {
|
|||
$data['quantity'] = 1;
|
||||
$data['product'] = $product->id;
|
||||
|
||||
\Event::fire('checkout.cart.add.after', $product->id);
|
||||
\Event::fire('checkout.cart.add.before', $product->id);
|
||||
|
||||
$result = $this->add($product->id, $data);
|
||||
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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.singh852@webkul.com> @prashant-webkul
|
||||
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
|
||||
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
||||
*/
|
||||
class CartController extends Controller
|
||||
|
|
|
|||
Loading…
Reference in New Issue