Merge pull request #1143 from prashant-webkul/development

Development
This commit is contained in:
Jitendra Singh 2019-06-29 18:49:00 +05:30 committed by GitHub
commit e9608d87ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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()) {

View File

@ -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