promotion 1.0
This commit is contained in:
parent
1cc8e025a1
commit
570d428b1c
60 changed files with 1596 additions and 272 deletions
8
.env
8
.env
|
|
@ -3,6 +3,7 @@ APP_ENV=local
|
|||
APP_KEY=base64:w0K6RjfleoAOpuICea14JnaZ28PNc6EMzIFMQZ3MVtU=
|
||||
APP_DEBUG=true
|
||||
APP_URL=https://partner.gruene-seele.test
|
||||
APP_API_DOMAIN=gruene-seele.bio
|
||||
APP_DOMAIN=partner.gruene-seele.test
|
||||
APP_PROMO_URL=https://testemich.test
|
||||
APP_PROMO_DOMAIN=testemich.test
|
||||
|
|
@ -54,6 +55,13 @@ MAIL_ENCRYPTION=""
|
|||
MAIL_FROM_ADDRESS=partner@gruene-seele.bio
|
||||
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_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ class ShoppingUserController extends Controller
|
|||
$shopping_user = ShoppingUser::create($data);
|
||||
|
||||
//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);
|
||||
//exists //like //update
|
||||
$user = $this->prepareForShow($shopping_user);
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ class PayController extends Controller
|
|||
|
||||
private $reference;
|
||||
|
||||
private $payment_method;
|
||||
|
||||
public function __construct() {
|
||||
|
||||
}
|
||||
|
|
@ -77,6 +79,7 @@ class PayController extends Controller
|
|||
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->payment_method = $payment_method;
|
||||
$this->setMethod($payment_method, $ret);
|
||||
|
||||
$this->prepayment = [
|
||||
|
|
@ -86,7 +89,6 @@ class PayController extends Controller
|
|||
"param" => $this->shopping_order->id,
|
||||
|
||||
];
|
||||
|
||||
$this->shopping_payment = ShoppingPayment::create([
|
||||
'shopping_order_id' => $this->shopping_order->id,
|
||||
'clearingtype' => $this->method["clearingtype"],
|
||||
|
|
@ -119,6 +121,15 @@ class PayController extends Controller
|
|||
private function setMethod($payment_method, $ret = []){
|
||||
|
||||
//vorkasse
|
||||
if($payment_method === 'non'){
|
||||
$this->method = [
|
||||
"clearingtype" => "non",
|
||||
"wallettype" => "",
|
||||
'onlinebanktransfertype' => "",
|
||||
"request" => "authorization",
|
||||
];
|
||||
}
|
||||
|
||||
if($payment_method === 'vor'){
|
||||
$this->method = [
|
||||
"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);
|
||||
//RECHNUNG MIV
|
||||
|
||||
$payt = PaymentTransaction::create([
|
||||
'shopping_payment_id' => $this->shopping_payment->id,
|
||||
|
|
@ -155,10 +175,26 @@ class PayController extends Controller
|
|||
'txaction' => 'prev',
|
||||
'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);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
95
app/Http/Controllers/Pay/PayPalController.php
Normal file
95
app/Http/Controllers/Pay/PayPalController.php
Normal 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!');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -224,8 +224,8 @@ class SalesController extends Controller
|
|||
if($ShoppingOrder->shopping_user->is_for === 'ot'){
|
||||
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
|
||||
}
|
||||
if($ShoppingOrder->shopping_user->is_for === 'hp'){
|
||||
return '<span class="badge badge-pill badge-dark">Homepartybestellung</span>';
|
||||
if($ShoppingOrder->shopping_user->is_for === 'pr'){
|
||||
return '<span class="badge badge-pill badge-dark">Promotion</span>';
|
||||
}
|
||||
return '-';
|
||||
})
|
||||
|
|
@ -249,6 +249,7 @@ class SalesController extends Controller
|
|||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('txaction', 'txaction $1')
|
||||
->orderColumn('is_for', 'is_for $1')
|
||||
->orderColumn('member_id', 'member_id $1')
|
||||
->orderColumn('shipped', 'shipped $1')
|
||||
->orderColumn('total_shipping', 'total_shipping $1')
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@ class CheckoutController extends Controller
|
|||
$shopping_user->billing_state = Shop::getCountryShippingCountryId($shopping_user->billing_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
|
||||
|
||||
}
|
||||
if($shopping_user->same_as_billing === NULL){
|
||||
$shopping_user->same_as_billing = false;
|
||||
|
|
@ -518,6 +517,7 @@ class CheckoutController extends Controller
|
|||
$this->putPayments('shopping_order_margin_id', $shopping_order_margin->id);
|
||||
}
|
||||
}
|
||||
|
||||
private function putPayments($key, $value){
|
||||
$content = $this->getContent();
|
||||
$content->put($key, $value);
|
||||
|
|
@ -581,8 +581,6 @@ class CheckoutController extends Controller
|
|||
];
|
||||
Payment::paymentStatusSendMail($shopping_order, $shopping_payment, $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -45,10 +45,12 @@ class PaymentController extends Controller
|
|||
->addColumn('message', function (UserPayCredit $user_pay_credit) {
|
||||
if($user_pay_credit->status === 3){
|
||||
return nl2br($user_pay_credit->message);
|
||||
}elseif($user_pay_credit->status === 5 || $user_pay_credit->status === 6){
|
||||
return trans('payment.'.$user_pay_credit->message).
|
||||
' <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{
|
||||
return trans('payment.'.$user_pay_credit->message).
|
||||
' <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) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,10 @@ class PromotionController extends Controller
|
|||
if($user_promotion->user_id != Auth::user()->id){
|
||||
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 = [
|
||||
'checkPaymentCredit' => $user_promotion->checkPaymentCredit(),
|
||||
'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());
|
||||
}
|
||||
$model = $this->promoRepo->update($id, Request::all());
|
||||
|
||||
}
|
||||
\Session()->flash('alert-save', true);
|
||||
return redirect(route('user_promotion_detail', [$model->id]));
|
||||
|
|
|
|||
84
app/Http/Controllers/User/SalesController.php
Executable file
84
app/Http/Controllers/User/SalesController.php
Executable 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ use App\Services\Payment;
|
|||
use App\User;
|
||||
|
||||
|
||||
class ShopSalesController extends Controller
|
||||
class SalesController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
|
|
|
|||
|
|
@ -2,16 +2,22 @@
|
|||
|
||||
namespace App\Http\Controllers\Web;
|
||||
|
||||
use Yard;
|
||||
use Request;
|
||||
use Response;
|
||||
use Validator;
|
||||
use App\Services\Util;
|
||||
use App\Models\Product;
|
||||
use App\Models\UserHistory;
|
||||
use App\Models\PaymentMethod;
|
||||
use App\Models\PromotionUser;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Models\ShoppingPayment;
|
||||
use App\Services\PromotionCart;
|
||||
use App\Models\PaymentTransaction;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\CheckoutRepository;
|
||||
use App\Services\Payment;
|
||||
|
||||
class PromotionController extends Controller
|
||||
{
|
||||
|
|
@ -47,9 +53,8 @@ class PromotionController extends Controller
|
|||
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);
|
||||
|
||||
$data = [
|
||||
'promotion_user' => $PromotionUser,
|
||||
];
|
||||
|
|
@ -57,15 +62,29 @@ class PromotionController extends Controller
|
|||
if($load === 'thanksreminder'){
|
||||
return view('web.promotion.thanksreminder', $data);
|
||||
}
|
||||
if($load === 'thanksorder'){
|
||||
return view('web.promotion.thanksorder', $data);
|
||||
}
|
||||
if($load === 'notactive'){
|
||||
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){
|
||||
|
||||
$PromotionUser = PromotionUser::findOrFail($id);
|
||||
|
|
@ -78,13 +97,106 @@ class PromotionController extends Controller
|
|||
return redirect(route('web_promotion_goto', ['thanksreminder', $PromotionUser->id]));
|
||||
|
||||
}
|
||||
|
||||
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',
|
||||
);
|
||||
|
||||
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]));
|
||||
|
||||
}
|
||||
|
||||
dd($PromotionUser);
|
||||
}
|
||||
|
||||
|
||||
|
||||
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(){
|
||||
$data = Request::all();
|
||||
$ret = "";
|
||||
|
|
@ -94,32 +206,36 @@ class PromotionController extends Controller
|
|||
$product = Product::find($data['id']); //current user form order
|
||||
$ret = view("web.promotion.show_product", compact('product', 'data'))->render();
|
||||
}
|
||||
if($data['action'] === 'switch-free-product'){
|
||||
\App\Services\PromotionCart::updateFeeProduct($data);
|
||||
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
|
||||
if($data['perform']){
|
||||
if($data['action'] === 'switch-free-product'){
|
||||
\App\Services\PromotionCart::updateFeeProduct($data);
|
||||
}
|
||||
if($data['action'] === 'add-shop-product'){
|
||||
$data['qty'] = \App\Services\PromotionCart::updateProduct($data, true);
|
||||
}
|
||||
if($data['action'] === 'update-shop-product'){
|
||||
$data['qty'] = \App\Services\PromotionCart::updateProduct($data);
|
||||
}
|
||||
if($data['action'] === 'remove-shop-product'){
|
||||
\App\Services\PromotionCart::updateProduct($data);
|
||||
$data['qty'] = 0;
|
||||
}
|
||||
if($data['action'] === 'clear-cart'){
|
||||
\App\Services\PromotionCart::clearCart($data);
|
||||
}
|
||||
if($data['action'] === 'switch-shipping'){
|
||||
\App\Services\PromotionCart::switchShipping($data);
|
||||
}
|
||||
$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();
|
||||
|
||||
return response()->json(['response' => $data, 'cart'=>$cart, 'invoice'=>$invoice, 'checkout'=>$checkout, 'status'=>$status]);
|
||||
}
|
||||
if($data['action'] === 'add-shop-product'){
|
||||
$data['qty'] = \App\Services\PromotionCart::updateProduct($data, true);
|
||||
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
|
||||
}
|
||||
if($data['action'] === 'update-shop-product'){
|
||||
$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);
|
||||
$data['qty'] = 0;
|
||||
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
|
||||
}
|
||||
if($data['action'] === 'clear-cart'){
|
||||
\App\Services\PromotionCart::clearCart($data);
|
||||
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
|
||||
}
|
||||
|
||||
if($data['action'] === 'switch-shipping'){
|
||||
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
|
||||
}
|
||||
|
||||
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,11 @@ class MailCheckout extends Mailable
|
|||
$this->mode = $mode;
|
||||
|
||||
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'){
|
||||
$this->subject = __('email.checkout_subject_extern').": ";
|
||||
$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()
|
||||
{
|
||||
$salutation = __('email.hello').",";
|
||||
|
|
@ -82,6 +85,5 @@ class MailCheckout extends Mailable
|
|||
'mode' => $this->mode
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -53,6 +53,10 @@ use Illuminate\Database\Eloquent\Collection;
|
|||
* @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 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
|
||||
{
|
||||
|
|
@ -77,6 +81,8 @@ class PromotionAdmin extends Model
|
|||
'type',
|
||||
'name',
|
||||
'description',
|
||||
'user_description',
|
||||
'user_about',
|
||||
'from',
|
||||
'to',
|
||||
'shop',
|
||||
|
|
|
|||
126
app/Models/PromotionUserOrder.php
Normal file
126
app/Models/PromotionUserOrder.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -41,6 +41,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @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 wherePriceComp($value)
|
||||
* @property int|null $shipping_for
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShippingPrice whereShippingFor($value)
|
||||
*/
|
||||
class ShippingPrice extends Model
|
||||
{
|
||||
|
|
|
|||
|
|
@ -99,6 +99,11 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereShippedAt($value)
|
||||
* @property string|null $invoice_number
|
||||
* @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
|
||||
{
|
||||
|
|
@ -110,7 +115,9 @@ class ShoppingOrder extends Model
|
|||
protected $fillable = [
|
||||
'shopping_user_id',
|
||||
'auth_user_id',
|
||||
'promotion_user_id',
|
||||
'member_id',
|
||||
'payment_for',
|
||||
'country_id',
|
||||
'user_shop_id',
|
||||
'total',
|
||||
|
|
@ -135,6 +142,7 @@ class ShoppingOrder extends Model
|
|||
'mode',
|
||||
'shipped',
|
||||
'shipped_at',
|
||||
'shipping_option',
|
||||
'tracking'
|
||||
];
|
||||
|
||||
|
|
@ -152,6 +160,15 @@ class ShoppingOrder extends Model
|
|||
10 => 'storniert'
|
||||
];
|
||||
|
||||
public static $paymentForTypes = [
|
||||
0 => '',
|
||||
1 => 'wizzard',
|
||||
2 => 'user_order me',
|
||||
3 => 'user_order ot',
|
||||
4 => 'Promotion',
|
||||
10 => ''
|
||||
];
|
||||
|
||||
public static $apiShippedTypes = [
|
||||
0 => 'open', //(Fullfilment durch Händler)',
|
||||
1 => 'process', //(Fullfilment durch MIVITA: nicht Versand)
|
||||
|
|
@ -183,6 +200,11 @@ class ShoppingOrder extends Model
|
|||
return $this->belongsTo('App\Models\ShippingCountry','country_id');
|
||||
}
|
||||
|
||||
public function promotion_user()
|
||||
{
|
||||
return $this->belongsTo('App\Models\PromotionUser','promotion_user_id');
|
||||
}
|
||||
|
||||
//can null
|
||||
public function member()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @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 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
|
||||
{
|
||||
|
|
@ -58,6 +61,7 @@ class ShoppingOrderItem extends Model
|
|||
'row_id',
|
||||
'product_id',
|
||||
'comp',
|
||||
'free_product_id',
|
||||
'qty',
|
||||
'price',
|
||||
'price_net',
|
||||
|
|
@ -97,4 +101,14 @@ class ShoppingOrderItem extends Model
|
|||
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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -88,6 +88,9 @@ class ShoppingPayment extends Model
|
|||
if($this->clearingtype === 'fnc') {
|
||||
return 'Rechnung';
|
||||
}
|
||||
if($this->clearingtype === 'non') {
|
||||
return 'keine';
|
||||
}
|
||||
}
|
||||
|
||||
public function getPaymentAmount(){
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ class UserPayCredit extends Model
|
|||
2 => 'deduction from payment',
|
||||
3 => 'manually added credit',
|
||||
4 => 'return from order',
|
||||
|
||||
5 => 'deduction from promotion',
|
||||
6 => 'return from promotion',
|
||||
];
|
||||
protected $table = 'user_pay_credits';
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::domain('api.'.config('app.domain'))
|
||||
Route::domain('api.'.config('app.api_domain'))
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
|
|
|
|||
226
app/Repositories/CheckoutRepository.php
Normal file
226
app/Repositories/CheckoutRepository.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -29,10 +29,19 @@ class CustomerPriority
|
|||
return $shopping_users;
|
||||
}
|
||||
|
||||
public static function checkOne($shopping_user, $mail=false, $newCustomer = true){
|
||||
//look for entry
|
||||
if(self::entryExists($shopping_user)){
|
||||
return 'exists';
|
||||
public static function checkOne($shopping_user, $mail=false, $newCustomer = true, $entryExistsLike = false){
|
||||
//look for entry
|
||||
if($entryExistsLike){
|
||||
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($mail){ //send mail
|
||||
|
|
@ -122,6 +131,7 @@ class CustomerPriority
|
|||
->where('number', '!=', NULL) //has number
|
||||
->where('id', '!=', $shopping_user->id)
|
||||
->where('billing_email', '=', $data['billing_email'])
|
||||
->where('member_id', '!=', $shopping_user->member_id)
|
||||
->get()->pluck('number', 'id')->unique()->toArray();
|
||||
if($found && count($found)){
|
||||
foreach ($found as $key=>$val){
|
||||
|
|
@ -139,6 +149,7 @@ class CustomerPriority
|
|||
->where('id', '!=', $shopping_user->id)
|
||||
->where('billing_lastname', '=', $data['billing_lastname'])
|
||||
->where('billing_zipcode', '=', $data['billing_zipcode'])
|
||||
->where('member_id', '!=', $shopping_user->member_id)
|
||||
->get()->pluck('number', 'id')->unique()->toArray();
|
||||
if($found && count($found)){
|
||||
foreach ($found as $key=>$val){
|
||||
|
|
@ -193,11 +204,30 @@ class CustomerPriority
|
|||
$shopping_user->shopping_order->member_id = $match->member_id;
|
||||
$shopping_user->shopping_order->save();
|
||||
}
|
||||
\App\Services\Shop::newUserOrder($shopping_user->number);
|
||||
return true;
|
||||
}
|
||||
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){
|
||||
//check same last name und PLZ
|
||||
$matches = ShoppingUser::select('*')
|
||||
|
|
@ -217,13 +247,16 @@ class CustomerPriority
|
|||
}
|
||||
|
||||
private static function newCustomer($shopping_user){
|
||||
if($shopping_user->shopping_order && $shopping_user->shopping_order->member_id) {
|
||||
$member_id = $shopping_user->shopping_order->member_id;
|
||||
if($shopping_user->member_id) {
|
||||
$member_id = $shopping_user->member_id;
|
||||
$shopping_user->member_id = $member_id;
|
||||
$shopping_user->number = self::nextNumber();
|
||||
$shopping_user->save();
|
||||
$shopping_user->shopping_order->member_id = $member_id;
|
||||
$shopping_user->shopping_order->save();
|
||||
if($shopping_user->shopping_order){
|
||||
$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->save();
|
||||
\App\Services\Shop::newUserOrder($shopping_user->number);
|
||||
|
||||
}
|
||||
|
||||
private static function changeCustomer($shopping_user, $member_id, $number){
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use App\Models\ShoppingOrder;
|
|||
use App\Models\UserPayCredit;
|
||||
use App\Models\ShoppingPayment;
|
||||
use App\Models\UserCreditMargin;
|
||||
use App\Models\PromotionUserOrder;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class Payment
|
||||
|
|
@ -135,7 +136,7 @@ class Payment
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**/
|
||||
public static function paymentStatusPaidAction(ShoppingOrder $shopping_order, $paid){
|
||||
$send_link = false;
|
||||
|
||||
|
|
@ -197,7 +198,6 @@ class Payment
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
//if the order has action
|
||||
if($shopping_order->shopping_user->is_from === 'user_order'){
|
||||
//is margin -> set paid
|
||||
|
|
@ -209,10 +209,44 @@ class Payment
|
|||
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
|
||||
//when stone, put it back SalesController
|
||||
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){
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,11 +35,19 @@ class PromotionCart
|
|||
}
|
||||
}
|
||||
|
||||
public static function clearCart($data, $add=false)
|
||||
public static function clearCart($data)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if($product = Product::find($data['product_id'])){
|
||||
|
|
@ -77,13 +85,13 @@ class PromotionCart
|
|||
//wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl
|
||||
//wenn gleich löschen, da neue Versandkosten
|
||||
|
||||
if($row->options->free_product) {
|
||||
if($row->options->free_product_id) {
|
||||
Yard::instance('shopping')->remove($row->rowId);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($data['free_poduct_id'])) {
|
||||
if ($product = Product::find($data['free_poduct_id'])) {
|
||||
if(isset($data['free_product_id'])) {
|
||||
if ($product = Product::find($data['product_id'])) {
|
||||
$image = "";
|
||||
if ($product->images->count()) {
|
||||
$image = $product->images->first()->slug;
|
||||
|
|
@ -92,8 +100,8 @@ class PromotionCart
|
|||
[
|
||||
'image' => $image,
|
||||
'slug' => $product->slug,
|
||||
'weight' => 0,
|
||||
'free_product' => 1,
|
||||
'weight' => $product->weight,
|
||||
'free_product_id' => intval($data['free_product_id']),
|
||||
'product_id' => $product->id
|
||||
]);
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class Yard extends Cart
|
|||
private $yard_margin;
|
||||
|
||||
private $global_tax_rate = 0;
|
||||
private $shipping_option; //pick_up//dhl_shipping
|
||||
|
||||
public function __construct(SessionManager $session, Dispatcher $events)
|
||||
{
|
||||
|
|
@ -53,42 +54,33 @@ class Yard extends Cart
|
|||
if($this->getYardExtra('shipping_price')){
|
||||
$this->shipping_price = (float) ($this->getYardExtra('shipping_price'));
|
||||
}
|
||||
|
||||
if($this->getYardExtra('shipping_price_net')){
|
||||
$this->shipping_price_net = (float) ($this->getYardExtra('shipping_price_net'));
|
||||
}
|
||||
|
||||
if($this->getYardExtra('shipping_tax_rate')){
|
||||
$this->shipping_tax_rate = (float) ($this->getYardExtra('shipping_tax_rate'));
|
||||
}
|
||||
|
||||
if($this->getYardExtra('shipping_tax')){
|
||||
$this->shipping_tax = (float) ($this->getYardExtra('shipping_tax'));
|
||||
}
|
||||
|
||||
if($this->getYardExtra('shipping_country_id')){
|
||||
$this->shipping_country_id = $this->getYardExtra('shipping_country_id');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('shipping_is_for')){
|
||||
$this->shipping_is_for = $this->getYardExtra('shipping_is_for');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('shopping_user')){
|
||||
$this->user = $this->getYardExtra('shopping_user');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('user')){
|
||||
$this->user = $this->getYardExtra('user');
|
||||
}
|
||||
if($this->getYardExtra('payment_credit')){
|
||||
$this->payment_credit = $this->getYardExtra('payment_credit');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('yard_commission')){
|
||||
$this->yard_commission = $this->getYardExtra('yard_commission');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('yard_margin')){
|
||||
$this->yard_margin = $this->getYardExtra('yard_margin');
|
||||
}
|
||||
|
|
@ -97,10 +89,12 @@ class Yard extends Cart
|
|||
}else{
|
||||
$this->global_tax_rate = config('cart.tax');
|
||||
}
|
||||
|
||||
if($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);
|
||||
|
|
@ -123,10 +117,31 @@ class Yard extends Cart
|
|||
}
|
||||
|
||||
public function setGlobalTaxRate($value){
|
||||
|
||||
$this->global_tax_rate = floatval($value);
|
||||
$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){
|
||||
|
|
@ -272,7 +287,6 @@ class Yard extends Cart
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$margin->setCommission($this->yard_commission);
|
||||
$margin->calculate();
|
||||
|
||||
|
|
@ -318,6 +332,15 @@ class Yard extends Cart
|
|||
|
||||
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);
|
||||
if(!$shippingCountry){
|
||||
return;
|
||||
|
|
@ -346,7 +369,6 @@ class Yard extends Cart
|
|||
}
|
||||
//default
|
||||
if(!$shipping_price){
|
||||
|
||||
$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_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
|
||||
|
||||
$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);
|
||||
$this->putShippingPrices();
|
||||
}
|
||||
}
|
||||
|
||||
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){
|
||||
foreach ($prices as $price){
|
||||
if($price->total_from > 0 && $price->total_to > 0){
|
||||
|
|
@ -386,6 +412,7 @@ class Yard extends Cart
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function shippingPriceByWeight($prices, $weight){
|
||||
foreach ($prices as $price){
|
||||
if($price->weight_from > 0 && $price->weight_to > 0){
|
||||
|
|
@ -686,8 +713,8 @@ class Yard extends Cart
|
|||
|
||||
public function getFreeProductId(){
|
||||
foreach ($this->content() as $row) {
|
||||
if($row->options->free_product) {
|
||||
return $row->options->product_id;
|
||||
if($row->options->free_product_id) {
|
||||
return $row->options->free_product_id;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -699,6 +726,8 @@ class Yard extends Cart
|
|||
foreach ($this->content() as $row) {
|
||||
if($row->options->comp){
|
||||
$comp[100+$row->options->comp] = $row;
|
||||
}elseif($row->options->free_product_id){
|
||||
$comp[200] = $row;
|
||||
}else{
|
||||
$ret[] = $row;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ return [
|
|||
| 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'),
|
||||
'domain' => env('APP_DOMAIN', 'partner.gruene-seele.bio'),
|
||||
|
|
|
|||
25
config/paypal.php
Normal file
25
config/paypal.php
Normal 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.
|
||||
];
|
||||
|
|
@ -30,7 +30,6 @@ class CreateShoppingOrdersTable extends Migration
|
|||
$table->decimal('discount', 13, 2)->nullable();
|
||||
$table->decimal('subtotal', 13, 2)->nullable();
|
||||
|
||||
|
||||
$table->decimal('shipping', 8, 2)->nullable();
|
||||
$table->decimal('shipping_net', 8, 2)->nullable();
|
||||
|
||||
|
|
@ -55,7 +54,8 @@ class CreateShoppingOrdersTable extends Migration
|
|||
$table->string('txaction', 20)->nullable()->index();
|
||||
$table->unsignedTinyInteger('shipped')->default(0);
|
||||
$table->timestamp('shipped_at')->nullable();
|
||||
|
||||
$table->string('shipping_option', 20)->nullable()->index();
|
||||
|
||||
$table->string('tracking', 255)->nullable();
|
||||
|
||||
$table->char('mode', 4)->nullable();
|
||||
|
|
|
|||
|
|
@ -21,12 +21,11 @@ class CreateShoppingOrderItemsTable extends Migration
|
|||
$table->unsignedInteger('product_id');
|
||||
|
||||
$table->unsignedTinyInteger('comp')->nullable();
|
||||
|
||||
$table->unsignedTinyInteger('free_product')->nullable();
|
||||
|
||||
$table->unsignedInteger('qty');
|
||||
$table->decimal('price', 8, 2)->nullable();
|
||||
$table->decimal('price_net', 8, 3)->nullable();
|
||||
|
||||
$table->decimal('tax_rate', 5, 2)->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class CreatePromotionAdminsTable extends Migration
|
|||
|
||||
$table->string('name', 255);
|
||||
$table->text('description')->nullable();
|
||||
$table->text('user_description')->nullable();
|
||||
$table->text('user_about')->nullable();
|
||||
|
||||
$table->date('from')->nullable();
|
||||
$table->date('to')->nullable();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class CreatePromotionUserProductsTable extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::create('promotion_user_products', function (Blueprint $table) {
|
||||
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('promotion_admin_id')->index();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ label .required {
|
|||
transition: box-shadow 0.4s ease;
|
||||
position: relative;
|
||||
background-color: #fafafa;
|
||||
padding: 30px 30px 40px;
|
||||
padding: 30px 20px 40px;
|
||||
}
|
||||
|
||||
.checkout-order:before {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ var IqPromotionCart = {
|
|||
tempData.push({product_id: $(this).data('product-id'), qty: $(this).val()});
|
||||
}
|
||||
});
|
||||
|
||||
data.action = $(_self.table).data('action');
|
||||
data.user_promotion_id = $(_self.table).data('user_promotion_id');
|
||||
data.products = tempData;
|
||||
|
|
@ -89,11 +88,15 @@ var IqPromotionCart = {
|
|||
update_poduct_price: function(){
|
||||
console.log("s");
|
||||
var _self = this;
|
||||
|
||||
$('.calculate_product_qty_price').each(function(){
|
||||
var qty = _self.checkNumber($(_self.table).find('#'+$(this).data('qty-id')).val());;
|
||||
|
||||
$('.calculate_product_qty_price_total').each(function(){
|
||||
var admin_product_id = $(this).data('admin_product_id');
|
||||
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('.', ','))
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -17,8 +17,10 @@ var IqPromotionShopCart = {
|
|||
url: null,
|
||||
action: null,
|
||||
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,
|
||||
|
||||
|
||||
|
|
@ -77,9 +79,9 @@ var IqPromotionShopCart = {
|
|||
switchFreeProduct: function(_ele){
|
||||
var _self = this;
|
||||
if(_ele.prop('checked')){
|
||||
if(_self.free_poduct_id != _ele.val()){
|
||||
_self.free_poduct_id = _ele.val();
|
||||
_self.performRequest({free_poduct_id: _self.free_poduct_id, action: 'switch-free-product'})
|
||||
if(_self.free_product_id != _ele.val()){
|
||||
_self.free_product_id = _ele.val();
|
||||
_self.performRequest({free_product_id: _self.free_product_id, product_id: _ele.data('product_id'), action: 'switch-free-product'})
|
||||
.done(_self.refreshItemsAndView);
|
||||
}
|
||||
}
|
||||
|
|
@ -119,12 +121,21 @@ var IqPromotionShopCart = {
|
|||
var qty = data.response.qty > 0 ? "x"+data.response.qty : 0;
|
||||
$('#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();
|
||||
},
|
||||
performRequest : function(data) {
|
||||
var _self = this;
|
||||
var url = _self.url;
|
||||
data.perform = true;
|
||||
_log(data);
|
||||
// _log(url);
|
||||
return $.ajax({
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
'your_request_from' => 'Deine Anfrage von',
|
||||
'checkout_subject' => 'Deine Bestellung',
|
||||
'checkout_subject_paid' => 'Zahlungsbestätigung - Deine Bestellung',
|
||||
'checkout_subject_non_paid' => 'Bestätigung - Deine Bestellung',
|
||||
'checkout_subject_extern' => 'Neue Bestellung',
|
||||
'change_e_mail' => 'E-Mail Adresse ändern',
|
||||
'salutation' => 'Hallo',
|
||||
|
|
@ -66,6 +67,7 @@
|
|||
'checkout_mail_your_mail' => 'Deine E-Mai:',
|
||||
'checkout_mail_invoice_addess' => 'Deine Rechnungsadresse:',
|
||||
'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_order_for_me' => 'Beraterbestellung für Dich:',
|
||||
'checkout_mail_order_for_ot' => 'Beraterbestellung für Deinen Kunden:',
|
||||
|
|
@ -86,5 +88,6 @@
|
|||
'checkout_mail_bank_code' => 'Verwendungszweck',
|
||||
'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_non' => 'Deine Bestellung wurde ausgeführt.',
|
||||
'checkout_mail_system_status' => 'SystemStatus:',
|
||||
);
|
||||
|
|
@ -23,4 +23,7 @@ return [
|
|||
'payment_for_account' => 'Aufladung durch Mitgliedschaft',
|
||||
'user_order_deduction' => 'Abzug durch Bestellung',
|
||||
'user_order_return' => 'Rückführung durch Storno',
|
||||
'promotion_order_deduction' => 'Abzug durch Promotion Produkt',
|
||||
'promotion_order_return' => 'Rückführung durch Promotion Produkt',
|
||||
|
||||
];
|
||||
|
|
@ -75,6 +75,8 @@
|
|||
<p>
|
||||
<span class="text-muted">#{{$current->member->number}}</span><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>
|
||||
@if($current->member->shop)
|
||||
@if($current->member->isActive() && $current->member->isActiveShop())
|
||||
|
|
|
|||
|
|
@ -34,17 +34,28 @@
|
|||
<div class="form-row">
|
||||
<div class="form-group col-12">
|
||||
<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 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">
|
||||
<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')) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<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')) }}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,14 @@
|
|||
<strong>Vertriebspartnerbestellung für Mitgliedschaft</strong>
|
||||
@endif
|
||||
@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
|
||||
@if($shopping_order->shopping_user->is_from === 'homeparty')
|
||||
<h5>Vertriebspartnerbestellung für eine Homeparty</h5>
|
||||
|
|
@ -319,7 +326,6 @@
|
|||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-product m-0" style="">
|
||||
<tbody>
|
||||
|
|
@ -352,7 +358,10 @@
|
|||
<small>
|
||||
<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">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>
|
||||
</div>
|
||||
@endif
|
||||
|
|
@ -379,7 +388,6 @@
|
|||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<style>
|
||||
|
|
@ -475,7 +483,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr class="m-0">
|
||||
|
||||
@if($shopping_order->txaction === 'extern')
|
||||
<div class="card-body">
|
||||
@if($shopping_order->wp_invoice_path)
|
||||
|
|
@ -502,8 +509,6 @@
|
|||
</div>
|
||||
<hr class="m-0">
|
||||
@endif
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
<h6 class="small font-weight-semibold">
|
||||
Zahlung
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
<th>{{__('Zahlung')}}</th>
|
||||
<th>{{__('Status')}}</th>
|
||||
<th>{{__('Versand')}}</th>
|
||||
<th>{{__('Art')}}</th>
|
||||
<th>{{__('First name')}}</th>
|
||||
<th>{{__('Last name')}}</th>
|
||||
<th>{{__('E-Mail')}}</th>
|
||||
|
|
@ -79,6 +80,7 @@
|
|||
{ data: 'payment', name: 'payment', orderable: false },
|
||||
{ data: 'txaction', name: 'txaction' },
|
||||
{ data: 'shipped', name: 'shipped' },
|
||||
{ data: 'is_for', name: 'is_for' },
|
||||
{ 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' },
|
||||
|
|
|
|||
|
|
@ -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%">
|
||||
<tr>
|
||||
<td style="line-height:1.6em;">
|
||||
@if($shopping_payment->clearingtype !== "non")
|
||||
<b>{{__('email.checkout_mail_pay_success')}} </b><br>
|
||||
{{__('email.checkout_mail_pay_with')}} {{$shopping_payment->getPaymentType()}}<br>
|
||||
@endif
|
||||
{{__('email.checkout_mail_pay_ref')}} {{$shopping_payment->reference}}<br>
|
||||
{{__('email.checkout_mail_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}<br>
|
||||
</td>
|
||||
|
|
@ -285,6 +287,32 @@
|
|||
<hr>
|
||||
</td>
|
||||
</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>
|
||||
<td style="color:#37302d;font-size: 14px;line-height:1.6em;">
|
||||
<table style="margin: 0 auto;" cellpadding="0" cellspacing="0" width="100%">
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@
|
|||
<b>{{__('email.checkout_mail_pay_error')}}</b><br>
|
||||
|
||||
@elseif($txaction === 'open')
|
||||
|
||||
@if($shopping_payment->clearingtype === "vor")
|
||||
<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>
|
||||
|
|
@ -161,16 +160,21 @@
|
|||
</p>
|
||||
<hr />
|
||||
@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
|
||||
@elseif($txaction === 'xxx')
|
||||
<b>{{__('email.checkout_mail_pay_approved')}}</b><br>
|
||||
|
||||
@else
|
||||
<b>{{__('email.checkout_mail_system_status')}} {{$txaction}}</b><br>
|
||||
|
||||
@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_your_mail')}} {{ $shopping_order->shopping_user->billing_email }}<br>
|
||||
</td>
|
||||
|
|
@ -274,6 +278,33 @@
|
|||
<hr>
|
||||
</td>
|
||||
</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>
|
||||
<td style="color:#37302d;font-size: 14px;">
|
||||
<table style="margin: 0 auto;" cellpadding="0" cellspacing="0" width="100%">
|
||||
|
|
|
|||
|
|
@ -62,12 +62,15 @@
|
|||
<div>{{ __('navigation.my_clients') }}</div>
|
||||
</a>
|
||||
<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>
|
||||
</li>
|
||||
<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>
|
||||
</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>
|
||||
</li>
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -269,7 +269,9 @@
|
|||
@if($shopping_order->shopping_user->billing_company)
|
||||
{{ $shopping_order->shopping_user->billing_company }}<br>
|
||||
@else
|
||||
@if($shopping_order->payment_for !== 4)
|
||||
Firma <br>
|
||||
@endif
|
||||
@endif
|
||||
{{ \App\Services\HTMLHelper::getSalutationLang($shopping_order->shopping_user->billing_salutation) }}
|
||||
{{ $shopping_order->shopping_user->billing_firstname }} {{ $shopping_order->shopping_user->billing_lastname }}<br>
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@
|
|||
{{ $promotion_admin_product->getFormattedPriceWith(false) }} €
|
||||
</td>
|
||||
<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> €
|
||||
<span class="calculate_product_qty_price_total" data-admin_product_id="{{ $promotion_admin_product->id }}" data-price="{{ $promotion_admin_product->getPriceWith(false) }}"></span> €
|
||||
</td>
|
||||
<td class="align-middle px-3 py-2 text-right" style="">
|
||||
{{ $promotion_admin_product->getPromotionUserProducts($user_promotion, 'sell_items') }}
|
||||
|
|
|
|||
10
resources/views/user/sales/order_detail.blade.php
Normal file
10
resources/views/user/sales/order_detail.blade.php
Normal 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
|
||||
58
resources/views/user/sales/orders.blade.php
Normal file
58
resources/views/user/sales/orders.blade.php
Normal 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
|
||||
|
|
@ -2,9 +2,10 @@
|
|||
<strong>#### TEST MODE #### TEST MODE ####</strong>
|
||||
@endif
|
||||
<div class="checkout-order mt-4">
|
||||
@if(Yard::instance('shopping')->isWithPayments())
|
||||
<h3 class="">Zahlungsart auswählen</h3>
|
||||
<div id="error-payment_method"></div>
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive mb-4">
|
||||
<table class="table table-payment m-0" id="">
|
||||
<tbody class="switchers-stacked">
|
||||
@if (true || \App\Models\PaymentMethod::isShowPaymentMethod('PP', $user_payment_methods, 0))
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
</tr>
|
||||
|
||||
@endif
|
||||
{{--
|
||||
@if (true || \App\Models\PaymentMethod::isShowPaymentMethod('SB', $user_payment_methods, 0))
|
||||
<tr>
|
||||
<td class="align-middle px-0 pl-1p">
|
||||
|
|
@ -40,7 +42,7 @@
|
|||
<span class="switcher-no"></span>
|
||||
</span>
|
||||
<span class="switcher-label font-weight-bold text-left">Sofort
|
||||
-Überweisung</span>
|
||||
Überweisung</span>
|
||||
</label>
|
||||
</td>
|
||||
<td class="text-right align-middle px-0 py-3 ui-w-100">
|
||||
|
|
@ -69,6 +71,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
--}}
|
||||
@if (true || \App\Models\PaymentMethod::isShowPaymentMethod('VOR', $user_payment_methods, 0))
|
||||
<tr>
|
||||
<td class="align-middle px-0 pl-1p">
|
||||
|
|
@ -92,34 +95,34 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h3 class="mt-4">Warenkorb</h3>
|
||||
@endif
|
||||
<h3 class="">Warenkorb</h3>
|
||||
<div class="checkout-cart">
|
||||
<div class="mb-2">
|
||||
<span class="float-right">0,00 €</span>
|
||||
<span class="float-right">{{ Yard::instance('shopping')->total() }} €</span>
|
||||
<strong class="">Zwischensumme:</strong>
|
||||
</div>
|
||||
<hr class="light">
|
||||
<div class="mb-2">
|
||||
<span class="float-right">0,00 € </span>
|
||||
<span class="float-right">{{ Yard::instance('shopping')->shipping() }} €</span>
|
||||
<span class="">Versandkosten:</span>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<span class="float-right">Deutschland</span>
|
||||
<span class="float-right">{{ Yard::instance('shopping')->getShippingCountryName() }}</span>
|
||||
<span class="">Lieferland:</span>
|
||||
</div>
|
||||
<hr class="light">
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<hr class="light">
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
</button>
|
||||
<hr class="light">
|
||||
<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 Du wist zu unserem Zahlungsanbieter weitergeleitet,
|
||||
die Verbindung ist SSL verschlüsselt.</em></p>
|
||||
@if(Yard::instance('shopping')->isWithPayments())
|
||||
<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 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>
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@
|
|||
<div class="mt-4 mb-3">
|
||||
<div class="switcher-holder btn-add-free-product">
|
||||
<label class="switcher switcher-success">
|
||||
<input type="radio" class="switcher-input" name="user_free_product"
|
||||
value="{{ $promotion_user_product->product->id }}" data-error="#error-user_free_product"
|
||||
@if($free_product_id === $promotion_user_product->product->id) checked @endif
|
||||
<input type="radio" class="switcher-input" name="free_product_id"
|
||||
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->id) checked @endif
|
||||
required>
|
||||
<span class="switcher-indicator">
|
||||
<span class="switcher-yes">
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
@endif
|
||||
@endforeach
|
||||
<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="">
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -232,4 +232,78 @@
|
|||
@endif
|
||||
</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>
|
||||
133
resources/views/web/promotion/_invoice_details_quick.blade.php
Normal file
133
resources/views/web/promotion/_invoice_details_quick.blade.php
Normal 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>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="options">
|
||||
@if(!$row->options->free_product)
|
||||
@if(!$row->options->free_product_id)
|
||||
<a href="#"
|
||||
class="auto-delete-product remove_item_form_cart product-tooltip"
|
||||
data-row-id="{{$row->rowId}}"
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
{{ Yard::instance('shopping')->rowPrice($row, 2) }} €*</div>
|
||||
</div>
|
||||
<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">
|
||||
<input type="number"
|
||||
class="form-control text-center cart-input-event-onchange"
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@
|
|||
<div class="col-md-6 text-left">
|
||||
<h2 class="mt-3">Wähle Deine Versandart</h2>
|
||||
<div class="switchers-stacked">
|
||||
@php($shipping_option = Yard::instance('shopping')->getShippingOption())
|
||||
<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-yes">
|
||||
<span class="ion ion-md-checkmark"></span>
|
||||
|
|
@ -26,7 +28,8 @@
|
|||
</label>
|
||||
--}}
|
||||
<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-yes">
|
||||
<span class="ion ion-md-checkmark"></span>
|
||||
|
|
|
|||
|
|
@ -52,4 +52,39 @@
|
|||
* Preis inkl. gesetzl. MwSt. | zzgl. Versandkosten
|
||||
<hr class="">
|
||||
</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>
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
{!! 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') }}">
|
||||
<div class="layout-content">
|
||||
|
|
@ -37,12 +36,18 @@
|
|||
<section>
|
||||
<div class="row">
|
||||
<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 class="col-lg-4 col-md-5">
|
||||
@include('web.promotion._checkout')
|
||||
|
||||
<section id="promotion_checkout_holder">
|
||||
@include('web.promotion._checkout')
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -50,110 +55,11 @@
|
|||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
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>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
|
|
|
|||
|
|
@ -15,22 +15,62 @@
|
|||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{!! 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="container px-3">
|
||||
|
||||
<div class="container flex-grow-1 container-p-y pb-0">
|
||||
<div class="media align-items-center pt-3 mb-3">
|
||||
{{-- <img src="assets/img/avatars/5-small.png" alt="" class="d-block ui-w-100 rounded-circle"> --}}
|
||||
<div class="media align-items-top py-3 mb-3">
|
||||
@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">
|
||||
<h1 class="text-center">Super, geschafft!</h1>
|
||||
<p class="text-center">
|
||||
Ich danke Dir ..
|
||||
</p>
|
||||
<p class="text-center">Liebe Grüße,<br>{{ $promotion_user->user->getFullName() }}<br>Vertriebspartner:in der GRÜNEN SEELE Naturkosmetik</p>
|
||||
<h1 class="text-left">Super, geschafft!</h1>
|
||||
<p class="text-left">
|
||||
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.
|
||||
In Kürze erhälst Du von uns eine Bestellbestätigungsmail.</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 & 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>
|
||||
|
|
@ -41,11 +81,8 @@
|
|||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ Route::domain(config('app.domain'))->group(function () {
|
|||
|
||||
|
||||
//user shop Sales
|
||||
Route::get('/user/shop/orders', 'User\ShopSalesController@orders')->name('user_shop_orders');
|
||||
Route::get('/user/shop/order/detail/{id}', 'User\ShopSalesController@orderDetail')->name('user_shop_order_detail');
|
||||
Route::get('/user/shop/orders/datatable', 'User\ShopSalesController@ordersDatatable')->name('user_shop_orders_datatable');
|
||||
Route::get('/user/sales/orders', 'User\SalesController@orders')->name('user_sales_orders');
|
||||
Route::get('/user/sales/order/detail/{id}', 'User\SalesController@orderDetail')->name('user_sales_order_detail');
|
||||
Route::get('/user/sales/orders/datatable', 'User\SalesController@ordersDatatable')->name('user_sales_orders_datatable');
|
||||
|
||||
//user team
|
||||
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::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::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', '.+');
|
||||
|
||||
});
|
||||
BIN
vendor.tar
BIN
vendor.tar
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue