promotion 1.0

This commit is contained in:
Kevin Adametz 2021-12-25 02:51:22 +01:00
parent 1cc8e025a1
commit 570d428b1c
60 changed files with 1596 additions and 272 deletions

8
.env
View file

@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=base64:w0K6RjfleoAOpuICea14JnaZ28PNc6EMzIFMQZ3MVtU= APP_KEY=base64:w0K6RjfleoAOpuICea14JnaZ28PNc6EMzIFMQZ3MVtU=
APP_DEBUG=true APP_DEBUG=true
APP_URL=https://partner.gruene-seele.test APP_URL=https://partner.gruene-seele.test
APP_API_DOMAIN=gruene-seele.bio
APP_DOMAIN=partner.gruene-seele.test APP_DOMAIN=partner.gruene-seele.test
APP_PROMO_URL=https://testemich.test APP_PROMO_URL=https://testemich.test
APP_PROMO_DOMAIN=testemich.test APP_PROMO_DOMAIN=testemich.test
@ -54,6 +55,13 @@ MAIL_ENCRYPTION=""
MAIL_FROM_ADDRESS=partner@gruene-seele.bio MAIL_FROM_ADDRESS=partner@gruene-seele.bio
MAIL_FROM_NAME="Partner GRÜNE SEELE Naturkosmetik" MAIL_FROM_NAME="Partner GRÜNE SEELE Naturkosmetik"
PAYPAL_MODE=sandbox
PAYPAL_SANDBOX_CLIENT_ID=AYePlmttXXyoUJTgECTiyXht7LKCOIe4tky4q943NQQRsqyFhLYLHUzYbyhXvKJAXp--lrO040iZWtRB
PAYPAL_SANDBOX_CLIENT_SECRET=EE9-80_RVcl6m7BRYPrVCrZFeQWhSAIClCLULOiC07DIxf_Sb4pyBdnCgewv_ULrGDwEcSIUeeBDiUQI
PAYPAL_LIVE_CLIENT_ID=AWz915k8LX6k4auJFVsP4Rwa5koRP718pEbnDAcXnaN--ox1ZsoPanBIE32EXdUscF292-XZNSTH8_t-
PAYPAL_LIVE_CLIENT_SECRET=EMWCXquC3j5f7rmBu4dkkSN4I3V0OLbGss2seXeCc0TfpR9cMbv7GGm3b0i1xgMTFlJNIsAWtB-FjRyW
AWS_ACCESS_KEY_ID= AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY= AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1 AWS_DEFAULT_REGION=us-east-1

View file

@ -265,7 +265,7 @@ class ShoppingUserController extends Controller
$shopping_user = ShoppingUser::create($data); $shopping_user = ShoppingUser::create($data);
//Kundenhoheit prüfen //Kundenhoheit prüfen
$priority = CustomerPriority::checkOne($shopping_user, true, false); $priority = CustomerPriority::checkOne($shopping_user, true, false, true);
\App\Services\Shop::newUserOrder($shopping_user->number); \App\Services\Shop::newUserOrder($shopping_user->number);
//exists //like //update //exists //like //update
$user = $this->prepareForShow($shopping_user); $user = $this->prepareForShow($shopping_user);

View file

@ -59,6 +59,8 @@ class PayController extends Controller
private $reference; private $reference;
private $payment_method;
public function __construct() { public function __construct() {
} }
@ -77,6 +79,7 @@ class PayController extends Controller
public function setPrePayment($payment_method, $amount, $currency, $ret = []){ public function setPrePayment($payment_method, $amount, $currency, $ret = []){
$this->reference = $this->shopping_order->created_at->format('Ym').$this->shopping_order->id;//substr(uniqid('m', false), 0, 16); $this->reference = $this->shopping_order->created_at->format('Ym').$this->shopping_order->id;//substr(uniqid('m', false), 0, 16);
$this->payment_method = $payment_method;
$this->setMethod($payment_method, $ret); $this->setMethod($payment_method, $ret);
$this->prepayment = [ $this->prepayment = [
@ -86,7 +89,6 @@ class PayController extends Controller
"param" => $this->shopping_order->id, "param" => $this->shopping_order->id,
]; ];
$this->shopping_payment = ShoppingPayment::create([ $this->shopping_payment = ShoppingPayment::create([
'shopping_order_id' => $this->shopping_order->id, 'shopping_order_id' => $this->shopping_order->id,
'clearingtype' => $this->method["clearingtype"], 'clearingtype' => $this->method["clearingtype"],
@ -119,6 +121,15 @@ class PayController extends Controller
private function setMethod($payment_method, $ret = []){ private function setMethod($payment_method, $ret = []){
//vorkasse //vorkasse
if($payment_method === 'non'){
$this->method = [
"clearingtype" => "non",
"wallettype" => "",
'onlinebanktransfertype' => "",
"request" => "authorization",
];
}
if($payment_method === 'vor'){ if($payment_method === 'vor'){
$this->method = [ $this->method = [
"clearingtype" => "vor", "clearingtype" => "vor",
@ -138,12 +149,21 @@ class PayController extends Controller
]; ];
} }
//Rechnungskauf
if($payment_method === 'pp'){
$this->method = [
"clearingtype" => "pp",
"wallettype" => "",
'onlinebanktransfertype' => "",
"request" => "CAPTURE",
];
}
} }
public function ResponseData($identifier){ public function ResponseData($identifier, $payment_for = false){
$request = array_merge($this->default, $this->personalData, $this->deliveryData, $this->method, $this->prepayment, $this->urls); $request = array_merge($this->default, $this->personalData, $this->deliveryData, $this->method, $this->prepayment, $this->urls);
//RECHNUNG MIV
$payt = PaymentTransaction::create([ $payt = PaymentTransaction::create([
'shopping_payment_id' => $this->shopping_payment->id, 'shopping_payment_id' => $this->shopping_payment->id,
@ -155,10 +175,26 @@ class PayController extends Controller
'txaction' => 'prev', 'txaction' => 'prev',
'mode' => $this->shopping_payment->mode, 'mode' => $this->shopping_payment->mode,
]); ]);
//paypal
if($this->payment_method === 'pp'){
$paypal = new PayPalController;
$redirect = $paypal->payment($this->shopping_payment, $payt, $identifier, $this->shopping_order->promotion_user_id);
Util::setUserHistoryValue(['status'=>4], $identifier);
return $redirect;
}
Util::setUserHistoryValue(['status'=>5], $identifier); Util::setUserHistoryValue(['status'=>5], $identifier);
return redirect(route('user_checkout_final', [$payt->id, $this->reference, $identifier])); switch ($payment_for) {
case 4: //promotion
return redirect(route('web_promotion_goto', ['thanksorder', $this->shopping_order->promotion_user_id, $payt->id, $this->reference, $identifier]));
break;
default:
return redirect(route('user_checkout_final', [$payt->id, $this->reference, $identifier]));
break;
}
} }
} }

View file

@ -0,0 +1,95 @@
<?php
namespace App\Http\Controllers\Pay;
use Request;
use App\Models\PromotionUser;
use App\Models\PaymentTransaction;
use App\Http\Controllers\Controller;
use Srmklive\PayPal\Services\PayPal as PayPalClient;
class PayPalController extends Controller
{
public function payment($shopping_payment, $payt, $identifier, $promotion_user_id)
{
$provider = new PayPalClient;
// Through facade. No need to import namespaces
$provider = \PayPal::setProvider();
$provider->setApiCredentials(config('paypal'));
$provider->setAccessToken($provider->getAccessToken());
$provider->setCurrency('EUR');
$order = $provider->createOrder([
"intent"=> "CAPTURE",
"purchase_units"=> [
[
"reference_id" => $shopping_payment->reference,
"shopping_order_id" => $shopping_payment->shopping_order_id,
"amount"=> [
"currency_code"=> "USD",
"value"=> ($shopping_payment->amount / 100)
],
'description' => 'test'
]
],
'application_context' => [
'cancel_url' => route('cancel.paypal_payment', [$promotion_user_id, $payt->id, $shopping_payment->reference, $identifier]),
'return_url' => route('success.paypal_payment', [$promotion_user_id, $payt->id, $shopping_payment->reference, $identifier])
]
]);
$payt->key = $order['id'];
$payt->save();
return redirect($order['links'][1]['href'])->send();
}
public function paymentSuccess($id, $transactionId=false, $reference=false, $identifier=false)
{
$PromotionUser = PromotionUser::findOrFail($id);
$payt = PaymentTransaction::findOrFail($transactionId);
if($payt->shopping_payment->reference != $reference){
abort(404);
}
// Init PayPal
$provider = \PayPal::setProvider();
$provider->setApiCredentials(config('paypal'));
$provider->setAccessToken($provider->getAccessToken());
// Get PaymentOrder using our transaction ID
$order = $provider->capturePaymentOrder($payt->key);
if(isset($order['type'])){
abort(403, 'PayPal Type: '.$order['type']);
}
if(!isset($order['status']) || $order['status'] !== "COMPLETED"){
abort(403, 'Error: Order Status ');
}
if(Request::get('token') !== $payt->key){
abort(403, 'Error: PayPal token');
}
$payt->request = $order['status'];
$payt->save();
return redirect(route('web_promotion_goto', ['thanksorder', $id, $payt->id, $reference, $identifier]));
}
public function paymentCancel($id, $transactionId=false, $reference=false, $identifier=false)
{
$PromotionUser = PromotionUser::findOrFail($id);
return redirect(url($PromotionUser->url));
dd('Your payment has been declend. The payment cancelation page goes here!');
}
}

View file

@ -224,8 +224,8 @@ class SalesController extends Controller
if($ShoppingOrder->shopping_user->is_for === 'ot'){ if($ShoppingOrder->shopping_user->is_for === 'ot'){
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>'; return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
} }
if($ShoppingOrder->shopping_user->is_for === 'hp'){ if($ShoppingOrder->shopping_user->is_for === 'pr'){
return '<span class="badge badge-pill badge-dark">Homepartybestellung</span>'; return '<span class="badge badge-pill badge-dark">Promotion</span>';
} }
return '-'; return '-';
}) })
@ -249,6 +249,7 @@ class SalesController extends Controller
->orderColumn('id', 'id $1') ->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1') ->orderColumn('txaction', 'txaction $1')
->orderColumn('is_for', 'is_for $1')
->orderColumn('member_id', 'member_id $1') ->orderColumn('member_id', 'member_id $1')
->orderColumn('shipped', 'shipped $1') ->orderColumn('shipped', 'shipped $1')
->orderColumn('total_shipping', 'total_shipping $1') ->orderColumn('total_shipping', 'total_shipping $1')

View file

@ -106,7 +106,6 @@ class CheckoutController extends Controller
$shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_country_id); $shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_country_id);
$shopping_user->shipping_state = Shop::getCountryShippingCountryId($shopping_user->shipping_country_id); $shopping_user->shipping_state = Shop::getCountryShippingCountryId($shopping_user->shipping_country_id);
$shopping_user->same_as_billing = $shopping_user->same_as_billing ? false : true; //reinvert $shopping_user->same_as_billing = $shopping_user->same_as_billing ? false : true; //reinvert
} }
if($shopping_user->same_as_billing === NULL){ if($shopping_user->same_as_billing === NULL){
$shopping_user->same_as_billing = false; $shopping_user->same_as_billing = false;
@ -518,6 +517,7 @@ class CheckoutController extends Controller
$this->putPayments('shopping_order_margin_id', $shopping_order_margin->id); $this->putPayments('shopping_order_margin_id', $shopping_order_margin->id);
} }
} }
private function putPayments($key, $value){ private function putPayments($key, $value){
$content = $this->getContent(); $content = $this->getContent();
$content->put($key, $value); $content->put($key, $value);
@ -581,8 +581,6 @@ class CheckoutController extends Controller
]; ];
Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data); Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data);
} }
} }
} }

View file

