Erweiterungen / Korrekturen Beraterbestellungen
This commit is contained in:
parent
ecc71c616f
commit
c4ed6b39db
36 changed files with 1104 additions and 617 deletions
|
|
@ -83,7 +83,9 @@ 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);
|
||||
}
|
||||
|
||||
if($shopping_user->same_as_billing === NULL){
|
||||
$shopping_user->same_as_billing = false;
|
||||
}
|
||||
|
||||
if(old('selected_country') && old('selected_country') === 'change'){
|
||||
\Session::forget('_old_input.selected_country');
|
||||
|
|
@ -99,9 +101,7 @@ class CheckoutController extends Controller
|
|||
//$shopping_user->save();
|
||||
}
|
||||
|
||||
if($shopping_user->same_as_billing === NULL){
|
||||
$shopping_user->same_as_billing = true;
|
||||
}
|
||||
|
||||
|
||||
if($is_from !== 'shopping' && Util::getAuthUser()){
|
||||
$user = Util::getAuthUser();
|
||||
|
|
@ -174,7 +174,7 @@ class CheckoutController extends Controller
|
|||
$shopping_user->shopping_user_id = $data['shopping_user_id'];
|
||||
$shopping_user->member_id = $s_user->member_id;
|
||||
}
|
||||
$shopping_user->same_as_billing = false;
|
||||
$shopping_user->same_as_billing = true;
|
||||
$shopping_user->shipping_salutation = isset($data['shipping_salutation']) ? $data['shipping_salutation'] : '';
|
||||
$shopping_user->shipping_company = isset($data['shipping_company']) ? $data['shipping_company'] : '';
|
||||
$shopping_user->shipping_firstname = isset($data['shipping_firstname']) ? $data['shipping_firstname'] : '';
|
||||
|
|
@ -187,7 +187,7 @@ class CheckoutController extends Controller
|
|||
$shopping_user->shipping_phone = isset($data['shipping_phone']) ? $data['shipping_phone'] : '';
|
||||
|
||||
}else{
|
||||
$shopping_user->same_as_billing = $user->account->same_as_billing;
|
||||
$shopping_user->same_as_billing = $user->account->same_as_billing ? false : true;
|
||||
$shopping_user->shipping_salutation = $user->account->shipping_salutation;
|
||||
$shopping_user->shipping_company = $user->account->shipping_company;
|
||||
$shopping_user->shipping_firstname = $user->account->shipping_firstname;
|
||||
|
|
@ -209,7 +209,7 @@ class CheckoutController extends Controller
|
|||
$data = Request::all();
|
||||
//change selected Country
|
||||
if(isset($data['selected_country']) && $data['selected_country'] === 'change'){
|
||||
if(Request::get('same_as_billing')){
|
||||
if(!Request::get('same_as_billing')){
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($data['billing_state'], $data['is_for']);
|
||||
}else{
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($data['shipping_state'], $data['is_for']);
|
||||
|
|
@ -228,7 +228,7 @@ class CheckoutController extends Controller
|
|||
'accepted_data_checkbox' => 'accepted',
|
||||
);
|
||||
|
||||
if(!Request::get('same_as_billing')){
|
||||
if(Request::get('same_as_billing')){
|
||||
$rules = array_merge($rules, [
|
||||
'shipping_firstname'=>'required',
|
||||
'shipping_lastname'=>'required',
|
||||
|
|
@ -432,7 +432,7 @@ class CheckoutController extends Controller
|
|||
|
||||
private function makeShoppingUser($data){
|
||||
|
||||
$data['same_as_billing'] = isset($data['same_as_billing']) ? true : false;
|
||||
$data['same_as_billing'] = isset($data['same_as_billing']) ? false : true; //reinvert
|
||||
$data['accepted_data_checkbox'] = isset($data['accepted_data_checkbox']) ? true : false;
|
||||
|
||||
$shopping_user = false;
|
||||
|
|
@ -494,7 +494,7 @@ class CheckoutController extends Controller
|
|||
$this->putPayments('shopping_order_id', $shopping_order->id);
|
||||
|
||||
|
||||
$items = Yard::instance('shopping')->content();
|
||||
$items = Yard::instance('shopping')->getContentByOrder();
|
||||
|
||||
$shopping_order->shopping_order_items()->each(function($model) use ($items, $shopping_order) {
|
||||
foreach ($items as $item) {
|
||||
|
|
@ -503,6 +503,7 @@ class CheckoutController extends Controller
|
|||
'shopping_order_id' => $shopping_order->id,
|
||||
'row_id' => $item->rowId,
|
||||
'product_id' => $item->id,
|
||||
'comp' => $item->options->comp,
|
||||
'qty' => $item->qty,
|
||||
'price' => $item->price,
|
||||
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
|
||||
|
|
@ -521,6 +522,7 @@ class CheckoutController extends Controller
|
|||
'shopping_order_id' => $shopping_order->id,
|
||||
'row_id' => $item->rowId,
|
||||
'product_id' => $item->id,
|
||||
'comp' => $item->options->comp,
|
||||
'qty' => $item->qty,
|
||||
'price' => $item->price,
|
||||
'price_net' => Yard::instance('shopping')->rowPriceNet($item, 3, '.', ''),
|
||||
|
|
@ -528,7 +530,6 @@ class CheckoutController extends Controller
|
|||
'slug' => $item->options->slug
|
||||
]);
|
||||
};
|
||||
|
||||
return $shopping_order;
|
||||
}
|
||||
|
||||
|
|
@ -567,8 +568,10 @@ class CheckoutController extends Controller
|
|||
$shopping_order->txaction = 'invoice_open';
|
||||
$shopping_order->save();
|
||||
$shopping_payment = ShoppingPayment::where('reference', $payt->transmitted_data['reference'])->first();
|
||||
$shopping_payment->txaction = 'invoice_open';
|
||||
$shopping_payment->save();
|
||||
if($shopping_payment){
|
||||
$shopping_payment->txaction = 'invoice_open';
|
||||
$shopping_payment->save();
|
||||
}
|
||||
$send_link = Payment::paymentStatusPaidAction($shopping_order, false);
|
||||
$data = [
|
||||
'mode' => $payt->transmitted_data['mode'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue