Guthaben aufladen, löschen, Ansichten

This commit is contained in:
Kevin Adametz 2021-04-26 16:07:03 +02:00
parent 6ac9fcc4d2
commit 3754f1c571
27 changed files with 603 additions and 89 deletions

View file

@ -64,7 +64,7 @@ class MembershipController extends Controller
$data = Request::all();
//#### remove_abo
/*if($action === "remove_abo"){
@ -83,17 +83,17 @@ class MembershipController extends Controller
}*/
//#### payment order
//#### shop upgrade
/*if($action === "upgrade_order" || $action === "payment_order"){
if($action === "upgrade_order" || $action === "payment_order"){
if(Request::get('switchers-package-wizard')){
$user = User::find(Auth::user()->id);
Yard::instance('shopping')->destroy();
$product = Product::find(Request::get('switchers-package-wizard'));
$showAboOptions = false;
if(Request::get('abo_options')){
// $showAboOptions = false;
/* if(Request::get('abo_options')){
$showAboOptions = true;
$user->abo_options = true;
$user->save();
}
}*/
if($product && $product->active && $product->show_at >= 3){
$image = "";
if($product->images->count()){
@ -102,15 +102,17 @@ class MembershipController extends Controller
$qty = Request::get('qty') ? Request::get('qty') : 1;
Yard::instance('shopping')->add($product->id, $product->getLang('name'), $qty, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
/*
do {
$identifier = Util::getToken();
} while( ShoppingInstance::where('identifier', $identifier)->count() );
*/
$identifier = Util::getToken();
$data = [];
$data['is_from'] = 'membership';
$data['is_for'] = 'me';
ShoppingInstance::create([
/* ShoppingInstance::create([
'identifier' => $identifier,
'user_shop_id' => 1, //is first faker shop for nuy intern
'auth_user_id' => Auth::user()->id,
@ -120,16 +122,21 @@ class MembershipController extends Controller
'shopping_data' => $data,
'back' => url()->previous(),
]);
Yard::instance('shopping')->store($identifier);
]);*/
Yard::instance('shopping')->putYardExtra('shopping_data', $data);
//Yard::instance('shopping')->store($identifier);
//add to DB
$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
UserHistory::create(['user_id' => $user->id, 'action'=>$action, 'status'=>1, 'product_id'=>$product->id, 'identifier'=>$identifier, 'abo_options'=>$showAboOptions]);
UserHistory::create(['user_id' => $user->id, 'action'=>$action, 'status'=>1, 'product_id'=>$product->id, 'identifier'=>$identifier]);
//$path = route('checkout.checkout_card', ['identifier'=>$identifier]);
//$path = str_replace('http', 'https', $path);
return redirect()->secure($path);
// return redirect()->secure($path);
return redirect(route('user_checkout', [$identifier]));
}
}
}*/
}
/*
if($action === "change_order"){