This commit is contained in:
franknstayn
2021-10-27 18:25:39 +08:00
parent 29a75f4db2
commit 9c2a672cc5

View File

@@ -79,14 +79,21 @@ class PaypalController extends Controller
{
$UserModel = new UserModel;
// if (Auth::guest()) {
// $message = 'Please <a href="' . url('auth/login') . '">Sign in</a> to your account to proceed.';
// Session::flash('msg', $message);
// return Redirect::back();
// }
if (Auth::guest()) {
$message = 'Please <a href="' . url('auth/login') . '">Sign in</a> to your account to proceed.';
Session::flash('msg', $message);
return Redirect::back();
}
$userId = Auth::user()->id;
$array_address_book = $UserModel->selectAddresBook('UserId', $userId);
if(count($array_address_book) <= 0) {
$message = 'Please complete your shipping address. <a href="user/address-book/create"> <strong> <u>click here</u> </strong></a>.';
Session::flash('cartkeyError', $message);
return Redirect::back();
}
$shipping_address_url = "user/address-book/edit/" . $array_address_book[0]->Id;
if (