revert code to redirect to cart.

This commit is contained in:
Edward Yang 2023-06-02 17:33:22 +08:00
parent 65f8023891
commit 0c18aedbb1
1 changed files with 1 additions and 4 deletions

View File

@ -11,7 +11,6 @@
namespace Beike\Shop\Http\Controllers;
use Beike\Exceptions\CartException;
use Beike\Repositories\OrderRepo;
use Beike\Shop\Services\CheckoutService;
use Illuminate\Http\Request;
@ -25,10 +24,8 @@ class CheckoutController extends Controller
$data = hook_filter('checkout.index.data', $data);
return view('checkout', $data);
} catch (CartException $e) {
return redirect(shop_route('carts.index'))->withErrors(['error' => $e->getMessage()]);
} catch (\Exception $e) {
return redirect(shop_route('checkout.index'))->withErrors(['error' => $e->getMessage()]);
return redirect(shop_route('carts.index'))->withErrors(['error' => $e->getMessage()]);
}
}