Erweiterungen / Korrekturen Beraterbestellungen
This commit is contained in:
parent
ecc71c616f
commit
c4ed6b39db
36 changed files with 1104 additions and 617 deletions
|
|
@ -153,6 +153,9 @@ class CustomerController extends Controller
|
|||
->addColumn('id', function (ShoppingUser $ShoppingUser) {
|
||||
return '<a href="' . route('admin_customer_detail', [$ShoppingUser->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="far fa-edit"></span></a>';
|
||||
})
|
||||
->addColumn('billing_email', function (ShoppingUser $ShoppingUser) {
|
||||
return $ShoppingUser->faker_mail ? "-" : $ShoppingUser->billing_email;
|
||||
})
|
||||
->addColumn('billing_salutation', function (ShoppingUser $ShoppingUser) {
|
||||
return HTMLHelper::getSalutationLang($ShoppingUser->billing_salutation);
|
||||
})
|
||||
|
|
@ -183,9 +186,15 @@ class CustomerController extends Controller
|
|||
->addColumn('subscribed', function (ShoppingUser $ShoppingUser) {
|
||||
return get_active_badge($ShoppingUser->subscribed);
|
||||
})
|
||||
->filterColumn('billing_email', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('billing_email', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('billing_country_id', 'billing_country_id $1')
|
||||
->orderColumn('billing_salutation', 'billing_salutation $1')
|
||||
->orderColumn('billing_email', 'billing_email $1')
|
||||
->orderColumn('created_at', 'created_at $1')
|
||||
->orderColumn('isMember', 'auth_user_id $1')
|
||||
->orderColumn('member_id', 'member_id $1')
|
||||
|
|
|
|||
|
|
@ -74,10 +74,10 @@ class SalesController extends Controller
|
|||
})
|
||||
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
|
||||
if($ShoppingOrder->shopping_user->is_for === 'me'){
|
||||
return '<span class="badge badge-pill badge-secondary">Berater</span>';
|
||||
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
|
||||
}
|
||||
if($ShoppingOrder->shopping_user->is_for === 'ot'){
|
||||
return '<span class="badge badge-pill badge-info">Kunde</span>';
|
||||
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
|
||||
}
|
||||
return '-';
|
||||
})
|
||||
|
|
@ -216,10 +216,10 @@ class SalesController extends Controller
|
|||
})
|
||||
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
|
||||
if($ShoppingOrder->shopping_user->is_for === 'me'){
|
||||
return '<span class="badge badge-pill badge-secondary">Berater</span>';
|
||||
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
|
||||
}
|
||||
if($ShoppingOrder->shopping_user->is_for === 'ot'){
|
||||
return '<span class="badge badge-pill badge-info">Kunde</span>';
|
||||
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
|
||||
}
|
||||
return '-';
|
||||
})
|
||||
|
|
|
|||
|
|
@ -140,6 +140,9 @@ class ShippingController extends Controller
|
|||
public function deleteCountry($id)
|
||||
{
|
||||
$model = ShippingCountry::findOrFail($id);
|
||||
if($model->shopping_orders->count()){
|
||||
abort(403, 'Einträge vorhanden');
|
||||
}
|
||||
$shipping = $model->shipping;
|
||||
$model->delete();
|
||||
\Session()->flash('alert-success', "Preis gelöscht");
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ class CustomerController extends Controller
|
|||
{
|
||||
$user = User::find(\Auth::user()->id);
|
||||
|
||||
$query = ShoppingUser::select(['id', 'billing_company', 'billing_salutation', 'billing_firstname', 'billing_lastname', 'billing_email', 'billing_zipcode', 'billing_city', 'billing_country_id', 'orders', 'subscribed', 'created_at', 'number', 'mode', 'is_like', 'wp_order_number'])
|
||||
$query = ShoppingUser::select(['id', 'billing_company', 'billing_salutation', 'billing_firstname', 'billing_lastname', 'billing_email', 'faker_mail', 'billing_zipcode', 'billing_city', 'billing_country_id', 'orders', 'subscribed', 'created_at', 'number', 'mode', 'is_like', 'wp_order_number'])
|
||||
->where('shopping_users.member_id', '=', $user->id);
|
||||
//->groupBy('shopping_users.number');
|
||||
|
||||
|
|
@ -224,6 +224,9 @@ class CustomerController extends Controller
|
|||
->addColumn('send_to', function (ShoppingUser $ShoppingUser) {
|
||||
return $ShoppingUser->is_like ? '<span class="badge badge-pill badge-warning"><i class="fa fa-clock"></i> in Prüfung</span>' : '<a href="' . route('user_order_my_delivery', ['ot', $ShoppingUser->id]) . '" class="btn btn-sm btn-secondary"><span class="fa fa-shopping-cart"></span> wählen</a>';
|
||||
})
|
||||
->addColumn('billing_email', function (ShoppingUser $ShoppingUser) {
|
||||
return $ShoppingUser->faker_mail ? "-" : $ShoppingUser->billing_email;
|
||||
})
|
||||
->addColumn('id', function (ShoppingUser $ShoppingUser) {
|
||||
return '<a href="' . route('user_customer_detail', [$ShoppingUser->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
|
||||
})
|
||||
|
|
@ -248,8 +251,14 @@ class CustomerController extends Controller
|
|||
->addColumn('extras', function (ShoppingUser $ShoppingUser) {
|
||||
return $ShoppingUser->wp_order_number.($ShoppingUser->mode==='dev' ? ' <span class="badge badge-warning">dev</span>' : '');
|
||||
})
|
||||
->filterColumn('billing_email', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('billing_email', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->orderColumn('send_to', 'id $1')
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('billing_email', 'billing_email $1')
|
||||
->orderColumn('billing_country_id', 'billing_country_id $1')
|
||||
->orderColumn('billing_salutation', 'billing_salutation $1')
|
||||
->orderColumn('first_created_at', 'created_at $1')
|
||||
|
|
|
|||
|
|
@ -77,17 +77,16 @@ class OrderController extends Controller
|
|||
})
|
||||
->addColumn('is_for', function (ShoppingOrder $ShoppingOrder) {
|
||||
if($ShoppingOrder->shopping_user->is_for === 'me'){
|
||||
return '<span class="badge badge-pill badge-secondary">Berater</span>';
|
||||
return '<span class="badge badge-pill badge-secondary">Beraterbestellung</span>';
|
||||
}
|
||||
if($ShoppingOrder->shopping_user->is_for === 'ot'){
|
||||
return '<span class="badge badge-pill badge-info">Kunde</span>';
|
||||
return '<span class="badge badge-pill badge-info">Kundenbestellung</span>';
|
||||
}
|
||||
return '-';
|
||||
})
|
||||
->addColumn('reference', function (ShoppingOrder $ShoppingOrder) {
|
||||
return $ShoppingOrder->getLastShoppingPayment('reference');
|
||||
})
|
||||
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('txaction', 'txaction $1')
|
||||
->orderColumn('shipped', 'shipped $1')
|
||||
|
|
@ -148,11 +147,6 @@ class OrderController extends Controller
|
|||
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($shipping_country_id, $for);
|
||||
|
||||
$comp_products = null;
|
||||
if($for === 'me'){
|
||||
$comp_products = Product::whereActive(true)->where('show_at', '=', 1)->where('shipping_addon', true)->orderBy('pos', 'DESC')->get();
|
||||
|
||||
}
|
||||
$data = [
|
||||
'shopping_user' => $shopping_user,
|
||||
'user' => $user,
|
||||
|
|
@ -160,7 +154,7 @@ class OrderController extends Controller
|
|||
'isView' => 'customer',
|
||||
'for' => $for,
|
||||
'delivery_id' => $delivery_id,
|
||||
'comp_products' => $comp_products,
|
||||
'comp_products' => $this->getCompProducts($for),
|
||||
];
|
||||
return view('user.order.list', $data);
|
||||
}
|
||||
|
|
@ -179,10 +173,27 @@ class OrderController extends Controller
|
|||
'shipping_state' => 'required',
|
||||
);
|
||||
$validator = Validator::make(Request::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
|
||||
if(Yard::instance('shopping')->getNumComp() > 0){
|
||||
if(!isset($data['switchers-comp-product'])){
|
||||
$validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus'));
|
||||
}else{
|
||||
if(!is_array($data['switchers-comp-product'])){
|
||||
$validator->errors()->add('switchers-comp-product', __('Bitte wähle ein Kompensationsprodukt aus'));
|
||||
}else{
|
||||
if(count($data['switchers-comp-product']) !== Yard::instance('shopping')->getNumComp()){
|
||||
$validator->errors()->add('switchers-comp-product', __('Bitte wähle :count Kompensationsprodukte aus', ['count'=>Yard::instance('shopping')->getNumComp()]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($validator->errors()->count()) {
|
||||
return back()->withErrors($validator)->withInput(Request::all());
|
||||
}
|
||||
}
|
||||
do {
|
||||
$identifier = Util::getToken();
|
||||
} while( ShoppingInstance::where('identifier', $identifier)->count() );
|
||||
|
|
@ -267,6 +278,26 @@ class OrderController extends Controller
|
|||
//->orderBy('id', 'DESC');
|
||||
|
||||
return \DataTables::eloquent($query)
|
||||
|
||||
->addColumn('product', function (Product $product) {
|
||||
|
||||
$cartItem = Yard::instance('shopping')->getCartItemByProduct($product->id);
|
||||
$qty = isset($cartItem->qty) ? $cartItem->qty : 0;
|
||||
$rowId = isset($cartItem->rowId) ? $cartItem->rowId : '';
|
||||
return '<strong>'.$product->name.'</strong><br><div class="no-line-break input-group-min-w">
|
||||
<div class="input-group d-inline-flex w-auto">
|
||||
<span class="input-group-prepend">
|
||||
<button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-product-basket" data-row-id="'.$rowId.'" data-product-id="'.$product->id.'">-</button>
|
||||
</span>
|
||||
<input type="text" class="form-control text-center input-extra table-input-event-onchange" name="product_qty_'.$product->id.'" data-row-id="'.$rowId.'" data-product-id="'.$product->id.'" value="'.$qty.'">
|
||||
<span class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary icon-btn md-btn-extra add-product-basket" data-row-id="'.$rowId.'" data-product-id="'.$product->id.'">+</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>';
|
||||
})
|
||||
/*
|
||||
|
||||
->addColumn('add_card', function (Product $product) {
|
||||
return '<button type="button" class="btn btn-sm btn-md-extra btn-secondary add-product-basket" data-product-id="'.$product->id.'">
|
||||
<strong>€ '.$product->getFormattedPriceWith().'</strong> +<span class="ion ion-md-cart"></span>
|
||||
|
|
@ -288,7 +319,7 @@ class OrderController extends Controller
|
|||
</div>
|
||||
</div>';
|
||||
|
||||
})
|
||||
})*/
|
||||
->addColumn('picture', function (Product $product) {
|
||||
if(count($product->images)){
|
||||
return '<img class="img-fluid img-extra" alt="" src="'.route('product_image', [$product->images->first()->slug]).'">';
|
||||
|
|
@ -309,16 +340,22 @@ class OrderController extends Controller
|
|||
data-toggle="modal" data-target="#modals-load-content" data-id="'.$product->id.'" data-route="'.route('modal_load').'"
|
||||
data-action="user-order-show-product" data-view="customer"><i class="ion ion-md-eye"></i></button>';
|
||||
})
|
||||
|
||||
->filterColumn('product', function($query, $keyword) {
|
||||
if($keyword != ""){
|
||||
$query->where('name', 'LIKE', '%'.$keyword.'%');
|
||||
}
|
||||
})
|
||||
->orderColumn('name', 'name $1')
|
||||
->orderColumn('product', 'name $1')
|
||||
->orderColumn('number', 'number $1')
|
||||
->orderColumn('points', 'points $1')
|
||||
->orderColumn('price_net', 'price_net $1')
|
||||
->orderColumn('price_gross', 'price_gross $1')
|
||||
->orderColumn('price_vk_gross', 'price_vk_gross $1')
|
||||
->orderColumn('price_vk_gross', 'price $1')
|
||||
->orderColumn('contents_total', 'contents_total $1')
|
||||
->orderColumn('weight', 'weight $1')
|
||||
->rawColumns(['add_card', 'quantity', 'picture', 'action'])
|
||||
|
||||
->rawColumns(['add_card', 'product', 'quantity', 'picture', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
|
|
@ -327,6 +364,10 @@ class OrderController extends Controller
|
|||
|
||||
if(Request::ajax()) {
|
||||
$data = Request::all();
|
||||
|
||||
$is_for = isset($data['shipping_is_for']) ? $data['shipping_is_for'] : 'ot';
|
||||
$data['comp_products'] = $this->getCompProducts($is_for);
|
||||
|
||||
if($data['action'] === 'updateCart' && isset($data['product_id'])){
|
||||
if($product = Product::find($data['product_id'])){
|
||||
$image = "";
|
||||
|
|
@ -344,61 +385,86 @@ class OrderController extends Controller
|
|||
//if 0 get the item by qty:1 and remove it
|
||||
Yard::instance('shopping')->remove($cartItem->rowId);
|
||||
}
|
||||
$this->updateCompProduct($data);
|
||||
//
|
||||
|
||||
Yard::instance('shopping')->reCalculateShippingPrice();
|
||||
$html = view("user.order.yard_view_form", $data)->render();
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]);
|
||||
$this->checkCompProduct(Yard::instance('shopping')->getNumComp());
|
||||
$html_card = view("user.order.yard_view_form", $data)->render();
|
||||
$html_comp = view("user.order.comp_product", $data)->render();
|
||||
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
|
||||
}
|
||||
}
|
||||
if($data['action'] === 'clearCart') {
|
||||
Yard::instance('shopping')->destroy();
|
||||
return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html'=>'']);
|
||||
return response()->json(['response' => true, 'data'=>Yard::instance('shopping')->count(), 'html_card'=>'', 'html_comp'=>'']);
|
||||
|
||||
}
|
||||
|
||||
if($data['action'] === 'updateShippingCountry') {
|
||||
if(isset($data['shipping_country_id'])){
|
||||
$is_for = isset($data['shipping_is_for']) ? $data['shipping_is_for'] : 'ot';
|
||||
if($shipping_country = ShippingCountry::find($data['shipping_country_id'])){
|
||||
Yard::instance('shopping')->setShippingCountryWithPrice($shipping_country->id, $is_for);
|
||||
$this->updateCompProduct($data);
|
||||
$this->checkCompProduct(Yard::instance('shopping')->getNumComp());
|
||||
}
|
||||
}
|
||||
$html = view("user.order.yard_view_form", $data)->render();
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]);
|
||||
$html_card = view("user.order.yard_view_form", $data)->render();
|
||||
$html_comp = view("user.order.comp_product", $data)->render();
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
|
||||
|
||||
}
|
||||
if($data['action'] === 'updateCompProduct'){
|
||||
// $data['comp_product_id']
|
||||
// $data['comp_num']
|
||||
//count_comp_products
|
||||
$this->updateCompProduct($data);
|
||||
Yard::instance('shopping')->reCalculateShippingPrice();
|
||||
$html = view("user.order.yard_view_form", $data)->render();
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html'=>$html]);
|
||||
$html_card = view("user.order.yard_view_form", $data)->render();
|
||||
$html_comp = view("user.order.comp_product", $data)->render();
|
||||
|
||||
return response()->json(['response' => true, 'data'=>$data, 'html_card'=>$html_card, 'html_comp'=>$html_comp]);
|
||||
|
||||
}
|
||||
return response()->json(['response' => false, 'data'=>$data]);
|
||||
}
|
||||
}
|
||||
|
||||
private function checkCompProduct($count_comp_products){
|
||||
foreach (Yard::instance('shopping')->content() as $row) {
|
||||
//wenn gleich löschen, da neue Versandkosten
|
||||
if($row->options->comp > $count_comp_products) {
|
||||
Yard::instance('shopping')->remove($row->rowId);
|
||||
}
|
||||
}
|
||||
}
|
||||
private function updateCompProduct($data){
|
||||
//clear old
|
||||
foreach (Yard::instance('shopping')->content() as $row) {
|
||||
if($row->options->comp) {
|
||||
//wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl
|
||||
//wenn gleich löschen, da neue Versandkosten
|
||||
if($row->options->comp === $data['comp_num'] || $row->options->comp > $data['count_comp_products']) {
|
||||
Yard::instance('shopping')->remove($row->rowId);
|
||||
}
|
||||
}
|
||||
if(isset($data['comp_product_id'])) {
|
||||
if ($product = Product::find($data['comp_product_id'])) {
|
||||
|
||||
if(isset($data['comp_product_id'])) {
|
||||
if ($product = Product::find($data['comp_product_id'])) {
|
||||
$image = "";
|
||||
if ($product->images->count()) {
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, ['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0, 'comp' => $product->id]);
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0,
|
||||
['image' => $image, 'slug' => $product->slug, 'weight' => 0, 'points' => 0,
|
||||
'comp' => $data['comp_num'], 'product_id' => $product->id]);
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function getCompProducts($for){
|
||||
if($for === 'me'){
|
||||
return Product::whereActive(true)->where('show_at', '=', 1)->where('shipping_addon', true)->orderBy('pos', 'DESC')->get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -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