User Order step1

This commit is contained in:
Kevin Adametz 2020-08-07 16:02:03 +02:00
parent eb55b01b0d
commit a5db985ae8
90 changed files with 6439 additions and 421 deletions

View file

@ -6,6 +6,7 @@ use App\Models\Category;
use App\Models\Country;
use App\Models\Product;
use App\Models\ShippingCountry;
use App\Models\ShoppingUser;
use App\Models\UserLevel;
use App\User;
@ -299,4 +300,21 @@ class HTMLHelper
}
return $ret;
}
public static function getUserCustomerOptions($id, $all=false){
$values = ShoppingUser::select(['id', 'billing_firstname', 'billing_lastname', 'billing_email', 'number'])
->where('shopping_users.member_id', '=', \Auth::user()->id)->get();
$ret = "";
if($all){
$ret .= '<option value="">'.__('please select').'</option>\n';
}
foreach ($values as $value){
dump($value);
$attr = ($value->id == $id) ? 'selected="selected"' : '';
$to = $value->billing_firstname." ".$value->billing_lastname." | ".$value->billing_email;
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$to.' #'.$value->number.'</option>\n';
}
return $ret;
}
}