@ -45,10 +45,12 @@ class PaymentController extends Controller
->addColumn('message', function (UserPayCredit $user_pay_credit) { ->addColumn('message', function (UserPayCredit $user_pay_credit) {
if($user_pay_credit->status === 3){ if($user_pay_credit->status === 3){
return nl2br($user_pay_credit->message); return nl2br($user_pay_credit->message);
}elseif($user_pay_credit->status === 5 || $user_pay_credit->status === 6){
return trans('payment.'.$user_pay_credit->message).
' &nbsp; <a class="btn btn-outline-secondary btn-xs" href="'.route('user_sales_order_detail', [$user_pay_credit->shopping_order_id]).'"><i class="ion ion-md-eye"></i></a>';
}else{ }else{
return trans('payment.'.$user_pay_credit->message). return trans('payment.'.$user_pay_credit->message).
' &nbsp; <a class="btn btn-outline-secondary btn-xs" href="'.route('user_order_detail', [$user_pay_credit->shopping_order_id]).'"><i class="ion ion-md-eye"></i></a>'; ' &nbsp; <a class="btn btn-outline-secondary btn-xs" href="'.route('user_order_detail', [$user_pay_credit->shopping_order_id]).'"><i class="ion ion-md-eye"></i></a>';
} }
}) })
->addColumn('credit', function (UserPayCredit $user_pay_credit) { ->addColumn('credit', function (UserPayCredit $user_pay_credit) {

View file

@ -38,7 +38,10 @@ class PromotionController extends Controller
if($user_promotion->user_id != Auth::user()->id){ if($user_promotion->user_id != Auth::user()->id){
abort(404); abort(404);
} }
$user_promotion->about_you = !$user_promotion->about_you ? $user_promotion->user->account->about_you : $user_promotion->about_you;
$user_promotion->description = $user_promotion->description ? $user_promotion->description : $user_promotion->promotion_admin->user_description;
$about_you = $user_promotion->user->account->about_you ?$user_promotion->user->account->about_you : $user_promotion->promotion_admin->user_about;
$user_promotion->about_you = $user_promotion->about_you ? $user_promotion->about_you : $about_you;
$data = [ $data = [
'checkPaymentCredit' => $user_promotion->checkPaymentCredit(), 'checkPaymentCredit' => $user_promotion->checkPaymentCredit(),
'user_promotion_cart' => PromotionUser::preCalculateCart($user_promotion, 'user_promotion'), 'user_promotion_cart' => PromotionUser::preCalculateCart($user_promotion, 'user_promotion'),
@ -66,7 +69,6 @@ class PromotionController extends Controller
return redirect(route('user_promotion_detail', [$id]))->withErrors($validator)->withInput(Request::all()); return redirect(route('user_promotion_detail', [$id]))->withErrors($validator)->withInput(Request::all());
} }
$model = $this->promoRepo->update($id, Request::all()); $model = $this->promoRepo->update($id, Request::all());
} }
\Session()->flash('alert-save', true); \Session()->flash('alert-save', true);
return redirect(route('user_promotion_detail', [$model->id])); return redirect(route('user_promotion_detail', [$model->id]));

View file

@ -0,0 +1,84 @@
<?php
namespace App\Http\Controllers\User;
use App\Http\Controllers\Controller;
use App\Models\ShoppingOrder;
use App\Services\Payment;
use App\User;
class SalesController extends Controller
{
public function __construct()
{
$this->middleware('active.account');
}
public function orders()
{
$data = [
];
return view('user.sales.orders', $data);
}
public function orderDetail($id)
{
$user = User::find(\Auth::user()->id);
$shopping_order = ShoppingOrder::findOrFail($id);
if($shopping_order->member_id !== $user->id){
abort(404);
}
$data = [
'shopping_order' => $shopping_order,
'isAdmin' => false,
];
return view('user.sales.order_detail', $data);
}
public function ordersDatatable(){
$user = User::find(\Auth::user()->id);
$query = ShoppingOrder::with('shopping_user')->select('shopping_orders.*')->where('shopping_orders.member_id', $user->id);
return \DataTables::eloquent($query)
->addColumn('id', function (ShoppingOrder $ShoppingOrder) {
return '<a href="' . route('user_sales_order_detail', [$ShoppingOrder->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('created_at', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->created_at->format("d.m.Y");
})
->addColumn('txaction', function (ShoppingOrder $ShoppingOrder) {
return Payment::getShoppingOrderBadge($ShoppingOrder);
})
->addColumn('total_shipping', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->getFormattedTotalShipping();
})
->addColumn('orders', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->shopping_user ? $ShoppingOrder->shopping_user->orders : '';
})
->addColumn('user_shop_id', function (ShoppingOrder $ShoppingOrder) {
return $ShoppingOrder->user_shop ? '<a href="'.$ShoppingOrder->user_shop->getSubdomain(false).'" target="_blank">'.$ShoppingOrder->user_shop->getSubdomain(false).'</span>' : '';
})
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
if($ShoppingOrder->shopping_user->is_for === 'me'){
return '<span class="badge badge-pill badge-secondary">Vertriebspartnerbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'ot'){
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
}
if($ShoppingOrder->shopping_user->is_for === 'pr'){
return '<span class="badge badge-pill badge-dark">Promotion</span>';
}
return '-';
})
->orderColumn('id', 'id $1')
->orderColumn('txaction', 'txaction $1')
->rawColumns(['id', 'is_for', 'txaction', 'user_shop_id'])
->make(true);
}
}

View file

@ -8,7 +8,7 @@ use App\Services\Payment;
use App\User; use App\User;
class ShopSalesController extends Controller class SalesController extends Controller
{ {
public function __construct() public function __construct()

View file

@ -2,16 +2,22 @@
namespace App\Http\Controllers\Web; namespace App\Http\Controllers\Web;
use Yard;
use Request; use Request;
use Response; use Response;
use Validator; use Validator;
use App\Services\Util; use App\Services\Util;
use App\Models\Product; use App\Models\Product;
use App\Models\UserHistory;
use App\Models\PaymentMethod; use App\Models\PaymentMethod;
use App\Models\PromotionUser; use App\Models\PromotionUser;
use App\Models\ShoppingOrder;
use App\Models\ShoppingPayment;
use App\Services\PromotionCart; use App\Services\PromotionCart;
use App\Models\PaymentTransaction;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Repositories\CheckoutRepository;
use App\Services\Payment;
class PromotionController extends Controller class PromotionController extends Controller
{ {
@ -47,9 +53,8 @@ class PromotionController extends Controller
return view('web.promotion.index', $data); return view('web.promotion.index', $data);
} }
public function goto($load, $id){ public function goto($load, $id, $transactionId=false, $reference=false, $identifier=false){
$PromotionUser = PromotionUser::findOrFail($id); $PromotionUser = PromotionUser::findOrFail($id);
$data = [ $data = [
'promotion_user' => $PromotionUser, 'promotion_user' => $PromotionUser,
]; ];
@ -57,15 +62,29 @@ class PromotionController extends Controller
if($load === 'thanksreminder'){ if($load === 'thanksreminder'){
return view('web.promotion.thanksreminder', $data); return view('web.promotion.thanksreminder', $data);
} }
if($load === 'thanksorder'){
return view('web.promotion.thanksorder', $data);
}
if($load === 'notactive'){ if($load === 'notactive'){
return view('web.promotion.notactive', $data); return view('web.promotion.notactive', $data);
} }
if($load === 'thanksorder'){
$payt = PaymentTransaction::findOrFail($transactionId);
if($payt->shopping_payment->reference != $reference){
abort(404);
}
Yard::instance('shopping')->destroy();
$checkRepo = new CheckoutRepository();
$checkRepo->destroy();
if(($payt->status === 'fnc' || $payt->status === 'vor' || $payt->status === 'pp' || $payt->status === 'non') && $payt->txaction === 'prev'){
$this->directPaymentStatus($payt, $identifier);
}
$data = [
'promotion_user' => $PromotionUser,
'order_reference' => $payt->shopping_payment->reference,
'pay_trans' => $payt,
];
return view('web.promotion.thanksorder', $data);
}
} }
public function store($id){ public function store($id){
$PromotionUser = PromotionUser::findOrFail($id); $PromotionUser = PromotionUser::findOrFail($id);
@ -78,13 +97,106 @@ class PromotionController extends Controller
return redirect(route('web_promotion_goto', ['thanksreminder', $PromotionUser->id])); return redirect(route('web_promotion_goto', ['thanksreminder', $PromotionUser->id]));
} }
if($data['action'] === 'submit-promotion-order'){ if($data['action'] === 'submit-promotion-order'){
return redirect(route('web_promotion_goto', ['thanksorder', $PromotionUser->id])); $rules = array(
} 'billing_firstname'=>'required',
'billing_lastname'=>'required',
'billing_address'=>'required',
'billing_zipcode'=>'required',
'billing_city' => 'required',
'billing_state' => 'required',
'billing_email'=>'required|email',
);
dd($PromotionUser); if(Request::get('same_as_billing')){
$rules = array_merge($rules, [
'shipping_firstname'=>'required',
'shipping_lastname'=>'required',
'shipping_address'=>'required',
'shipping_zipcode'=>'required',
'shipping_city' => 'required',
'shipping_salutation' => 'required'
]);
}
$validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) {
return back()->withErrors($validator)->withInput(Request::all());
}
$identifier = Util::getToken();
$data['is_from'] = 'shopping';
$data['is_for'] = 'pr';
unset($data['_token']);
Yard::instance('shopping')->putYardExtra('shopping_data', $data);
UserHistory::create(['user_id' => $PromotionUser->user_id, 'action'=>'web_promotion_payment', 'status'=>1, 'product_id'=>null, 'identifier'=>$identifier]);
$checkRepo = new CheckoutRepository();
$checkRepo->setPromotion(4, $PromotionUser);
$checkRepo->init($identifier, $data);
return $checkRepo->makePayment();
//$path = str_replace('http', 'https', $path);
//return redirect()->secure($path);
// return redirect(route('user_checkout', [$identifier]));
}
} }
private function directPaymentStatus(PaymentTransaction $payt, $identifier){
if(isset($payt->transmitted_data['param'])){
$shopping_order = ShoppingOrder::find($payt->transmitted_data['param']);
$shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first();
$shopping_order->txaction = 'open';
$shopping_order->save();
$payt->txaction = "open";
//is Promotion Handel it
if($shopping_order->promotion_user_id > 0){
Payment::handelPromotionProduct($shopping_order);
}
if($shopping_payment){
//Payment::handelUserPayCredits($shopping_order, 'deduction');
if($payt->status === 'vor'){
$shopping_payment->txaction = 'open';
$shopping_order->txaction = 'open';
$payt->txaction = "open";
}
if($payt->status === 'pp'){
$send_link = Payment::paymentStatusPaidAction($shopping_order, true);
$shopping_payment->txaction = 'paid';
$shopping_order->txaction = 'paid';
$payt->txaction = "paid";
}
if($payt->status === 'fnc'){
$send_link = Payment::paymentStatusPaidAction($shopping_order, true);
$shopping_payment->txaction = 'open';
$shopping_order->txaction = 'open';
$payt->txaction = "open";
}
if($payt->status === 'non'){
$send_link = Payment::paymentStatusPaidAction($shopping_order, true);
$shopping_payment->txaction = 'paid';
$shopping_order->txaction = 'paid';
$payt->txaction = "paid";
$shopping_order->save();
\App\Services\Shop::newUserOrder($shopping_order->shopping_user->number);
}
$shopping_payment->save();
}
$payt->save();
$data = [
'mode' => $payt->transmitted_data['mode'],
'txaction' => $payt->txaction,
'send_link' => false,
];
Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data);
}
}
public function load(){ public function load(){
$data = Request::all(); $data = Request::all();
$ret = ""; $ret = "";
@ -94,32 +206,36 @@ class PromotionController extends Controller
$product = Product::find($data['id']); //current user form order $product = Product::find($data['id']); //current user form order
$ret = view("web.promotion.show_product", compact('product', 'data'))->render(); $ret = view("web.promotion.show_product", compact('product', 'data'))->render();
} }
if($data['action'] === 'switch-free-product'){ if($data['perform']){
\App\Services\PromotionCart::updateFeeProduct($data); if($data['action'] === 'switch-free-product'){
$ret = view("web.promotion._promotion_cart", compact('data'))->render(); \App\Services\PromotionCart::updateFeeProduct($data);
} }
if($data['action'] === 'add-shop-product'){ if($data['action'] === 'add-shop-product'){
$data['qty'] = \App\Services\PromotionCart::updateProduct($data, true); $data['qty'] = \App\Services\PromotionCart::updateProduct($data, true);
$ret = view("web.promotion._promotion_cart", compact('data'))->render(); }
} if($data['action'] === 'update-shop-product'){
if($data['action'] === 'update-shop-product'){ $data['qty'] = \App\Services\PromotionCart::updateProduct($data);
$data['qty'] = \App\Services\PromotionCart::updateProduct($data); }
$ret = view("web.promotion._promotion_cart", compact('data'))->render(); if($data['action'] === 'remove-shop-product'){
} \App\Services\PromotionCart::updateProduct($data);
if($data['action'] === 'remove-shop-product'){ $data['qty'] = 0;
\App\Services\PromotionCart::updateProduct($data); }
$data['qty'] = 0; if($data['action'] === 'clear-cart'){
$ret = view("web.promotion._promotion_cart", compact('data'))->render(); \App\Services\PromotionCart::clearCart($data);
} }
if($data['action'] === 'clear-cart'){ if($data['action'] === 'switch-shipping'){
\App\Services\PromotionCart::clearCart($data); \App\Services\PromotionCart::switchShipping($data);
$ret = view("web.promotion._promotion_cart", compact('data'))->render(); }
} $cart = view("web.promotion._promotion_cart", compact('data'))->render();
if(Yard::instance('shopping')->isQuickShipping()){
$invoice = view("web.promotion._invoice_details_quick")->render();
}else{
$invoice = view("web.promotion._invoice_details")->render();
}
$checkout = view("web.promotion._checkout")->render();
if($data['action'] === 'switch-shipping'){ return response()->json(['response' => $data, 'cart'=>$cart, 'invoice'=>$invoice, 'checkout'=>$checkout, 'status'=>$status]);
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
} }
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]); return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
} }
} }

View file

@ -31,7 +31,11 @@ class MailCheckout extends Mailable
$this->mode = $mode; $this->mode = $mode;
if($this->txaction === 'paid'){ if($this->txaction === 'paid'){
$this->subject = __('email.checkout_subject_paid')." "; if($this->shopping_payment->clearingtype === 'non')
$this->subject = __('email.checkout_subject_non_paid')." ";
else{
$this->subject = __('email.checkout_subject_paid')." ";
}
}elseif($this->txaction === 'extern'){ }elseif($this->txaction === 'extern'){
$this->subject = __('email.checkout_subject_extern').": "; $this->subject = __('email.checkout_subject_extern').": ";
$this->subject .= $shopping_order->member->account->m_first_name." ".$shopping_order->member->account->m_last_name." - "; $this->subject .= $shopping_order->member->account->m_first_name." ".$shopping_order->member->account->m_last_name." - ";
@ -45,7 +49,6 @@ class MailCheckout extends Mailable
}*/ }*/
} }
public function build() public function build()
{ {
$salutation = __('email.hello').","; $salutation = __('email.hello').",";
@ -82,6 +85,5 @@ class MailCheckout extends Mailable
'mode' => $this->mode 'mode' => $this->mode
]); ]);
} }
} }
} }

View file

@ -53,6 +53,10 @@ use Illuminate\Database\Eloquent\Collection;
* @property-read int|null $promotion_admin_products_active_count * @property-read int|null $promotion_admin_products_active_count
* @method static \Illuminate\Database\Eloquent\Builder|PromotionAdmin whereShop($value) * @method static \Illuminate\Database\Eloquent\Builder|PromotionAdmin whereShop($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionAdmin whereType($value) * @method static \Illuminate\Database\Eloquent\Builder|PromotionAdmin whereType($value)
* @property string|null $user_description
* @property string|null $user_about
* @method static \Illuminate\Database\Eloquent\Builder|PromotionAdmin whereUserAbout($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionAdmin whereUserDescription($value)
*/ */
class PromotionAdmin extends Model class PromotionAdmin extends Model
{ {
@ -77,6 +81,8 @@ class PromotionAdmin extends Model
'type', 'type',
'name', 'name',
'description', 'description',
'user_description',
'user_about',
'from', 'from',
'to', 'to',
'shop', 'shop',

View file

@ -0,0 +1,126 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class PromotionUserOrder
*
* @property int $id
* @property int $promotion_admin_id
* @property int $promotion_user_id
* @property int $promotion_user_product_id
* @property int $product_id
* @property int $shopping_order_item_id
* @property int $shopping_order_id
* @property int $shopping_user_id
* @property int|null $qty
* @property float|null $price
* @property float|null $price_net
* @property float|null $tax_rate
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property Product $product
* @property PromotionAdmin $promotion_admin
* @property PromotionUser $promotion_user
* @property PromotionUserProduct $promotion_user_product
* @property ShoppingOrder $shopping_order
* @property ShoppingOrderItem $shopping_order_item
* @property ShoppingUser $shopping_user
* @package App\Models
* @property int|null $status
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder query()
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder wherePrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder wherePriceNet($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereProductId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder wherePromotionAdminId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder wherePromotionUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder wherePromotionUserProductId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereQty($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereShoppingOrderId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereShoppingOrderItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereShoppingUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereTaxRate($value)
* @method static \Illuminate\Database\Eloquent\Builder|PromotionUserOrder whereUpdatedAt($value)
* @mixin \Eloquent
*/
class PromotionUserOrder extends Model
{
protected $table = 'promotion_user_orders';
protected $casts = [
'promotion_admin_id' => 'int',
'promotion_user_id' => 'int',
'promotion_user_product_id' => 'int',
'product_id' => 'int',
'shopping_order_item_id' => 'int',
'shopping_order_id' => 'int',
'shopping_user_id' => 'int',
'qty' => 'int',
'price' => 'float',
'price_net' => 'float',
'tax_rate' => 'float',
'status' => 'int'
];
protected $fillable = [
'promotion_admin_id',
'promotion_user_id',
'promotion_user_product_id',
'product_id',
'shopping_order_item_id',
'shopping_order_id',
'shopping_user_id',
'qty',
'price',
'price_net',
'tax_rate',
'status'
];
public function product()
{
return $this->belongsTo(Product::class);
}
public function promotion_admin()
{
return $this->belongsTo(PromotionAdmin::class);
}
public function promotion_user()
{
return $this->belongsTo(PromotionUser::class);
}
public function promotion_user_product()
{
return $this->belongsTo(PromotionUserProduct::class);
}
public function shopping_order()
{
return $this->belongsTo(ShoppingOrder::class);
}
public function shopping_order_item()
{
return $this->belongsTo(ShoppingOrderItem::class);
}
public function shopping_user()
{
return $this->belongsTo(ShoppingUser::class);
}
}

View file

@ -41,6 +41,8 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $num_comp * @property int|null $num_comp
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice whereNumComp($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice whereNumComp($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice wherePriceComp($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice wherePriceComp($value)
* @property int|null $shipping_for
* @method static \Illuminate\Database\Eloquent\Builder|ShippingPrice whereShippingFor($value)
*/ */
class ShippingPrice extends Model class ShippingPrice extends Model
{ {

View file

@ -99,6 +99,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereShippedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereShippedAt($value)
* @property string|null $invoice_number * @property string|null $invoice_number
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereInvoiceNumber($value) * @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereInvoiceNumber($value)
* @property int|null $promotion_user_id
* @property string|null $shipping_option
* @property-read \App\Models\PromotionUser|null $promotion_user
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder wherePromotionUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereShippingOption($value)
*/ */
class ShoppingOrder extends Model class ShoppingOrder extends Model
{ {
@ -110,7 +115,9 @@ class ShoppingOrder extends Model
protected $fillable = [ protected $fillable = [
'shopping_user_id', 'shopping_user_id',
'auth_user_id', 'auth_user_id',
'promotion_user_id',
'member_id', 'member_id',
'payment_for',
'country_id', 'country_id',
'user_shop_id', 'user_shop_id',
'total', 'total',
@ -135,6 +142,7 @@ class ShoppingOrder extends Model
'mode', 'mode',
'shipped', 'shipped',
'shipped_at', 'shipped_at',
'shipping_option',
'tracking' 'tracking'
]; ];
@ -152,6 +160,15 @@ class ShoppingOrder extends Model
10 => 'storniert' 10 => 'storniert'
]; ];
public static $paymentForTypes = [
0 => '',
1 => 'wizzard',
2 => 'user_order me',
3 => 'user_order ot',
4 => 'Promotion',
10 => ''
];
public static $apiShippedTypes = [ public static $apiShippedTypes = [
0 => 'open', //(Fullfilment durch Händler)', 0 => 'open', //(Fullfilment durch Händler)',
1 => 'process', //(Fullfilment durch MIVITA: nicht Versand) 1 => 'process', //(Fullfilment durch MIVITA: nicht Versand)
@ -183,6 +200,11 @@ class ShoppingOrder extends Model
return $this->belongsTo('App\Models\ShippingCountry','country_id'); return $this->belongsTo('App\Models\ShippingCountry','country_id');
} }
public function promotion_user()
{
return $this->belongsTo('App\Models\PromotionUser','promotion_user_id');
}
//can null //can null
public function member() public function member()
{ {

View file

@ -45,6 +45,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @property float|null $price_net * @property float|null $price_net
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem whereComp($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem whereComp($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem wherePriceNet($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem wherePriceNet($value)
* @property int|null $free_product_id
* @property-read \App\Models\PromotionUserProduct|null $promotion_user_product
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderItem whereFreeProductId($value)
*/ */
class ShoppingOrderItem extends Model class ShoppingOrderItem extends Model
{ {
@ -58,6 +61,7 @@ class ShoppingOrderItem extends Model
'row_id', 'row_id',
'product_id', 'product_id',
'comp', 'comp',
'free_product_id',
'qty', 'qty',
'price', 'price',
'price_net', 'price_net',
@ -97,4 +101,14 @@ class ShoppingOrderItem extends Model
return formatNumber($this->attributes['price_net'] * $this->attributes['qty']); return formatNumber($this->attributes['price_net'] * $this->attributes['qty']);
} }
public function isFreeProduct()
{
return $this->free_product_id > 0 ? true : false;
}
public function promotion_user_product()
{
return $this->belongsTo('App\Models\PromotionUserProduct','free_product_id');
}
} }

View file

@ -88,6 +88,9 @@ class ShoppingPayment extends Model
if($this->clearingtype === 'fnc') { if($this->clearingtype === 'fnc') {
return 'Rechnung'; return 'Rechnung';
} }
if($this->clearingtype === 'non') {
return 'keine';
}
} }
public function getPaymentAmount(){ public function getPaymentAmount(){

View file

@ -48,7 +48,8 @@ class UserPayCredit extends Model
2 => 'deduction from payment', 2 => 'deduction from payment',
3 => 'manually added credit', 3 => 'manually added credit',
4 => 'return from order', 4 => 'return from order',
5 => 'deduction from promotion',
6 => 'return from promotion',
]; ];
protected $table = 'user_pay_credits'; protected $table = 'user_pay_credits';

View file

@ -72,7 +72,7 @@ class RouteServiceProvider extends ServiceProvider
*/ */
protected function mapApiRoutes() protected function mapApiRoutes()
{ {
Route::domain('api.'.config('app.domain')) Route::domain('api.'.config('app.api_domain'))
->middleware('api') ->middleware('api')
->namespace($this->namespace) ->namespace($this->namespace)
->group(base_path('routes/api.php')); ->group(base_path('routes/api.php'));

View file

@ -0,0 +1,226 @@
<?php
namespace App\Repositories;
use Yard;
use App\Services\Shop;
use App\Services\Util;
use App\Models\ShoppingUser;
use App\Models\PromotionUser;
use App\Models\ShoppingOrder;
use App\Models\ShoppingOrderItem;
use App\Services\CustomerPriority;
use Illuminate\Support\Collection;
use Illuminate\Session\SessionManager;
use App\Http\Controllers\Pay\PayController;
class CheckoutRepository {
private $payment_for;
private $PromotionUser;
private $session;
private $instance;
private $shopping_user;
private $shopping_order;
private $identifier;
private $data;
public function __construct()
{
$this->session = app(SessionManager::class);;
$this->instance = sprintf('%s.%s', 'cart', 'payments');
}
public function setPromotion($payment_for, PromotionUser $PromotionUser)
{
$this->payment_for = $payment_for;
$this->PromotionUser = $PromotionUser;
}
public function init($identifier, $data)
{
$this->identifier = $identifier;
$this->data = $data;
if($this->getPayments('identifier') !== $identifier){
$this->destroy();
$this->putPayments('identifier', $identifier);
}
$shopping_data = Yard::instance('shopping')->getYardExtra('shopping_data');
$this->data['is_from'] = isset($shopping_data['is_from']) ? $shopping_data['is_from'] : 'shopping'; //shopping
$this->data['is_from'] = isset($shopping_data['is_for']) ? $shopping_data['is_for'] : 'pr'; //promotion
$this->shopping_user = $this->makeShoppingUser($data);
$this->shopping_order = $this->makeShoppingOrder($this->shopping_user);
//CustomerPriority
if($this->shopping_user->is_from === 'shopping'){
CustomerPriority::checkOne(ShoppingUser::find($this->shopping_user->id), true);
}
Util::setUserHistoryValue(['status'=>2, 'shopping_order_id'=>$this->shopping_order->id], $this->identifier);
}
public function makePayment()
{
//check credi t Card
if(!isset($this->data['payment_method'])){
$this->data['payment_method'] = 'non';
}
$ret = [];
//Rechnungskauf ohne PAYONE
if($this->data['payment_method'] === 'fnc#MIV'){
}
if($this->data['payment_method'] === 'pp'){
}
//other
$pay = new PayController();
$pay->init($this->shopping_user, $this->shopping_order);
$amount = Yard::instance('shopping')->totalWithShipping(2, '.', '') * 100;
$reference = $pay->setPrePayment($this->data['payment_method'], $amount, 'EUR', $ret);
$this->putPayments('payment_reference', $reference);
$pay->setPersonalData();
return $pay->ResponseData($this->identifier, $this->payment_for);
}
private function makeShoppingUser($data){
$data['same_as_billing'] = isset($data['same_as_billing']) ? false : true; //reinvert
$data['accepted_data'] = isset($data['accepted_data']) ? true : false;
$data['billing_country_id'] = Shop::getShippingCountryCountryId($data['billing_state']);
$data['shipping_country_id'] = $data['billing_country_id'];
$data['member_id'] = $this->PromotionUser->user_id;
if(isset($data['shipping_state'])){
$data['shipping_country_id'] = Shop::getShippingCountryCountryId($data['shipping_state']);
}
$shopping_user = false;
if($this->getPayments('shopping_user_id')){
$shopping_user = ShoppingUser::find($this->getPayments('shopping_user_id'));
if($shopping_user){
$shopping_user->fill($data);
$shopping_user->mode = null;
$shopping_user->save();
}
}
if(!$shopping_user){
$shopping_user = ShoppingUser::create($data);
}
$this->putPayments('shopping_user_id', $shopping_user->id);
return $shopping_user;
}
private function makeShoppingOrder($shopping_user){
$data = [
'shopping_user_id' => $shopping_user->id,
'auth_user_id' => $shopping_user->auth_user_id,
'promotion_user_id' => $this->PromotionUser->id,
'country_id' => Yard::instance('shopping')->getShippingCountryId(),
'payment_for' => $this->payment_for,
'total' => Yard::instance('shopping')->total(2, '.', ''),
'subtotal_full' => Yard::instance('shopping')->subtotal(2, '.', '', false),
'discount' => 0,
'subtotal' => Yard::instance('shopping')->subtotal(2, '.', ''),
'shipping' => Yard::instance('shopping')->shipping(2, '.', ','),
'shipping_net' => Yard::instance('shopping')->shippingNet(2, '.', ''),
'subtotal_shipping' => Yard::instance('shopping')->subtotalWithShipping(2, '.', ''),
'tax' => Yard::instance('shopping')->taxWithShipping(2, '.', ''),
'total_without_credit' => Yard::instance('shopping')->totalWithShippingWithoutCredit(2, '.', ''),
'payment_credit' => Yard::instance('shopping')->totalfromCredit(2, '.', ''),
'total_shipping' => Yard::instance('shopping')->totalWithShipping(2, '.', ''),
'points' => Yard::instance('shopping')->points(),
'weight' => Yard::instance('shopping')->weight(),
'txaction' => 'prev',
'shipping_option' => Yard::instance('shopping')->getShippingOption(),
'mode' => Util::getUserShoppingMode(),
];
$shopping_order= false;
if($this->getPayments('shopping_order_id')){
$shopping_order = ShoppingOrder::find($this->getPayments('shopping_order_id'));
if($shopping_order){
$shopping_order->fill($data);
$shopping_order->save();
}
}
if(!$shopping_order){
$shopping_order = ShoppingOrder::create($data);
}
//$this->makeOrderMargin($shopping_order);
$this->putPayments('shopping_order_id', $shopping_order->id);
$items = Yard::instance('shopping')->getContentByOrder();
$shopping_order->shopping_order_items()->each(function($model) use ($items, $shopping_order, $shopping_user) {
foreach ($items as $item) {
if ($model->row_id === $item->rowId) {
$data = [
'shopping_order_id' => $shopping_order->id,
'row_id' => $item->rowId,
'product_id' => $item->id,
'free_product_id' => $item->options->free_product_id, //promotion_user_product_id
'qty' => $item->qty,
'price' => $item->price,
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
'tax_rate' => $item->taxRate,
'slug' => $item->options->slug,
];
$model->fill($data)->save();
return false;
}
}
return $model->delete();
});
foreach ($items as $item) {
if (!ShoppingOrderItem::where('shopping_order_id', $shopping_order->id)->where('row_id', $item->rowId)->count()){
$data = [
'shopping_order_id' => $shopping_order->id,
'row_id' => $item->rowId,
'product_id' => $item->id,
'free_product_id' => $item->options->free_product_id, //promotion_user_product_id
'qty' => $item->qty,
'price' => $item->price,
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
'tax_rate' => $item->taxRate,
'slug' => $item->options->slug
];
$shopping_order_item = ShoppingOrderItem::create($data);
}
}
return $shopping_order;
}
private function putPayments($key, $value){
$content = $this->getContent();
$content->put($key, $value);
$this->session->put($this->instance, $content);
}
private function getPayments($key){
$content = $this->getContent();
if ($content->has($key)){
return $content->get($key);
}
return false;
}
private function getContent()
{
if (is_null($this->session->get($this->instance))) {
return new Collection([]);
}
return $this->session->get($this->instance);
}
public function destroy()
{
$this->session->remove($this->instance);
}
}

View file

@ -29,10 +29,19 @@ class CustomerPriority
return $shopping_users; return $shopping_users;
} }
public static function checkOne($shopping_user, $mail=false, $newCustomer = true){ public static function checkOne($shopping_user, $mail=false, $newCustomer = true, $entryExistsLike = false){
//look for entry //look for entry
if(self::entryExists($shopping_user)){ if($entryExistsLike){
return 'exists'; if(self::entryExistsLike($shopping_user)){
if($mail){ //send mail
Mail::to(config('app.info_mail'))->send(new MailInfo($shopping_user, 'check_is_like_customer'));
}
return 'exists';
}
}else{
if(self::entryExists($shopping_user)){
return 'exists';
}
} }
if(self::entryLike($shopping_user)){ if(self::entryLike($shopping_user)){
if($mail){ //send mail if($mail){ //send mail
@ -122,6 +131,7 @@ class CustomerPriority
->where('number', '!=', NULL) //has number ->where('number', '!=', NULL) //has number
->where('id', '!=', $shopping_user->id) ->where('id', '!=', $shopping_user->id)
->where('billing_email', '=', $data['billing_email']) ->where('billing_email', '=', $data['billing_email'])
->where('member_id', '!=', $shopping_user->member_id)
->get()->pluck('number', 'id')->unique()->toArray(); ->get()->pluck('number', 'id')->unique()->toArray();
if($found && count($found)){ if($found && count($found)){
foreach ($found as $key=>$val){ foreach ($found as $key=>$val){
@ -139,6 +149,7 @@ class CustomerPriority
->where('id', '!=', $shopping_user->id) ->where('id', '!=', $shopping_user->id)
->where('billing_lastname', '=', $data['billing_lastname']) ->where('billing_lastname', '=', $data['billing_lastname'])
->where('billing_zipcode', '=', $data['billing_zipcode']) ->where('billing_zipcode', '=', $data['billing_zipcode'])
->where('member_id', '!=', $shopping_user->member_id)
->get()->pluck('number', 'id')->unique()->toArray(); ->get()->pluck('number', 'id')->unique()->toArray();
if($found && count($found)){ if($found && count($found)){
foreach ($found as $key=>$val){ foreach ($found as $key=>$val){
@ -193,11 +204,30 @@ class CustomerPriority
$shopping_user->shopping_order->member_id = $match->member_id; $shopping_user->shopping_order->member_id = $match->member_id;
$shopping_user->shopping_order->save(); $shopping_user->shopping_order->save();
} }
\App\Services\Shop::newUserOrder($shopping_user->number);
return true; return true;
} }
return false; return false;
} }
private static function entryExistsLike($shopping_user)
{
$matches = ShoppingUser::where('auth_user_id', '=', NULL)
->where('number', '!=', NULL) //has number
->where('id', '!=', $shopping_user->id)
->where('member_id', '!=', $shopping_user->member_id)
->where('billing_email', '=', $shopping_user->billing_email)
->get()->pluck('number', 'id')->unique()->toArray();
if($matches && count($matches)){
$shopping_user->is_like = true;
$shopping_user->setNotice(self::$user_notice_key, $matches);
$shopping_user->save();
return true;
}
return false;
}
private static function entryLike($shopping_user){ private static function entryLike($shopping_user){
//check same last name und PLZ //check same last name und PLZ
$matches = ShoppingUser::select('*') $matches = ShoppingUser::select('*')
@ -217,13 +247,16 @@ class CustomerPriority
} }
private static function newCustomer($shopping_user){ private static function newCustomer($shopping_user){
if($shopping_user->shopping_order && $shopping_user->shopping_order->member_id) { if($shopping_user->member_id) {
$member_id = $shopping_user->shopping_order->member_id; $member_id = $shopping_user->member_id;
$shopping_user->member_id = $member_id; $shopping_user->member_id = $member_id;
$shopping_user->number = self::nextNumber(); $shopping_user->number = self::nextNumber();
$shopping_user->save(); $shopping_user->save();
$shopping_user->shopping_order->member_id = $member_id; if($shopping_user->shopping_order){
$shopping_user->shopping_order->save(); $shopping_user->shopping_order->member_id = $member_id;
$shopping_user->shopping_order->save();
}
\App\Services\Shop::newUserOrder($shopping_user->number);
} }
} }
@ -233,7 +266,6 @@ class CustomerPriority
$shopping_user->number = self::nextNumber(); $shopping_user->number = self::nextNumber();
$shopping_user->save(); $shopping_user->save();
\App\Services\Shop::newUserOrder($shopping_user->number); \App\Services\Shop::newUserOrder($shopping_user->number);
} }
private static function changeCustomer($shopping_user, $member_id, $number){ private static function changeCustomer($shopping_user, $member_id, $number){

View file

@ -11,6 +11,7 @@ use App\Models\ShoppingOrder;
use App\Models\UserPayCredit; use App\Models\UserPayCredit;
use App\Models\ShoppingPayment; use App\Models\ShoppingPayment;
use App\Models\UserCreditMargin; use App\Models\UserCreditMargin;
use App\Models\PromotionUserOrder;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
class Payment class Payment
@ -135,7 +136,7 @@ class Payment
} }
} }
} }
/**/
public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){ public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){
$send_link = false; $send_link = false;
@ -197,7 +198,6 @@ class Payment
} }
} }
//if the order has action //if the order has action
if($shopping_order->shopping_user->is_from === 'user_order'){ if($shopping_order->shopping_user->is_from === 'user_order'){
//is margin -> set paid //is margin -> set paid
@ -209,10 +209,44 @@ class Payment
return $send_link; return $send_link;
} }
public static function handelPromotionProduct(ShoppingOrder $shopping_order){
//add the Promotion Product to Order
$shopping_order = ShoppingOrder::find($shopping_order->id);
foreach($shopping_order->shopping_order_items as $shopping_order_item){
if($shopping_order_item->isFreeProduct()){
if($promotion_user_product = $shopping_order_item->promotion_user_product){
$promotion_admin_product = $promotion_user_product->promotion_admin_product;
$PromotionUserOrder = PromotionUserOrder::create([
'promotion_admin_id' => $promotion_user_product->promotion_admin_id,
'promotion_user_id' => $shopping_order->promotion_user_id,
'promotion_user_product_id' => $promotion_user_product->id,
'product_id' => $promotion_user_product->product_id,
'shopping_order_item_id' => $shopping_order_item->id,
'shopping_order_id' => $shopping_order->id,
'shopping_user_id' => $shopping_order->shopping_user_id,
'qty' => $shopping_order_item->qty,
'price' => $promotion_admin_product->getPriceWith(false),
'price_net' => $promotion_admin_product->getPriceWith(true),
'tax_rate' => $promotion_admin_product->product->tax,
]);
$promotion_user_product->open_items -= $PromotionUserOrder->qty;
$promotion_user_product->sell_items += $PromotionUserOrder->qty;
$promotion_user_product->used_budget_total += $PromotionUserOrder->price;
$promotion_user_product->save();
//TODO Guthaben abziehen
self::addUserPayCredits($promotion_user_product->promotion_user->user, ($PromotionUserOrder->price*-1), 5, 'promotion_order_deduction', $shopping_order->id);
}
}
}
}
//remove form credit, every sale fnc / vor / etc from CheckoutController //remove form credit, every sale fnc / vor / etc from CheckoutController
//when stone, put it back SalesController //when stone, put it back SalesController
public static function handelUserPayCredits(ShoppingOrder $shopping_order, $do){ public static function handelUserPayCredits(ShoppingOrder $shopping_order, $do){
//is payment credit, reduce Sae //is payment credit, deduction or return
if(!$shopping_order->shopping_order_margin){ if(!$shopping_order->shopping_order_margin){
return; return;
} }

View file

@ -35,11 +35,19 @@ class PromotionCart
} }
} }
public static function clearCart($data, $add=false) public static function clearCart($data)
{ {
Yard::instance('shopping')->destroy(); Yard::instance('shopping')->destroy();
} }
public static function switchShipping($data)
{
//pick_up//dhl_shipping
Yard::instance('shopping')->setShippingOption($data['shipping_option']);
Yard::instance('shopping')->reCalculateShippingPrice();
}
public static function updateProduct($data, $add=false) public static function updateProduct($data, $add=false)
{ {
if($product = Product::find($data['product_id'])){ if($product = Product::find($data['product_id'])){
@ -77,13 +85,13 @@ class PromotionCart
//wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl //wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl
//wenn gleich löschen, da neue Versandkosten //wenn gleich löschen, da neue Versandkosten
if($row->options->free_product) { if($row->options->free_product_id) {
Yard::instance('shopping')->remove($row->rowId); Yard::instance('shopping')->remove($row->rowId);
} }
} }
if(isset($data['free_poduct_id'])) { if(isset($data['free_product_id'])) {
if ($product = Product::find($data['free_poduct_id'])) { if ($product = Product::find($data['product_id'])) {
$image = ""; $image = "";
if ($product->images->count()) { if ($product->images->count()) {
$image = $product->images->first()->slug; $image = $product->images->first()->slug;
@ -92,8 +100,8 @@ class PromotionCart
[ [
'image' => $image, 'image' => $image,
'slug' => $product->slug, 'slug' => $product->slug,
'weight' => 0, 'weight' => $product->weight,
'free_product' => 1, 'free_product_id' => intval($data['free_product_id']),
'product_id' => $product->id 'product_id' => $product->id
]); ]);
Yard::setTax($cartItem->rowId, 0); Yard::setTax($cartItem->rowId, 0);

View file

@ -44,6 +44,7 @@ class Yard extends Cart
private $yard_margin; private $yard_margin;
private $global_tax_rate = 0; private $global_tax_rate = 0;
private $shipping_option; //pick_up//dhl_shipping
public function __construct(SessionManager $session, Dispatcher $events) public function __construct(SessionManager $session, Dispatcher $events)
{ {
@ -53,42 +54,33 @@ class Yard extends Cart
if($this->getYardExtra('shipping_price')){ if($this->getYardExtra('shipping_price')){
$this->shipping_price = (float) ($this->getYardExtra('shipping_price')); $this->shipping_price = (float) ($this->getYardExtra('shipping_price'));
} }
if($this->getYardExtra('shipping_price_net')){ if($this->getYardExtra('shipping_price_net')){
$this->shipping_price_net = (float) ($this->getYardExtra('shipping_price_net')); $this->shipping_price_net = (float) ($this->getYardExtra('shipping_price_net'));
} }
if($this->getYardExtra('shipping_tax_rate')){ if($this->getYardExtra('shipping_tax_rate')){
$this->shipping_tax_rate = (float) ($this->getYardExtra('shipping_tax_rate')); $this->shipping_tax_rate = (float) ($this->getYardExtra('shipping_tax_rate'));
} }
if($this->getYardExtra('shipping_tax')){ if($this->getYardExtra('shipping_tax')){
$this->shipping_tax = (float) ($this->getYardExtra('shipping_tax')); $this->shipping_tax = (float) ($this->getYardExtra('shipping_tax'));
} }
if($this->getYardExtra('shipping_country_id')){ if($this->getYardExtra('shipping_country_id')){
$this->shipping_country_id = $this->getYardExtra('shipping_country_id'); $this->shipping_country_id = $this->getYardExtra('shipping_country_id');
} }
if($this->getYardExtra('shipping_is_for')){ if($this->getYardExtra('shipping_is_for')){
$this->shipping_is_for = $this->getYardExtra('shipping_is_for'); $this->shipping_is_for = $this->getYardExtra('shipping_is_for');
} }
if($this->getYardExtra('shopping_user')){ if($this->getYardExtra('shopping_user')){
$this->user = $this->getYardExtra('shopping_user'); $this->user = $this->getYardExtra('shopping_user');
} }
if($this->getYardExtra('user')){ if($this->getYardExtra('user')){
$this->user = $this->getYardExtra('user'); $this->user = $this->getYardExtra('user');
} }
if($this->getYardExtra('payment_credit')){ if($this->getYardExtra('payment_credit')){
$this->payment_credit = $this->getYardExtra('payment_credit'); $this->payment_credit = $this->getYardExtra('payment_credit');
} }
if($this->getYardExtra('yard_commission')){ if($this->getYardExtra('yard_commission')){
$this->yard_commission = $this->getYardExtra('yard_commission'); $this->yard_commission = $this->getYardExtra('yard_commission');
} }
if($this->getYardExtra('yard_margin')){ if($this->getYardExtra('yard_margin')){
$this->yard_margin = $this->getYardExtra('yard_margin'); $this->yard_margin = $this->getYardExtra('yard_margin');
} }
@ -97,10 +89,12 @@ class Yard extends Cart
}else{ }else{
$this->global_tax_rate = config('cart.tax'); $this->global_tax_rate = config('cart.tax');
} }
if($this->getYardExtra('num_comp')){ if($this->getYardExtra('num_comp')){
$this->num_comp = $this->getYardExtra('num_comp'); $this->num_comp = $this->getYardExtra('num_comp');
} }
if($this->getYardExtra('shipping_option')){
$this->shipping_option = $this->getYardExtra('shipping_option');
}
parent::__construct($session, $events); parent::__construct($session, $events);
@ -123,10 +117,31 @@ class Yard extends Cart
} }
public function setGlobalTaxRate($value){ public function setGlobalTaxRate($value){
$this->global_tax_rate = floatval($value); $this->global_tax_rate = floatval($value);
$this->putYardExtra('global_tax_rate', $this->global_tax_rate); $this->putYardExtra('global_tax_rate', $this->global_tax_rate);
}
public function setShippingOption($value){
$this->shipping_option = $value;
$this->putYardExtra('shipping_option', $this->shipping_option);
}
public function getShippingOption(){
return $this->shipping_option;
}
public function isQuickShipping(){
if($this->shipping_option === 'pick_up' && $this->totalWithShipping(2, '.', '') == 0.00){
return true;
}
return false;
}
public function isWithPayments(){
if($this->totalWithShipping(2, '.', '') == 0.00){
return false;
}
return true;
} }
public function putYardExtra($key, $value){ public function putYardExtra($key, $value){
@ -272,7 +287,6 @@ class Yard extends Cart
} }
} }
$margin->setCommission($this->yard_commission); $margin->setCommission($this->yard_commission);
$margin->calculate(); $margin->calculate();
@ -318,6 +332,15 @@ class Yard extends Cart
private function calculateShippingPrice(){ private function calculateShippingPrice(){
if($this->shipping_option && $this->shipping_option === 'pick_up'){
$this->shipping_price = 0;
$this->shipping_tax_rate = 0;
$this->shipping_price_net = 0;
$this->shipping_tax = 0;
$this->putShippingPrices();
return;
}
$shippingCountry = ShippingCountry::find($this->shipping_country_id); $shippingCountry = ShippingCountry::find($this->shipping_country_id);
if(!$shippingCountry){ if(!$shippingCountry){
return; return;
@ -346,7 +369,6 @@ class Yard extends Cart
} }
//default //default
if(!$shipping_price){ if(!$shipping_price){
$shipping_price = $shipping->getShippingPricesBy($shipping_price_for)->first(); $shipping_price = $shipping->getShippingPricesBy($shipping_price_for)->first();
} }
} }
@ -368,14 +390,18 @@ class Yard extends Cart
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2); $this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2); $this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
$this->putYardExtra('num_comp', $this->num_comp); $this->putShippingPrices();
$this->putYardExtra('shipping_price', $this->shipping_price);
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
$this->putYardExtra('shipping_tax', $this->shipping_tax);
$this->putYardExtra('shipping_price_net', $this->shipping_price_net);
} }
} }
private function putShippingPrices(){
$this->putYardExtra('num_comp', $this->num_comp);
$this->putYardExtra('shipping_price', $this->shipping_price);
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
$this->putYardExtra('shipping_tax', $this->shipping_tax);
$this->putYardExtra('shipping_price_net', $this->shipping_price_net);
}
private function shippingPriceBySubTotal($prices, $total){ private function shippingPriceBySubTotal($prices, $total){
foreach ($prices as $price){ foreach ($prices as $price){
if($price->total_from > 0 && $price->total_to > 0){ if($price->total_from > 0 && $price->total_to > 0){
@ -386,6 +412,7 @@ class Yard extends Cart
} }
return false; return false;
} }
private function shippingPriceByWeight($prices, $weight){ private function shippingPriceByWeight($prices, $weight){
foreach ($prices as $price){ foreach ($prices as $price){
if($price->weight_from > 0 && $price->weight_to > 0){ if($price->weight_from > 0 && $price->weight_to > 0){
@ -686,8 +713,8 @@ class Yard extends Cart
public function getFreeProductId(){ public function getFreeProductId(){
foreach ($this->content() as $row) { foreach ($this->content() as $row) {
if($row->options->free_product) { if($row->options->free_product_id) {
return $row->options->product_id; return $row->options->free_product_id;
} }
} }
return false; return false;
@ -699,6 +726,8 @@ class Yard extends Cart
foreach ($this->content() as $row) { foreach ($this->content() as $row) {
if($row->options->comp){ if($row->options->comp){
$comp[100+$row->options->comp] = $row; $comp[100+$row->options->comp] = $row;
}elseif($row->options->free_product_id){
$comp[200] = $row;
}else{ }else{
$ret[] = $row; $ret[] = $row;
} }

View file

@ -51,6 +51,7 @@ return [
| your application so that it is used when running Artisan tasks. | your application so that it is used when running Artisan tasks.
| |
*/ */
'api_domain' => env('APP_API_DOMAIN', 'gruene-seele.bio'),
'url' => env('APP_URL', 'https://partner.gruene-seele.bio'), 'url' => env('APP_URL', 'https://partner.gruene-seele.bio'),
'domain' => env('APP_DOMAIN', 'partner.gruene-seele.bio'), 'domain' => env('APP_DOMAIN', 'partner.gruene-seele.bio'),

25
config/paypal.php Normal file
View file

@ -0,0 +1,25 @@
<?php
/**
* PayPal Setting & API Credentials
* Created by Raza Mehdi <srmk@outlook.com>.
*/
return [
'mode' => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used.
'sandbox' => [
'client_id' => env('PAYPAL_SANDBOX_CLIENT_ID', ''),
'client_secret' => env('PAYPAL_SANDBOX_CLIENT_SECRET', ''),
'app_id' => 'APP-80W284485P519543T',
],
'live' => [
'client_id' => env('PAYPAL_LIVE_CLIENT_ID', ''),
'client_secret' => env('PAYPAL_LIVE_CLIENT_SECRET', ''),
'app_id' => env('PAYPAL_LIVE_APP_ID', ''),
],
'payment_action' => env('PAYPAL_PAYMENT_ACTION', 'Sale'), // Can only be 'Sale', 'Authorization' or 'Order'
'currency' => env('PAYPAL_CURRENCY', 'EUR'),
'notify_url' => env('PAYPAL_NOTIFY_URL', ''), // Change this accordingly for your application.
'locale' => env('PAYPAL_LOCALE', 'de_DE'), // force gateway language i.e. it_IT, es_ES, en_US ... (for express checkout only)
'validate_ssl' => env('PAYPAL_VALIDATE_SSL', true), // Validate SSL when creating api client.
];

View file

@ -30,7 +30,6 @@ class CreateShoppingOrdersTable extends Migration
$table->decimal('discount', 13, 2)->nullable(); $table->decimal('discount', 13, 2)->nullable();
$table->decimal('subtotal', 13, 2)->nullable(); $table->decimal('subtotal', 13, 2)->nullable();
$table->decimal('shipping', 8, 2)->nullable(); $table->decimal('shipping', 8, 2)->nullable();
$table->decimal('shipping_net', 8, 2)->nullable(); $table->decimal('shipping_net', 8, 2)->nullable();
@ -55,6 +54,7 @@ class CreateShoppingOrdersTable extends Migration
$table->string('txaction', 20)->nullable()->index(); $table->string('txaction', 20)->nullable()->index();
$table->unsignedTinyInteger('shipped')->default(0); $table->unsignedTinyInteger('shipped')->default(0);
$table->timestamp('shipped_at')->nullable(); $table->timestamp('shipped_at')->nullable();
$table->string('shipping_option', 20)->nullable()->index();
$table->string('tracking', 255)->nullable(); $table->string('tracking', 255)->nullable();

View file

@ -21,12 +21,11 @@ class CreateShoppingOrderItemsTable extends Migration
$table->unsignedInteger('product_id'); $table->unsignedInteger('product_id');
$table->unsignedTinyInteger('comp')->nullable(); $table->unsignedTinyInteger('comp')->nullable();
$table->unsignedTinyInteger('free_product')->nullable();
$table->unsignedInteger('qty'); $table->unsignedInteger('qty');
$table->decimal('price', 8, 2)->nullable(); $table->decimal('price', 8, 2)->nullable();
$table->decimal('price_net', 8, 3)->nullable(); $table->decimal('price_net', 8, 3)->nullable();
$table->decimal('tax_rate', 5, 2)->nullable(); $table->decimal('tax_rate', 5, 2)->nullable();
$table->string('slug')->nullable(); $table->string('slug')->nullable();

View file

@ -20,6 +20,8 @@ class CreatePromotionAdminsTable extends Migration
$table->string('name', 255); $table->string('name', 255);
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->text('user_description')->nullable();
$table->text('user_about')->nullable();
$table->date('from')->nullable(); $table->date('from')->nullable();
$table->date('to')->nullable(); $table->date('to')->nullable();

View file

@ -14,6 +14,7 @@ class CreatePromotionUserProductsTable extends Migration
public function up() public function up()
{ {
Schema::create('promotion_user_products', function (Blueprint $table) { Schema::create('promotion_user_products', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->unsignedInteger('promotion_admin_id')->index(); $table->unsignedInteger('promotion_admin_id')->index();

View file

@ -0,0 +1,76 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePromotionUserOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('promotion_user_orders', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('promotion_admin_id')->index();
$table->unsignedInteger('promotion_user_id')->index();
$table->unsignedInteger('promotion_user_product_id')->index();
$table->unsignedInteger('product_id')->index();
$table->unsignedInteger('shopping_order_item_id')->index();
$table->unsignedInteger('shopping_order_id')->index();
$table->unsignedInteger('shopping_user_id')->index();
$table->unsignedSmallInteger('qty')->nullable();
$table->decimal('price', 8, 2)->nullable();
$table->decimal('price_net', 8, 3)->nullable();
$table->decimal('tax_rate', 5, 2)->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->foreign('promotion_admin_id')
->references('id')
->on('promotion_admins');
$table->foreign('promotion_user_id')
->references('id')
->on('promotion_users');
$table->foreign('promotion_user_product_id')
->references('id')
->on('promotion_user_products');
$table->foreign('product_id')
->references('id')
->on('products');
$table->foreign('shopping_order_item_id')
->references('id')
->on('shopping_order_items');
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
$table->foreign('shopping_user_id')
->references('id')
->on('shopping_users');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('promotion_user_orders');
}
}

View file

@ -251,7 +251,7 @@ label .required {
transition: box-shadow 0.4s ease; transition: box-shadow 0.4s ease;
position: relative; position: relative;
background-color: #fafafa; background-color: #fafafa;
padding: 30px 30px 40px; padding: 30px 20px 40px;
} }
.checkout-order:before { .checkout-order:before {

View file

@ -77,7 +77,6 @@ var IqPromotionCart = {
tempData.push({product_id: $(this).data('product-id'), qty: $(this).val()}); tempData.push({product_id: $(this).data('product-id'), qty: $(this).val()});
} }
}); });
data.action = $(_self.table).data('action'); data.action = $(_self.table).data('action');
data.user_promotion_id = $(_self.table).data('user_promotion_id'); data.user_promotion_id = $(_self.table).data('user_promotion_id');
data.products = tempData; data.products = tempData;
@ -90,10 +89,14 @@ var IqPromotionCart = {
console.log("s"); console.log("s");
var _self = this; var _self = this;
$('.calculate_product_qty_price').each(function(){ $('.calculate_product_qty_price_total').each(function(){
var qty = _self.checkNumber($(_self.table).find('#'+$(this).data('qty-id')).val());; var admin_product_id = $(this).data('admin_product_id');
var price = $(this).data('price'); var price = $(this).data('price');
var total = price*qty; var total = 0;
if($('#product_check_' + admin_product_id).is(':checked')){
var qty = _self.checkNumber($(_self.table).find('#product_qty_' + admin_product_id).val());;
var total = price*qty;
}
$(this).html(total.toFixed(2).replace('.', ',')) $(this).html(total.toFixed(2).replace('.', ','))
}); });
}, },

View file

@ -17,8 +17,10 @@ var IqPromotionShopCart = {
url: null, url: null,
action: null, action: null,
cart_holder: '#promotion_cart_holder', cart_holder: '#promotion_cart_holder',
invoice_holder: '#invoice_details_holder',
checkout_holder: '#promotion_checkout_holder',
free_poduct_id: null, free_product_id: null,
shipping_option: null, shipping_option: null,
@ -77,9 +79,9 @@ var IqPromotionShopCart = {
switchFreeProduct: function(_ele){ switchFreeProduct: function(_ele){
var _self = this; var _self = this;
if(_ele.prop('checked')){ if(_ele.prop('checked')){
if(_self.free_poduct_id != _ele.val()){ if(_self.free_product_id != _ele.val()){
_self.free_poduct_id = _ele.val(); _self.free_product_id = _ele.val();
_self.performRequest({free_poduct_id: _self.free_poduct_id, action: 'switch-free-product'}) _self.performRequest({free_product_id: _self.free_product_id, product_id: _ele.data('product_id'), action: 'switch-free-product'})
.done(_self.refreshItemsAndView); .done(_self.refreshItemsAndView);
} }
} }
@ -119,12 +121,21 @@ var IqPromotionShopCart = {
var qty = data.response.qty > 0 ? "x"+data.response.qty : 0; var qty = data.response.qty > 0 ? "x"+data.response.qty : 0;
$('#badge_cart_indicator_'+data.response.product_id).html(qty); $('#badge_cart_indicator_'+data.response.product_id).html(qty);
} }
$(_self.cart_holder).html(data.html); if(data.cart){
$(_self.cart_holder).html(data.cart);
}
if(data.invoice){
$(_self.invoice_holder).html(data.invoice);
}
if(data.checkout){
$(_self.checkout_holder).html(data.checkout);
}
_self.showInit(); _self.showInit();
}, },
performRequest : function(data) { performRequest : function(data) {
var _self = this; var _self = this;
var url = _self.url; var url = _self.url;
data.perform = true;
_log(data); _log(data);
// _log(url); // _log(url);
return $.ajax({ return $.ajax({

View file

@ -15,6 +15,7 @@
'your_request_from' => 'Deine Anfrage von', 'your_request_from' => 'Deine Anfrage von',
'checkout_subject' => 'Deine Bestellung', 'checkout_subject' => 'Deine Bestellung',
'checkout_subject_paid' => 'Zahlungsbestätigung - Deine Bestellung', 'checkout_subject_paid' => 'Zahlungsbestätigung - Deine Bestellung',
'checkout_subject_non_paid' => 'Bestätigung - Deine Bestellung',
'checkout_subject_extern' => 'Neue Bestellung', 'checkout_subject_extern' => 'Neue Bestellung',
'change_e_mail' => 'E-Mail Adresse ändern', 'change_e_mail' => 'E-Mail Adresse ändern',
'salutation' => 'Hallo', 'salutation' => 'Hallo',
@ -66,6 +67,7 @@
'checkout_mail_your_mail' => 'Deine E-Mai:', 'checkout_mail_your_mail' => 'Deine E-Mai:',
'checkout_mail_invoice_addess' => 'Deine Rechnungsadresse:', 'checkout_mail_invoice_addess' => 'Deine Rechnungsadresse:',
'checkout_mail_deliver_addess' => 'Deine Lieferadresse:', 'checkout_mail_deliver_addess' => 'Deine Lieferadresse:',
'checkout_mail_pickup_addess' => 'Ich hole die Ware persönlich ab:',
'checkout_mail_deliver_customer' => 'Lieferadresse des Kunden:', 'checkout_mail_deliver_customer' => 'Lieferadresse des Kunden:',
'checkout_mail_order_for_me' => 'Beraterbestellung für Dich:', 'checkout_mail_order_for_me' => 'Beraterbestellung für Dich:',
'checkout_mail_order_for_ot' => 'Beraterbestellung für Deinen Kunden:', 'checkout_mail_order_for_ot' => 'Beraterbestellung für Deinen Kunden:',
@ -86,5 +88,6 @@
'checkout_mail_bank_code' => 'Verwendungszweck', 'checkout_mail_bank_code' => 'Verwendungszweck',
'checkout_mail_pay_approved' => 'Deine Zahlung wurde genehmigt, eine Bestätigung der Zahlung wird automatisch erstellt.', 'checkout_mail_pay_approved' => 'Deine Zahlung wurde genehmigt, eine Bestätigung der Zahlung wird automatisch erstellt.',
'checkout_mail_pay_invoice_open' => 'Deine Zahlung per Rechnung wurde genehmigt.', 'checkout_mail_pay_invoice_open' => 'Deine Zahlung per Rechnung wurde genehmigt.',
'checkout_mail_pay_non' => 'Deine Bestellung wurde ausgeführt.',
'checkout_mail_system_status' => 'SystemStatus:', 'checkout_mail_system_status' => 'SystemStatus:',
); );

View file

@ -23,4 +23,7 @@ return [
'payment_for_account' => 'Aufladung durch Mitgliedschaft', 'payment_for_account' => 'Aufladung durch Mitgliedschaft',
'user_order_deduction' => 'Abzug durch Bestellung', 'user_order_deduction' => 'Abzug durch Bestellung',
'user_order_return' => 'Rückführung durch Storno', 'user_order_return' => 'Rückführung durch Storno',
'promotion_order_deduction' => 'Abzug durch Promotion Produkt',
'promotion_order_return' => 'Rückführung durch Promotion Produkt',
]; ];

View file

@ -75,6 +75,8 @@
<p> <p>
<span class="text-muted">#{{$current->member->number}}</span><br> <span class="text-muted">#{{$current->member->number}}</span><br>
{{$current->member->getFullName()}}<br> {{$current->member->getFullName()}}<br>
@if(isset($current->member->account->zipcode)){{$current->member->account->zipcode}} @endif
@if(isset($current->member->account->city)){{$current->member->account->city}} @endif <br>
{{$current->member->account->zipcode}} {{$current->member->account->city}}<br> {{$current->member->account->zipcode}} {{$current->member->account->city}}<br>
@if($current->member->shop) @if($current->member->shop)
@if($current->member->isActive() && $current->member->isActiveShop()) @if($current->member->isActive() && $current->member->isActiveShop())

View file

@ -34,17 +34,28 @@
<div class="form-row"> <div class="form-row">
<div class="form-group col-12"> <div class="form-group col-12">
<label class="form-label" for="description">{{ __('Promotioninfo') }}</label> <label class="form-label" for="description">{{ __('Promotioninfo') }}</label>
{{ Form::textarea('description', $promotion->description , array('placeholder'=>__('Interne Notiz'), 'class'=>'form-control', 'rows'=>2, 'id'=>'description')) }} {{ Form::textarea('description', $promotion->description , array('placeholder'=>__('Interne Notiz'), 'class' => 'form-control text-autosize', 'rows' => 1, 'id'=>'description')) }}
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-12">
<label class="form-label" for="user_description">{{ __('Vertriebspartner - Kurzbeschreibung Deiner Promotion') }}</label>
{{ Form::textarea('user_description', $promotion->user_description , array('placeholder'=>__('Kurzbeschreibung'), 'class' => 'form-control bootstrap-maxlength text-autosize', 'maxlength'=>600, 'rows' => 1, 'id'=>'description')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-12">
<label class="form-label" for="user_about">{{ __('Vertriebspartner - Kurzer Text über Dich') }}</label>
{{ Form::textarea('user_about', $promotion->user_about , array('placeholder'=>__('Text über Dich'), 'class' => 'form-control bootstrap-maxlength text-autosize', 'maxlength'=>600, 'rows' => 1, 'id'=>'description')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-3"> <div class="form-group col-sm-3">
<label class="form-label" for="max_bugdet">{{ __('Max. gesamtes Budget für diese Promotion') }}</label> <label class="form-label" for="max_bugdet">{{ __('Max. gesamtes Budget für diese Promotion') }}</label>
{{ Form::text('max_bugdet', $promotion->getFormattedMaxBugdet(), array('placeholder'=>__('Budget in Euro / Brutto'), 'class'=>'form-control', 'id'=>'max_bugdet')) }} {{ Form::text('max_bugdet', $promotion->getFormattedMaxBugdet(), array('placeholder'=>__('Budget in Euro / Brutto'), 'class'=>'form-control', 'id'=>'max_bugdet')) }}
</div> </div>
<div class="form-group col-sm-3"> <div class="form-group col-sm-3">
<label class="form-label" for="max_items">{{ __('Max. gesamte Produkte für diese Promotion') }}</label> <label class="form-label" for="max_items">{{ __('Max. gesamte Produkte für diese Promotion') }}</label>
{{ Form::text('max_items', $promotion->max_items, array('placeholder'=>__('Einheiten in Stück'), 'class'=>'form-control', 'id'=>'max_items')) }} {{ Form::text('max_items', $promotion->max_items, array('placeholder'=>__('Einheiten in Stück'), 'class'=>'form-control', 'id'=>'max_items')) }}

View file

@ -300,7 +300,14 @@
<strong>Vertriebspartnerbestellung für Mitgliedschaft</strong> <strong>Vertriebspartnerbestellung für Mitgliedschaft</strong>
@endif @endif
@if($shopping_order->shopping_user->is_from === 'shopping') @if($shopping_order->shopping_user->is_from === 'shopping')
<strong>Kundenbestellung über Shop</strong> @if($shopping_order->payment_for === 4)
<strong>Kundenbestellung über Promotion</strong>
@if($shopping_order->promotion_user)
<br>{{ $shopping_order->promotion_user->name }} || {{ $shopping_order->promotion_user->user->getFullName() }}
@endif
@else
<strong>Kundenbestellung über Shop</strong>
@endif
@endif @endif
@if($shopping_order->shopping_user->is_from === 'homeparty') @if($shopping_order->shopping_user->is_from === 'homeparty')
<h5>Vertriebspartnerbestellung für eine Homeparty</h5> <h5>Vertriebspartnerbestellung für eine Homeparty</h5>
@ -319,7 +326,6 @@
} }
</style> </style>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-product m-0" style=""> <table class="table table-product m-0" style="">
<tbody> <tbody>
@ -352,7 +358,10 @@
<small> <small>
<span class="text-muted">Inhalt: </span> {{ $shopping_order_item->product->contents }}<br> <span class="text-muted">Inhalt: </span> {{ $shopping_order_item->product->contents }}<br>
<span class="text-muted">Gewicht: </span> {{ $shopping_order_item->product->weight }} g<br> <span class="text-muted">Gewicht: </span> {{ $shopping_order_item->product->weight }} g<br>
{{-- <span class="text-muted">Points: </span> {{ $shopping_order_item->product->points }} --}} @if($shopping_order_item->isFreeProduct())
<span class="">Promotionprodukt</span><br>
@endif
{{-- <span class="text-muted">Points: </span> {{ $shopping_order_item->product->points }} --}}
</small> </small>
</div> </div>
@endif @endif
@ -379,7 +388,6 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<style> <style>
@ -475,7 +483,6 @@
</div> </div>
</div> </div>
<hr class="m-0"> <hr class="m-0">
@if($shopping_order->txaction === 'extern') @if($shopping_order->txaction === 'extern')
<div class="card-body"> <div class="card-body">
@if($shopping_order->wp_invoice_path) @if($shopping_order->wp_invoice_path)
@ -502,8 +509,6 @@
</div> </div>
<hr class="m-0"> <hr class="m-0">
@endif @endif
<div class="card-body"> <div class="card-body">
<h6 class="small font-weight-semibold"> <h6 class="small font-weight-semibold">
Zahlung Zahlung

View file

@ -48,6 +48,7 @@
<th>{{__('Zahlung')}}</th> <th>{{__('Zahlung')}}</th>
<th>{{__('Status')}}</th> <th>{{__('Status')}}</th>
<th>{{__('Versand')}}</th> <th>{{__('Versand')}}</th>
<th>{{__('Art')}}</th>
<th>{{__('First name')}}</th> <th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th> <th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th> <th>{{__('E-Mail')}}</th>
@ -79,6 +80,7 @@
{ data: 'payment', name: 'payment', orderable: false }, { data: 'payment', name: 'payment', orderable: false },
{ data: 'txaction', name: 'txaction' }, { data: 'txaction', name: 'txaction' },
{ data: 'shipped', name: 'shipped' }, { data: 'shipped', name: 'shipped' },
{ data: 'is_for', name: 'is_for' },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' }, { data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' }, { data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' }, { data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },

View file

@ -181,8 +181,10 @@
<table style="padding: 20px; border:1px solid #eee; background-color: #fff;line-height:1.6em;" cellpadding="2" cellspacing="0" width="100%"> <table style="padding: 20px; border:1px solid #eee; background-color: #fff;line-height:1.6em;" cellpadding="2" cellspacing="0" width="100%">
<tr> <tr>
<td style="line-height:1.6em;"> <td style="line-height:1.6em;">
@if($shopping_payment->clearingtype !== "non")
<b>{{__('email.checkout_mail_pay_success')}} </b><br> <b>{{__('email.checkout_mail_pay_success')}} </b><br>
{{__('email.checkout_mail_pay_with')}} {{$shopping_payment->getPaymentType()}}<br> {{__('email.checkout_mail_pay_with')}} {{$shopping_payment->getPaymentType()}}<br>
@endif
{{__('email.checkout_mail_pay_ref')}} {{$shopping_payment->reference}}<br> {{__('email.checkout_mail_pay_ref')}} {{$shopping_payment->reference}}<br>
{{__('email.checkout_mail_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}<br> {{__('email.checkout_mail_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}<br>
</td> </td>
@ -285,6 +287,32 @@
<hr> <hr>
</td> </td>
</tr> </tr>
@if($shopping_order->shipping_option === 'pick_up')
<tr>
<td class="sub_headline">
<b>{{__('email.checkout_mail_pickup_addess')}}</b>
</td>
</tr>
<tr>
<td style="color:#37302d;">
<table style="padding: 20px; border:1px solid #eee; background-color: #fff" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="color:#37302d;line-height:1.6em;">
@if($shopping_order->promotion_user)
{!! nl2br($shopping_order->promotion_user->user_address) !!}
@endif
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<hr>
</td>
</tr>
@endif
<tr> <tr>
<td style="color:#37302d;font-size: 14px;line-height:1.6em;"> <td style="color:#37302d;font-size: 14px;line-height:1.6em;">
<table style="margin: 0 auto;" cellpadding="0" cellspacing="0" width="100%"> <table style="margin: 0 auto;" cellpadding="0" cellspacing="0" width="100%">

View file

@ -146,7 +146,6 @@
<b>{{__('email.checkout_mail_pay_error')}}</b><br> <b>{{__('email.checkout_mail_pay_error')}}</b><br>
@elseif($txaction === 'open') @elseif($txaction === 'open')
@if($shopping_payment->clearingtype === "vor") @if($shopping_payment->clearingtype === "vor")
<b>{{__('email.checkout_mail_pay_pre')}}</b><br> <b>{{__('email.checkout_mail_pay_pre')}}</b><br>
{{__('email.checkout_mail_pay_pre_c1')}} {{ number_format( (float) ($shopping_payment->amount/100), 2, ",", ".") }} {{__('email.checkout_mail_pay_pre_c2')}}<br> {{__('email.checkout_mail_pay_pre_c1')}} {{ number_format( (float) ($shopping_payment->amount/100), 2, ",", ".") }} {{__('email.checkout_mail_pay_pre_c2')}}<br>
@ -161,16 +160,21 @@
</p> </p>
<hr /> <hr />
@else @else
<b>{{__('email.checkout_mail_pay_invoice_open')}}</b><br> @if($shopping_payment->clearingtype === "non")
<b>{{__('email.checkout_mail_pay_non')}}</b><br>
@else
<b>{{__('email.checkout_mail_pay_invoice_open')}}</b><br>
@endif
@endif @endif
@elseif($txaction === 'xxx') @elseif($txaction === 'xxx')
<b>{{__('email.checkout_mail_pay_approved')}}</b><br> <b>{{__('email.checkout_mail_pay_approved')}}</b><br>
@else @else
<b>{{__('email.checkout_mail_system_status')}} {{$txaction}}</b><br> <b>{{__('email.checkout_mail_system_status')}} {{$txaction}}</b><br>
@endif @endif
{{__('email.checkout_mail_pay_with')}} {{$shopping_payment->getPaymentType()}}<br> @if($shopping_payment->clearingtype !== "non")
{{__('email.checkout_mail_pay_with')}} {{$shopping_payment->getPaymentType()}}<br>
@endif
{{__('email.checkout_mail_pay_ref')}} {{$shopping_payment->reference}}<br> {{__('email.checkout_mail_pay_ref')}} {{$shopping_payment->reference}}<br>
{{__('email.checkout_mail_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}<br> {{__('email.checkout_mail_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}<br>
</td> </td>
@ -274,6 +278,33 @@
<hr> <hr>
</td> </td>
</tr> </tr>
@if($shopping_order->shipping_option === 'pick_up')
<tr>
<td class="sub_headline">
<b>{{__('email.checkout_mail_pickup_addess')}}</b>
</td>
</tr>
<tr>
<td style="color:#37302d;">
<table style="padding: 20px; border:1px solid #eee; background-color: #fff" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="color:#37302d;line-height:1.6em;">
@if($shopping_order->promotion_user)
{!! nl2br($shopping_order->promotion_user->user_address) !!}
@endif
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<hr>
</td>
</tr>
@endif
<tr> <tr>
<td style="color:#37302d;font-size: 14px;"> <td style="color:#37302d;font-size: 14px;">
<table style="margin: 0 auto;" cellpadding="0" cellspacing="0" width="100%"> <table style="margin: 0 auto;" cellpadding="0" cellspacing="0" width="100%">

View file

@ -62,12 +62,15 @@
<div>{{ __('navigation.my_clients') }}</div> <div>{{ __('navigation.my_clients') }}</div>
</a> </a>
<ul class="sidenav-menu"> <ul class="sidenav-menu">
<li class="sidenav-item{{ Request::is('user/customers', 'user/customer/detail/*') ? ' active' : '' }}"> <li class="sidenav-item{{ Request::is('user/customers', 'user/customer/detail/*', 'user/sales/orders') ? ' active' : '' }}">
<a href="{{ route('user_customers') }}" class="sidenav-link"><i class="sidenav-icon ion ion ion-md-contacts"></i><div>{{ __('navigation.overview') }}</div></a> <a href="{{ route('user_customers') }}" class="sidenav-link"><i class="sidenav-icon ion ion ion-md-contacts"></i><div>{{ __('navigation.overview') }}</div></a>
</li> </li>
<li class="sidenav-item{{ Request::is('user/customer/add/*') ? ' active' : '' }}"> <li class="sidenav-item{{ Request::is('user/customer/add/*') ? ' active' : '' }}">
<a href="{{ route('user_customer_add', ['new']) }}" class="sidenav-link"><i class="sidenav-icon ion ion ion-md-person-add"></i><div>{{ __('navigation.add') }}</div></a> <a href="{{ route('user_customer_add', ['new']) }}" class="sidenav-link"><i class="sidenav-icon ion ion ion-md-person-add"></i><div>{{ __('navigation.add') }}</div></a>
</li> </li>
<li class="sidenav-item{{ Request::is('user/sales/orders') ? ' active' : '' }}">
<a href="{{ route('user_sales_orders') }}" class="sidenav-link"><i class="sidenav-icon ion ion ion-ios-list"></i><div>{{ __('navigation.orders') }}</div></a>
</li>
</ul> </ul>
</li> </li>
@endif @endif

View file

@ -269,7 +269,9 @@
@if($shopping_order->shopping_user->billing_company) @if($shopping_order->shopping_user->billing_company)
{{ $shopping_order->shopping_user->billing_company }}<br> {{ $shopping_order->shopping_user->billing_company }}<br>
@else @else
@if($shopping_order->payment_for !== 4)
Firma <br> Firma <br>
@endif
@endif @endif
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }} {{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }}
{{ $shopping_order->shopping_user->billing_firstname }} {{ $shopping_order->shopping_user->billing_lastname }}<br> {{ $shopping_order->shopping_user->billing_firstname }} {{ $shopping_order->shopping_user->billing_lastname }}<br>

View file

@ -255,7 +255,7 @@
{{ $promotion_admin_product->getFormattedPriceWith(false) }} &euro; {{ $promotion_admin_product->getFormattedPriceWith(false) }} &euro;
</td> </td>
<td class="align-middle px-3 py-2 nowrap text-right" style=""> <td class="align-middle px-3 py-2 nowrap text-right" style="">
<span class="calculate_product_qty_price_total" data-qty-id="product_qty_{{ $promotion_admin_product->id }}" data-price="{{ $promotion_admin_product->getPriceWith(false) }}"></span> &euro; <span class="calculate_product_qty_price_total" data-admin_product_id="{{ $promotion_admin_product->id }}" data-price="{{ $promotion_admin_product->getPriceWith(false) }}"></span> &euro;
</td> </td>
<td class="align-middle px-3 py-2 text-right" style=""> <td class="align-middle px-3 py-2 text-right" style="">
{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'sell_items') }} {{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'sell_items') }}

View file

@ -0,0 +1,10 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
<a href="{{route('user_sales_orders')}}" class="btn btn-sm btn-default float-right">zurück</a>
{{ __('Bestellung Kunde') }} <span class="text-muted">#{{$shopping_order->id}}</span>
</h4>
@include('admin.sales._detail')
<a href="{{route('user_sales_orders')}}" class="btn btn-sm btn-default mt-2 float-right">zurück</a>
@endsection

View file

@ -0,0 +1,58 @@
@extends('layouts.layout-2')
@section('content')
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Bestellungen Kunden') }}
</h4>
<div class="card">
<div class="card-datatable table-responsive">
<table class="datatable-customers table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>{{__('First name')}}</th>
<th>{{__('Last name')}}</th>
<th>{{__('E-Mail')}}</th>
<th>{{__('Datum')}}</th>
<th>{{__('Status')}}</th>
<th>{{__('Art')}}</th>
<th>{{__('Betrag')}}</th>
<!--<th>{{__('Käufe')}}</th-->
</tr>
</thead>
</table>
</div>
</div>
<script>
$( document ).ready(function() {
$('.datatable-customers').dataTable({
"processing": true,
"serverSide": true,
"ajax": '{!! route('user_sales_orders_datatable') !!}',
"order": [[0, "desc" ]],
"columns": [
{ data: 'id', searchable: false },
{ data: 'shopping_user.billing_firstname', name: 'shopping_user.billing_firstname' },
{ data: 'shopping_user.billing_lastname', name: 'shopping_user.billing_lastname' },
{ data: 'shopping_user.billing_email', name: 'shopping_user.billing_email' },
{ data: 'created_at', name: 'created_at' },
{ data: 'txaction', name: 'txaction' },
{ data: 'is_for', name: 'is_for' },
{ data: 'total_shipping', name: 'total_shipping' },
// { data: 'shopping_user.orders', name: 'shopping_user.orders' },
],
"bLengthChange": false,
"iDisplayLength": 100,
"language": {
"url": "/js/German.json"
}
});
});
</script>
@endsection

View file

@ -2,9 +2,10 @@
<strong>#### TEST MODE #### TEST MODE ####</strong> <strong>#### TEST MODE #### TEST MODE ####</strong>
@endif @endif
<div class="checkout-order mt-4"> <div class="checkout-order mt-4">
@if(Yard::instance('shopping')->isWithPayments())
<h3 class="">Zahlungsart auswählen</h3> <h3 class="">Zahlungsart auswählen</h3>
<div id="error-payment_method"></div> <div id="error-payment_method"></div>
<div class="table-responsive"> <div class="table-responsive mb-4">
<table class="table table-payment m-0" id=""> <table class="table table-payment m-0" id="">
<tbody class="switchers-stacked"> <tbody class="switchers-stacked">
@if (true || \App\Models\PaymentMethod::isShowPaymentMethod('PP', $user_payment_methods, 0)) @if (true || \App\Models\PaymentMethod::isShowPaymentMethod('PP', $user_payment_methods, 0))
@ -28,6 +29,7 @@
</tr> </tr>
@endif @endif
{{--
@if (true || \App\Models\PaymentMethod::isShowPaymentMethod('SB', $user_payment_methods, 0)) @if (true || \App\Models\PaymentMethod::isShowPaymentMethod('SB', $user_payment_methods, 0))
<tr> <tr>
<td class="align-middle px-0 pl-1p"> <td class="align-middle px-0 pl-1p">
@ -40,7 +42,7 @@
<span class="switcher-no"></span> <span class="switcher-no"></span>
</span> </span>
<span class="switcher-label font-weight-bold text-left">Sofort <span class="switcher-label font-weight-bold text-left">Sofort
-Überweisung</span> Überweisung</span>
</label> </label>
</td> </td>
<td class="text-right align-middle px-0 py-3 ui-w-100"> <td class="text-right align-middle px-0 py-3 ui-w-100">
@ -69,6 +71,7 @@
</td> </td>
</tr> </tr>
@endif @endif
--}}
@if (true || \App\Models\PaymentMethod::isShowPaymentMethod('VOR', $user_payment_methods, 0)) @if (true || \App\Models\PaymentMethod::isShowPaymentMethod('VOR', $user_payment_methods, 0))
<tr> <tr>
<td class="align-middle px-0 pl-1p"> <td class="align-middle px-0 pl-1p">
@ -92,34 +95,34 @@
</tbody> </tbody>
</table> </table>
</div> </div>
@endif
<h3 class="mt-4">Warenkorb</h3> <h3 class="">Warenkorb</h3>
<div class="checkout-cart"> <div class="checkout-cart">
<div class="mb-2"> <div class="mb-2">
<span class="float-right">0,00 </span> <span class="float-right">{{ Yard::instance('shopping')->total() }} </span>
<strong class="">Zwischensumme:</strong> <strong class="">Zwischensumme:</strong>
</div> </div>
<hr class="light"> <hr class="light">
<div class="mb-2"> <div class="mb-2">
<span class="float-right">0,00 </span> <span class="float-right">{{ Yard::instance('shopping')->shipping() }} </span>
<span class="">Versandkosten:</span> <span class="">Versandkosten:</span>
</div> </div>
<div class="mb-2"> <div class="mb-2">
<span class="float-right">Deutschland</span> <span class="float-right">{{ Yard::instance('shopping')->getShippingCountryName() }}</span>
<span class="">Lieferland:</span> <span class="">Lieferland:</span>
</div> </div>
<hr class="light"> <hr class="light">
<div class="mb-2" style="font-size: 90%"> <div class="mb-2" style="font-size: 90%">
<span class="float-right">0,00 </span> <span class="float-right">{{ Yard::instance('shopping')->subtotalWithShipping() }} </span>
<span class="">Summe ohne MwSt:</span> <span class="">Summe ohne MwSt:</span>
</div> </div>
<div class="mb-2" style="font-size: 90%"> <div class="mb-2" style="font-size: 90%">
<span class="float-right">0,00 </span> <span class="float-right">{{ Yard::instance('shopping')->taxWithShipping() }} </span>
<span class=""> zzgl. {{-- Yard::getTaxRate() --}} MwSt:</span> <span class=""> zzgl. {{-- Yard::getTaxRate() --}} MwSt:</span>
</div> </div>
<hr class="light"> <hr class="light">
<div class=""> <div class="">
<span class="float-right"><strong>0,00 </strong></span> <span class="float-right"><strong>{{ Yard::instance('shopping')->totalWithShipping() }} </strong></span>
<strong class="">Gesamtsumme:</strong> <strong class="">Gesamtsumme:</strong>
</div> </div>
<hr class="light"> <hr class="light">
@ -148,10 +151,17 @@
<i class="ion ion-ios-share-alt"></i> Jetzt kaufen <i class="spinner fa fa-spinner fa-spin"></i> <i class="ion ion-ios-share-alt"></i> Jetzt kaufen <i class="spinner fa fa-spinner fa-spin"></i>
</button> </button>
<hr class="light"> <hr class="light">
<p class="text-center" style="line-height: 1.2em;"><em class="small text-center"> <i @if(Yard::instance('shopping')->isWithPayments())
class="fa fa-lock"></i> Sind alle Deine Angaben vollsätndig ausgefüllt, <p class="text-center" style="line-height: 1.2em;"><em class="small text-center"> <i
klicke auf "Jetzt kaufen" und Du wist zu unserem Zahlungsanbieter weitergeleitet, class="fa fa-lock"></i> Sind alle Deine Angaben vollsätndig ausgefüllt,
die Verbindung ist SSL verschlüsselt.</em></p> klicke auf "Jetzt kaufen" und Du wirst zu unserer Zahlung/Zahlungsabieter weitergeleitet,
die Verbindungen sind SSL verschlüsselt.</em></p>
@else
<p class="text-center" style="line-height: 1.2em;"><em class="small text-center"> <i
class="fa fa-lock"></i> Sind alle Deine Angaben vollsätndig ausgefüllt,
klicke auf "Jetzt kaufen" und die Bestellung wird abgeschlossen,
die Verbindungen sind SSL verschlüsselt.</em></p>
@endif
</div> </div>
</div> </div>

View file

@ -30,9 +30,9 @@
<div class="mt-4 mb-3"> <div class="mt-4 mb-3">
<div class="switcher-holder btn-add-free-product"> <div class="switcher-holder btn-add-free-product">
<label class="switcher switcher-success"> <label class="switcher switcher-success">
<input type="radio" class="switcher-input" name="user_free_product" <input type="radio" class="switcher-input" name="free_product_id"
value="{{ $promotion_user_product->product->id }}" data-error="#error-user_free_product" value="{{ $promotion_user_product->id }}" data-product_id={{ $promotion_user_product->product->id }} data-error="#error-free_product_id"
@if($free_product_id === $promotion_user_product->product->id) checked @endif @if($free_product_id === $promotion_user_product->id) checked @endif
required> required>
<span class="switcher-indicator"> <span class="switcher-indicator">
<span class="switcher-yes"> <span class="switcher-yes">
@ -50,7 +50,7 @@
@endif @endif
@endforeach @endforeach
<div class="col-12"> <div class="col-12">
<div id="error-user_free_product" class="text-center"></div> <div id="error-free_product_id" class="text-center"></div>
<hr class=""> <hr class="">
</div> </div>
</div> </div>

View file

@ -16,6 +16,5 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -233,3 +233,77 @@
</div> </div>
</div> </div>
</div> </div>
<script>
$(document).ready(function() {
$('#invoice_details_holder select').selectpicker();
var validator = $("#user-promotion-form-validations").validate({
submitHandler: function(form) {
$('.button-prevent-multiple-submits').attr('disabled', true);
$('.button-prevent-multiple-submits').find('.spinner').show();
form.submit();
},
errorPlacement: function errorPlacement(error, element) {
console.log(error);
var placement = $(element).data('error');
if (placement) {
$(placement).append(error.addClass('invalid-feedback d-block'));
} else {
error.insertAfter(element).addClass('invalid-feedback small d-block');
}
},
highlight: function( element, errorClass, validClass ) {
if($(element).hasClass('selectpicker')){
$(element).parent('.form-control').find('.dropdown-toggle').addClass( errorClass ).removeClass( validClass );
}else if ( element.type === "radio" ) {
this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
} else {
$( element ).addClass( errorClass ).removeClass( validClass );
}
},
unhighlight: function( element, errorClass, validClass ) {
if($(element).hasClass('selectpicker')){
$(element).parent('.form-control').find('.dropdown-toggle').removeClass( errorClass ).addClass( validClass );
} else if ( element.type === "radio" ) {
this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
} else {
$( element ).removeClass( errorClass ).addClass( validClass );
}
},
messages: {
user_free_product_id: {
required: "Bitte ein Produkt auswählen.",
},
switchers_shipping: {
required: "Bitte eine Auswahl treffen.",
},
payment_method: {
required: "Bitte eine Zahlungsart auswählen.",
}
}
});
$('select.revalidat').on('change', function () {
validator.element($(this));
});
// Shipping Address show|hide
$("#shipping_address_switch").bind("change", function() {
$('#shipping_address').slideToggle(200, function() {
if ($('#shipping_address').is(":visible")) {
_scrollTo('#shipping_address', 60);
}
});
});
if ($('#shipping_address_switch').is(':checked')) {
$('#shipping_address').show();
} else {
$('#shipping_address').hide();
}
});
</script>

View file

@ -0,0 +1,133 @@
<h2 class="mt-3">Rechnungsdetails</h2>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="billing_firstname">Vorname <span class="required">*</span></label>
{!! Form::text('billing_firstname', '', ['class' => 'form-control ' . ($errors->has('billing_firstname') ? 'error' : ''), 'id' => 'billing_firstname', 'required' => true]) !!}
@if ($errors->has('billing_firstname'))
<label for="billing_firstname" class="error text-danger small"
style="display: block;">{{ $errors->first('billing_firstname') }}</label>
@endif
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="billing_lastname">Nachname <span class="required">*</span></label>
{!! Form::text('billing_lastname', '', ['class' => 'form-control ' . ($errors->has('billing_lastname') ? 'error' : ''), 'id' => 'billing_lastname', 'required' => true]) !!}
@if ($errors->has('billing_lastname'))
<label for="billing_lastname" class="error text-danger small"
style="display: block;">{{ $errors->first('billing_lastname') }}</label>
@endif
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="billing_state">Land / Region <span class="required">*</span></label>
<select id="billing_state" name="billing_state" class="form-control selectpicker"
data-style="btn-default" required>
{!! HTMLHelper::getCountriesForShipping(1) !!}
</select>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="billing_address">Straße + Hausnummer <span
class="required">*</span></label>
{!! Form::text('billing_address', '', ['class' => 'form-control ' . ($errors->has('billing_address') ? 'error' : ''), 'id' => 'billing_address', 'required' => true]) !!}
@if ($errors->has('billing_address'))
<label for="billing_address" class="error text-danger small"
style="display: block;">{{ $errors->first('billing_address') }}</label>
@endif
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="billing_zipcode">PLZ <span class="required">*</span></label>
{!! Form::text('billing_zipcode', '', ['class' => 'form-control ' . ($errors->has('billing_zipcode') ? 'error' : ''), 'id' => 'billing_zipcode', 'required' => true]) !!}
@if ($errors->has('billing_zipcode'))
<label for="billing_zipcode" class="error text-danger small"
style="display: block;">{{ $errors->first('billing_zipcode') }}</label>
@endif
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="billing_city">Stadt <span class="required">*</span></label>
{!! Form::text('billing_city', '', ['class' => 'form-control ' . ($errors->has('billing_city') ? 'error' : ''), 'id' => 'billing_city', 'required' => true]) !!}
@if ($errors->has('billing_city'))
<label for="billing_city" class="error text-danger small"
style="display: block;">{{ $errors->first('billing_city') }}</label>
@endif
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="billing_email">E-Mail <span class="required">*</span></label>
{!! Form::email('billing_email', '', ['class' => 'form-control ' . ($errors->has('billing_email') ? 'error' : ''), 'id' => 'billing_email', 'required' => true]) !!}
@if ($errors->has('billing_email'))
<label for="billing_email" class="error text-danger small"
style="display: block;">{{ $errors->first('billing_email') }}</label>
@endif
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#invoice_details_holder select').selectpicker();
var validator = $("#user-promotion-form-validations").validate({
submitHandler: function(form) {
$('.button-prevent-multiple-submits').attr('disabled', true);
$('.button-prevent-multiple-submits').find('.spinner').show();
form.submit();
},
errorPlacement: function errorPlacement(error, element) {
console.log(error);
var placement = $(element).data('error');
if (placement) {
$(placement).append(error.addClass('invalid-feedback d-block'));
} else {
error.insertAfter(element).addClass('invalid-feedback small d-block');
}
},
highlight: function( element, errorClass, validClass ) {
if($(element).hasClass('selectpicker')){
$(element).parent('.form-control').find('.dropdown-toggle').addClass( errorClass ).removeClass( validClass );
}else if ( element.type === "radio" ) {
this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
} else {
$( element ).addClass( errorClass ).removeClass( validClass );
}
},
unhighlight: function( element, errorClass, validClass ) {
if($(element).hasClass('selectpicker')){
$(element).parent('.form-control').find('.dropdown-toggle').removeClass( errorClass ).addClass( validClass );
} else if ( element.type === "radio" ) {
this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
} else {
$( element ).removeClass( errorClass ).addClass( validClass );
}
},
messages: {
user_free_product_id: {
required: "Bitte ein Produkt auswählen.",
},
switchers_shipping: {
required: "Bitte eine Auswahl treffen.",
},
payment_method: {
required: "Bitte eine Zahlungsart auswählen.",
}
}
});
$('select.revalidat').on('change', function () {
validator.element($(this));
});
});
</script>

View file

@ -46,7 +46,7 @@
</div> </div>
</div> </div>
<div class="options"> <div class="options">
@if(!$row->options->free_product) @if(!$row->options->free_product_id)
<a href="#" <a href="#"
class="auto-delete-product remove_item_form_cart product-tooltip" class="auto-delete-product remove_item_form_cart product-tooltip"
data-row-id="{{$row->rowId}}" data-row-id="{{$row->rowId}}"
@ -62,7 +62,7 @@
{{ Yard::instance('shopping')->rowPrice($row, 2) }} &euro;*</div> {{ Yard::instance('shopping')->rowPrice($row, 2) }} &euro;*</div>
</div> </div>
<div class="col-6 col-sm-3 col-md-3 quantity"> <div class="col-6 col-sm-3 col-md-3 quantity">
@if(!$row->options->free_product) @if(!$row->options->free_product_id)
<div class="quantity-select"> <div class="quantity-select">
<input type="number" <input type="number"
class="form-control text-center cart-input-event-onchange" class="form-control text-center cart-input-event-onchange"

View file

@ -3,8 +3,10 @@
<div class="col-md-6 text-left"> <div class="col-md-6 text-left">
<h2 class="mt-3">Wähle Deine Versandart</h2> <h2 class="mt-3">Wähle Deine Versandart</h2>
<div class="switchers-stacked"> <div class="switchers-stacked">
@php($shipping_option = Yard::instance('shopping')->getShippingOption())
<label class="switcher switcher-success"> <label class="switcher switcher-success">
<input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="pick_up" required> <input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="pick_up" required
@if($shipping_option === 'pick_up') checked @endif>
<span class="switcher-indicator"> <span class="switcher-indicator">
<span class="switcher-yes"> <span class="switcher-yes">
<span class="ion ion-md-checkmark"></span> <span class="ion ion-md-checkmark"></span>
@ -26,7 +28,8 @@
</label> </label>
--}} --}}
<label class="switcher switcher-success"> <label class="switcher switcher-success">
<input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="dhl_shipping"> <input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="dhl_shipping"
@if($shipping_option === 'dhl_shipping') checked @endif>
<span class="switcher-indicator"> <span class="switcher-indicator">
<span class="switcher-yes"> <span class="switcher-yes">
<span class="ion ion-md-checkmark"></span> <span class="ion ion-md-checkmark"></span>

View file

@ -53,3 +53,38 @@
<hr class=""> <hr class="">
</div> </div>
</section> </section>
<script>
$(document).ready(function() {
var swiper = new Swiper(".mySwiper", {
slidesPerView: 1,
spaceBetween: 10,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
breakpoints: {
576: {
slidesPerView: 1,
spaceBetween: 10,
},
768: {
slidesPerView: 2,
spaceBetween: 20,
},
992: {
slidesPerView: 3,
spaceBetween: 20,
},
1200: {
slidesPerView: 3,
spaceBetween: 20,
},
},
});
});
</script>

View file

@ -16,7 +16,6 @@
</div> </div>
@endif @endif
{!! Form::open(['url' => route('web_promotion_store', $promotion_user->id), 'class' => 'form-horizontal form-prevent-multiple-submits', 'id' => 'user-promotion-form-validations']) !!} {!! Form::open(['url' => route('web_promotion_store', $promotion_user->id), 'class' => 'form-horizontal form-prevent-multiple-submits', 'id' => 'user-promotion-form-validations']) !!}
<input type="hidden" name="load_url" value="{{ route('web_promotion_modal_load') }}"> <input type="hidden" name="load_url" value="{{ route('web_promotion_modal_load') }}">
<div class="layout-content"> <div class="layout-content">
@ -37,12 +36,18 @@
<section> <section>
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-7"> <div class="col-lg-8 col-md-7">
@include('web.promotion._invoice_details') <section id="invoice_details_holder">
@if(Yard::instance('shopping')->isQuickShipping())
@include('web.promotion._invoice_details_quick')
@else
@include('web.promotion._invoice_details')
@endif
</section>
</div> </div>
<div class="col-lg-4 col-md-5"> <div class="col-lg-4 col-md-5">
@include('web.promotion._checkout') <section id="promotion_checkout_holder">
@include('web.promotion._checkout')
</section>
</div> </div>
</div> </div>
</section> </section>
@ -50,110 +55,11 @@
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var iqShoppingShopCart = IqPromotionShopCart.init(); var iqShoppingShopCart = IqPromotionShopCart.init();
var validator = $("#user-promotion-form-validations").validate({
submitHandler: function(form) {
$('.button-prevent-multiple-submits').attr('disabled', true);
$('.button-prevent-multiple-submits').find('.spinner').show();
form.submit();
},
errorPlacement: function errorPlacement(error, element) {
console.log(error);
var placement = $(element).data('error');
if (placement) {
$(placement).append(error.addClass('invalid-feedback d-block'));
} else {
error.insertAfter(element).addClass('invalid-feedback small d-block');
}
},
highlight: function( element, errorClass, validClass ) {
if($(element).hasClass('selectpicker')){
$(element).parent('.form-control').find('.dropdown-toggle').addClass( errorClass ).removeClass( validClass );
}else if ( element.type === "radio" ) {
this.findByName( element.name ).addClass( errorClass ).removeClass( validClass );
} else {
$( element ).addClass( errorClass ).removeClass( validClass );
}
},
unhighlight: function( element, errorClass, validClass ) {
if($(element).hasClass('selectpicker')){
$(element).parent('.form-control').find('.dropdown-toggle').removeClass( errorClass ).addClass( validClass );
} else if ( element.type === "radio" ) {
this.findByName( element.name ).removeClass( errorClass ).addClass( validClass );
} else {
$( element ).removeClass( errorClass ).addClass( validClass );
}
},
messages: {
user_free_product: {
required: "Bitte ein Produkt auswählen.",
},
switchers_shipping: {
required: "Bitte eine Auswahl treffen.",
},
payment_method: {
required: "Bitte eine Zahlungsart auswählen.",
}
}
});
$('select.revalidat').on('change', function () {
validator.element($(this));
});
var swiper = new Swiper(".mySwiper", {
slidesPerView: 1,
spaceBetween: 10,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
breakpoints: {
576: {
slidesPerView: 1,
spaceBetween: 10,
},
768: {
slidesPerView: 2,
spaceBetween: 20,
},
992: {
slidesPerView: 3,
spaceBetween: 20,
},
1200: {
slidesPerView: 3,
spaceBetween: 20,
},
},
});
// Shipping Address show|hide
$("#shipping_address_switch").bind("change", function() {
$('#shipping_address').slideToggle(200, function() {
if ($('#shipping_address').is(":visible")) {
_scrollTo('#shipping_address', 60);
}
});
});
if ($('#shipping_address_switch').is(':checked')) {
$('#shipping_address').show();
} else {
$('#shipping_address').hide();
}
}); });
</script> </script>
@endsection @endsection
@section('scripts') @section('scripts')

View file

@ -15,22 +15,62 @@
</div> </div>
</div> </div>
@endif @endif
{!! Form::open(['url' => route('web_promotion_store', $promotion_user->id), 'class' => 'form-horizontal form-prevent-multiple-submits', 'id' => 'user-promotion-form-validations']) !!} {!! Form::open(['url' => route('web_promotion_store', $promotion_user->id), 'class' => 'form-horizontal form-prevent-multiple-submits', 'id' => 'user-promotion-form-validations']) !!}
<div class="layout-content"> <div class="layout-content">
<div class="container px-3"> <div class="container px-3">
<div class="container flex-grow-1 container-p-y pb-0"> <div class="container flex-grow-1 container-p-y pb-0">
<div class="media align-items-center pt-3 mb-3"> <div class="media align-items-top py-3 mb-3">
{{-- <img src="assets/img/avatars/5-small.png" alt="" class="d-block ui-w-100 rounded-circle"> --}} @if($promotion_user->user->hasProfileImage())
<img src="{{ route('response_file', ['user', $promotion_user->user->getProfileImage()]) }}" alt="" class="d-block ui-w-100 rounded-circle mt-3">
@endif
<div class="media-body ml-4"> <div class="media-body ml-4">
<h1 class="text-center">Super, geschafft!</h1> <h1 class="text-left">Super, geschafft!</h1>
<p class="text-center"> <p class="text-left">
Ich danke Dir .. Ich danke Dir, dass Du unseren Service nutzt, um die Produkte von GRÜNE SEELE zu testen. Dein:e Produkt:e werden in Kürze versendet und dann freuen wir uns schon auf ein Feedback von Dir.
</p> In Kürze erhälst Du von uns eine Bestellbestätigungsmail.</p>
<p class="text-center">Liebe Grüße,<br>{{ $promotion_user->user->getFullName() }}<br>Vertriebspartner:in der GRÜNEN SEELE Naturkosmetik</p> <h4 class="text-left">Deine Bestellnummer ist: {{ $order_reference }}</h4>
<hr />
@if($pay_trans && $pay_trans->shopping_payment)
@if($pay_trans->shopping_payment->clearingtype === "vor")
<h4 class="text-left">Bezahlung per Vorkasse:</h4>
<p class="text-left" style="line-height: 1.4em">Bitte überweise {{ number_format(($pay_trans->shopping_payment->amount/100), 2, ",", ".") }} EUR auf die folgende Kontoverbindung, um den Kauf abzuschließen.
<br>
<strong>{{__('email.checkout_mail_bank_holder')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-account-owner') !!}<br>
<strong>{{__('email.checkout_mail_bank_iban')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-iban') !!} <br>
<strong>{{__('email.checkout_mail_bank_bic')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-bic') !!} <br>
<strong>{{__('email.checkout_mail_bank_name')}}</strong> {!! \App\Models\Setting::getContentBySlug('prepayment-bank') !!} <br>
<strong>Gesamtbetrag:</strong> {{ number_format( ($pay_trans->shopping_payment->amount/100), 2, ",", ".") }} EUR<br>
<strong>Verwendungszweck:</strong> {{ $pay_trans->transmitted_data['reference'] }}
</p>
<hr />
@endif
@if($pay_trans->shopping_payment->clearingtype === "cc")
<h4>Bezahlung per Kreditkarte:</h4>
<p>Deine Zahlung wurde genehmigt, eine Bestätigung der Zahlung wird automatisch erstellt.</p>
<hr />
@endif
@if($pay_trans->shopping_payment->clearingtype === "elv")
<h4>Bezahlung per SEPA:</h4>
<p>Deine Zahlung wird bearbeitet, eine Bestätigung zur Zahlungsabwicklung wird automatisch erstellt.</p>
<hr />
@endif
@if($pay_trans->shopping_payment->clearingtype === "fnc")
<h4>Bezahlung per Rechnung:</h4>
<p>Deine Bestellung wird bearbeitet, eine Bestätigung zur Bestellungsabwicklung wird automatisch erstellt.</p>
@endif
@if(isset($pay_trans->shopping_payment->shopping_order->shipping_option))
@if($pay_trans->shopping_payment->shopping_order->shipping_option === 'dhl_shipping')
<p>Versand mit DHL (1-3 Werktage).</p>
@endif
@if($pay_trans->shopping_payment->shopping_order->shipping_option === 'pick_up')
<p>Ich hole die Ware bei {{ $promotion_user->user->getFullName() }} persönlich ab.</p>
<h4 class="mt-3">Kontakt &amp; Abholadresse</h4>
<p>{!! nl2br($promotion_user->user_address) !!}</p>
@endif
<hr />
@endif
@endif
<p class="text-left">Liebe Grüße,<br>{{ $promotion_user->user->getFullName() }}<br>Vertriebspartner:in der GRÜNEN SEELE Naturkosmetik</p>
</div> </div>
</div> </div>
</div> </div>
@ -41,11 +81,8 @@
</div> </div>
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}
<script> <script>
$(document).ready(function() { $(document).ready(function() {
}); });
</script> </script>
@endsection @endsection

View file

@ -145,9 +145,9 @@ Route::domain(config('app.domain'))->group(function () {
//user shop Sales //user shop Sales
Route::get('/user/shop/orders', 'User\ShopSalesController@orders')->name('user_shop_orders'); Route::get('/user/sales/orders', 'User\SalesController@orders')->name('user_sales_orders');
Route::get('/user/shop/order/detail/{id}', 'User\ShopSalesController@orderDetail')->name('user_shop_order_detail'); Route::get('/user/sales/order/detail/{id}', 'User\SalesController@orderDetail')->name('user_sales_order_detail');
Route::get('/user/shop/orders/datatable', 'User\ShopSalesController@ordersDatatable')->name('user_shop_orders_datatable'); Route::get('/user/sales/orders/datatable', 'User\SalesController@ordersDatatable')->name('user_sales_orders_datatable');
//user team //user team
Route::get('/user/team/members', 'User\TeamController@members')->name('user_team_members'); Route::get('/user/team/members', 'User\TeamController@members')->name('user_team_members');
@ -373,7 +373,11 @@ Route::domain(config('app.promo_domain'))->group(function () {
Route::get("/", "Web\PromotionController@serve")->where('path', '.+'); Route::get("/", "Web\PromotionController@serve")->where('path', '.+');
Route::post('/web/promotion/modal/load', 'Web\PromotionController@load')->name('web_promotion_modal_load'); Route::post('/web/promotion/modal/load', 'Web\PromotionController@load')->name('web_promotion_modal_load');
Route::post('/web/promotion/store/{id}', 'Web\PromotionController@store')->name('web_promotion_store'); Route::post('/web/promotion/store/{id}', 'Web\PromotionController@store')->name('web_promotion_store');
Route::get("/web/promotion/goto/{load}/{id}", "Web\PromotionController@goto")->name('web_promotion_goto'); Route::get("/web/promotion/goto/{load}/{id}/{payid?}/{reference?}/{identifier?}", "Web\PromotionController@goto")->name('web_promotion_goto');
Route::get('/web/paypal_payment/success/{id}/{payid?}/{reference?}/{identifier?}', 'Pay\PayPalController@paymentSuccess')->name('success.paypal_payment');
Route::get('/web/paypal_payment/cancel/{id}/{payid?}/{reference?}/{identifier?}', 'Pay\PayPalController@paymentCancel')->name('cancel.paypal_payment');
Route::get("/{path?}", "Web\PromotionController@serve")->where('path', '.+'); Route::get("/{path?}", "Web\PromotionController@serve")->where('path', '.+');
}); });

Binary file not shown.