@@ -62,7 +62,7 @@ |
||
| 62 | 62 | 'paymentMethodsList' => $paymentMethodsList)); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - return view('frontend.checkout.login')->with(array( 'sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList)); |
|
| 65 | + return view('frontend.checkout.login')->with(array( 'sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList)); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $user = auth('web')->user(); |
@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $paymentMethodsList = Cart::getConditionsByType('sending_method')->first()->getAttributes()['data']['related_payment_methods_list']; |
| 28 | 28 | |
| 29 | - if(!Cart::getConditionsByType('sending_method')->count()) { |
|
| 29 | + if (!Cart::getConditionsByType('sending_method')->count()) { |
|
| 30 | 30 | Notification::error('Selecteer een verzendwijze'); |
| 31 | 31 | return redirect()->to('cart'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if(!Cart::getConditionsByType('payment_method')->count()) { |
|
| 34 | + if (!Cart::getConditionsByType('payment_method')->count()) { |
|
| 35 | 35 | Notification::error('Selecteer een betaalwijze'); |
| 36 | 36 | return redirect()->to('cart'); |
| 37 | 37 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'paymentMethodsList' => $paymentMethodsList)); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return view('frontend.checkout.login')->with(array( 'sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList)); |
|
| 53 | + return view('frontend.checkout.login')->with(array('sendingMethodsList' => $sendingMethodsList, 'paymentMethodsList' => $paymentMethodsList)); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $user = auth('web')->user(); |
@@ -108,13 +108,13 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | $validateRegister = ClientService::validateRegister($request->all(), $noAccount); |
| 110 | 110 | |
| 111 | - if($validateRegister->fails()) { |
|
| 111 | + if ($validateRegister->fails()) { |
|
| 112 | 112 | foreach ($validator->errors()->all() as $error) { |
| 113 | 113 | Notification::error($error); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return redirect()->to('cart/checkout') |
| 117 | - ->withErrors(true, 'register')->withInput();; |
|
| 117 | + ->withErrors(true, 'register')->withInput(); ; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | if ($request->get('password')) { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $data = $register; |
| 138 | 138 | $data['shop'] = app('shop'); |
| 139 | 139 | |
| 140 | - Mail::send('frontend.email.register-mail', array('password' => $request->get('password'), 'user' => $data->toArray(), 'billAddress' => $data->clientBillAddress->toArray()), function ($message) use ($data) { |
|
| 140 | + Mail::send('frontend.email.register-mail', array('password' => $request->get('password'), 'user' => $data->toArray(), 'billAddress' => $data->clientBillAddress->toArray()), function($message) use ($data) { |
|
| 141 | 141 | |
| 142 | 142 | $message->to($data['email'])->from($data['shop']->email, $data['shop']->title)->subject('Je bent geregistreerd.'); |
| 143 | 143 | }); |
@@ -199,19 +199,19 @@ discard block |
||
| 199 | 199 | $data['user_id'] = auth('web')->user()->id; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if ($noAccountUser){ |
|
| 202 | + if ($noAccountUser) { |
|
| 203 | 203 | $data['user_id'] = $noAccountUser['client_id']; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - if(Cart::getConditionsByType('sending_method')->count()) { |
|
| 206 | + if (Cart::getConditionsByType('sending_method')->count()) { |
|
| 207 | 207 | $data['sending_method'] = Cart::getConditionsByType('sending_method'); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if(Cart::getConditionsByType('sending_method_country_price')->count()) { |
|
| 210 | + if (Cart::getConditionsByType('sending_method_country_price')->count()) { |
|
| 211 | 211 | $data['sending_method_country_price'] = Cart::getConditionsByType('sending_method_country_price'); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if(Cart::getConditionsByType('payment_method')->count()) { |
|
| 214 | + if (Cart::getConditionsByType('payment_method')->count()) { |
|
| 215 | 215 | $data['payment_method'] = Cart::getConditionsByType('payment_method'); |
| 216 | 216 | } |
| 217 | 217 | |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $template = 'frontend.product.combinations'; |
| 44 | 44 | |
| 45 | 45 | $leadingAttributeId = key(reset($newPullDowns)); |
| 46 | - if($productAttributeId) { |
|
| 46 | + if ($productAttributeId) { |
|
| 47 | 47 | $leadingAttributeId = $productAttributeId; |
| 48 | 48 | } else { |
| 49 | 49 | $productAttributeId = $pullDowns['productAttribute']->first()->id; |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | ->addColumn('status', function ($order) { |
| 48 | 48 | if ($order->orderStatus) { |
| 49 | - return $order->orderStatus->title; |
|
| 49 | + return $order->orderStatus->title; |
|
| 50 | 50 | } |
| 51 | 51 | }) |
| 52 | 52 | |
@@ -44,16 +44,16 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $datatables = DataTables::of($order) |
| 46 | 46 | |
| 47 | - ->addColumn('status', function ($order) { |
|
| 47 | + ->addColumn('status', function($order) { |
|
| 48 | 48 | if ($order->orderStatus) { |
| 49 | 49 | return $order->orderStatus->title; |
| 50 | 50 | } |
| 51 | 51 | }) |
| 52 | 52 | |
| 53 | - ->addColumn('created_at', function ($order) { |
|
| 53 | + ->addColumn('created_at', function($order) { |
|
| 54 | 54 | return date('d F H:i', strtotime($order->created_at)); |
| 55 | 55 | }) |
| 56 | - ->addColumn('status', function ($order) { |
|
| 56 | + ->addColumn('status', function($order) { |
|
| 57 | 57 | if ($order->orderStatus) { |
| 58 | 58 | if ($order->orderStatus->color) { |
| 59 | 59 | return '<a href="/admin/order/'.$order->id.'" style="text-decoration:none;"><span style="background-color:'.$order->orderStatus->color.'; padding: 10px; line-height:30px; text-align:center; color:white;">'.$order->orderStatus->title.'</span></a>'; |
@@ -61,33 +61,33 @@ discard block |
||
| 61 | 61 | return $order->orderStatus->title; |
| 62 | 62 | } |
| 63 | 63 | }) |
| 64 | - ->addColumn('client', function ($order) { |
|
| 64 | + ->addColumn('client', function($order) { |
|
| 65 | 65 | if ($order->client) { |
| 66 | 66 | if ($order->orderBillAddress) { |
| 67 | 67 | return $order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname; |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | }) |
| 71 | - ->addColumn('products', function ($order) { |
|
| 71 | + ->addColumn('products', function($order) { |
|
| 72 | 72 | if ($order->products) { |
| 73 | 73 | return $order->products->count(); |
| 74 | 74 | } |
| 75 | 75 | }) |
| 76 | - ->addColumn('price_with_tax', function ($order) { |
|
| 76 | + ->addColumn('price_with_tax', function($order) { |
|
| 77 | 77 | $money = '€ '.$order->getPriceWithTaxNumberFormat(); |
| 78 | 78 | return $money; |
| 79 | 79 | }) |
| 80 | - ->addColumn('paymentMethod', function ($order) { |
|
| 80 | + ->addColumn('paymentMethod', function($order) { |
|
| 81 | 81 | if ($order->orderPaymentMethod) { |
| 82 | 82 | return $order->orderPaymentMethod->title; |
| 83 | 83 | } |
| 84 | 84 | }) |
| 85 | - ->addColumn('sendingMethod', function ($order) { |
|
| 85 | + ->addColumn('sendingMethod', function($order) { |
|
| 86 | 86 | if ($order->orderSendingMethod) { |
| 87 | 87 | return $order->orderSendingMethod->title; |
| 88 | 88 | } |
| 89 | 89 | }) |
| 90 | - ->addColumn('action', function ($order) { |
|
| 90 | + ->addColumn('action', function($order) { |
|
| 91 | 91 | $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 92 | 92 | $links = '<a href="/admin/order/'.$order->id.'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a> '.$download; |
| 93 | 93 | |
@@ -47,6 +47,6 @@ |
||
| 47 | 47 | public function store($productId, Request $request) |
| 48 | 48 | { |
| 49 | 49 | $result = ProductExtraFieldValueService::create($request->all(), $productId); |
| 50 | - return ProductExtraFieldValueService::notificationRedirect(array('product.product-extra-field-value.index', $productId), $result, 'The product extra fields are updated.'); |
|
| 50 | + return ProductExtraFieldValueService::notificationRedirect(array('product.product-extra-field-value.index', $productId), $result, 'The product extra fields are updated.'); |
|
| 51 | 51 | } |
| 52 | 52 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | |
| 47 | 47 | public function store($productId, Request $request) |
| 48 | 48 | { |
| 49 | - $result = ProductExtraFieldValueService::create($request->all(), $productId); |
|
| 49 | + $result = ProductExtraFieldValueService::create($request->all(), $productId); |
|
| 50 | 50 | return ProductExtraFieldValueService::notificationRedirect(array('product.product-extra-field-value.index', $productId), $result, 'The product extra fields are updated.'); |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -259,9 +259,9 @@ |
||
| 259 | 259 | { |
| 260 | 260 | $order = OrderService::find($orderId); |
| 261 | 261 | if($order->orderLabel()->count()) { |
| 262 | - header("Content-type: application/octet-stream"); |
|
| 263 | - header("Content-disposition: attachment;filename=label.pdf"); |
|
| 264 | - echo $order->orderLabel->data; |
|
| 262 | + header("Content-type: application/octet-stream"); |
|
| 263 | + header("Content-disposition: attachment;filename=label.pdf"); |
|
| 264 | + echo $order->orderLabel->data; |
|
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | use Hideyo\Ecommerce\Framework\Services\Order\OrderFacade as OrderService; |
| 15 | 15 | use Hideyo\Ecommerce\Framework\Services\Order\OrderStatusFacade as OrderStatusService; |
| 16 | 16 | use Hideyo\Ecommerce\Framework\Services\PaymentMethod\PaymentMethodFacade as PaymentMethodService; |
| 17 | -use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService;use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
|
| 17 | +use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService; use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
|
| 18 | 18 | use Illuminate\Http\Request; |
| 19 | 19 | use Carbon\Carbon; |
| 20 | 20 | use Hideyo\Ecommerce\Framework\Services\Order\Events\OrderChangeStatus; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | public function index(Request $request) |
| 28 | 28 | { |
| 29 | - $shop = auth('hideyobackend')->user()->shop; |
|
| 29 | + $shop = auth('hideyobackend')->user()->shop; |
|
| 30 | 30 | $now = Carbon::now(); |
| 31 | 31 | |
| 32 | 32 | $revenueThisMonth = null; |
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $datatables = \DataTables::of($order) |
| 56 | 56 | |
| 57 | - ->addColumn('generated_custom_order_id', function ($order) { |
|
| 57 | + ->addColumn('generated_custom_order_id', function($order) { |
|
| 58 | 58 | return $order->generated_custom_order_id; |
| 59 | 59 | }) |
| 60 | 60 | |
| 61 | - ->addColumn('created_at', function ($order) { |
|
| 61 | + ->addColumn('created_at', function($order) { |
|
| 62 | 62 | return date('d F H:i', strtotime($order->created_at)); |
| 63 | 63 | }) |
| 64 | 64 | |
| 65 | - ->addColumn('status', function ($order) { |
|
| 65 | + ->addColumn('status', function($order) { |
|
| 66 | 66 | if ($order->orderStatus) { |
| 67 | 67 | if ($order->orderStatus->color) { |
| 68 | 68 | return '<a href="/admin/order/'.$order->id.'" style="text-decoration:none;"><span style="background-color:'.$order->orderStatus->color.'; padding: 10px; line-height:30px; text-align:center; color:white;">'.$order->orderStatus->title.'</span></a>'; |
@@ -71,46 +71,46 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | }) |
| 73 | 73 | |
| 74 | - ->filterColumn('client', function ($query, $keyword) { |
|
| 74 | + ->filterColumn('client', function($query, $keyword) { |
|
| 75 | 75 | |
| 76 | 76 | $query->where( |
| 77 | - function ($query) use ($keyword) { |
|
| 77 | + function($query) use ($keyword) { |
|
| 78 | 78 | $query->whereRaw("order_address.firstname like ?", ["%{$keyword}%"]); |
| 79 | 79 | $query->orWhereRaw("order_address.lastname like ?", ["%{$keyword}%"]); |
| 80 | 80 | ; |
| 81 | 81 | } |
| 82 | 82 | ); |
| 83 | 83 | }) |
| 84 | - ->addColumn('client', function ($order) { |
|
| 84 | + ->addColumn('client', function($order) { |
|
| 85 | 85 | if ($order->client) { |
| 86 | 86 | if ($order->orderBillAddress) { |
| 87 | - return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count() .')</a>'; |
|
| 87 | + return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count().')</a>'; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | }) |
| 91 | - ->addColumn('products', function ($order) { |
|
| 91 | + ->addColumn('products', function($order) { |
|
| 92 | 92 | if ($order->products) { |
| 93 | 93 | return $order->products->count(); |
| 94 | 94 | } |
| 95 | 95 | }) |
| 96 | - ->addColumn('price_with_tax', function ($order) { |
|
| 96 | + ->addColumn('price_with_tax', function($order) { |
|
| 97 | 97 | $money = '€ '.$order->getPriceWithTaxNumberFormat(); |
| 98 | 98 | return $money; |
| 99 | 99 | }) |
| 100 | 100 | |
| 101 | 101 | |
| 102 | - ->addColumn('paymentMethod', function ($order) { |
|
| 102 | + ->addColumn('paymentMethod', function($order) { |
|
| 103 | 103 | if ($order->orderPaymentMethod) { |
| 104 | 104 | return $order->orderPaymentMethod->title; |
| 105 | 105 | } |
| 106 | 106 | }) |
| 107 | - ->addColumn('sendingMethod', function ($order) { |
|
| 107 | + ->addColumn('sendingMethod', function($order) { |
|
| 108 | 108 | if ($order->orderSendingMethod) { |
| 109 | 109 | return $order->orderSendingMethod->title; |
| 110 | 110 | } |
| 111 | 111 | }) |
| 112 | - ->addColumn('action', function ($order) { |
|
| 113 | - $deleteLink = \Form::deleteajax('/admin/order/'. $order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 112 | + ->addColumn('action', function($order) { |
|
| 113 | + $deleteLink = \Form::deleteajax('/admin/order/'.$order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 114 | 114 | $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 115 | 115 | |
| 116 | 116 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | if ($data and $data['order']) { |
| 145 | 145 | |
| 146 | - if($data['type'] == 'one-pdf') { |
|
| 146 | + if ($data['type'] == 'one-pdf') { |
|
| 147 | 147 | $pdfHtml = ""; |
| 148 | 148 | $countOrders = count($data['order']); |
| 149 | 149 | $i = 0; |
@@ -169,15 +169,15 @@ discard block |
||
| 169 | 169 | $pdf = PDF::loadHTML($pdfHtmlBody); |
| 170 | 170 | |
| 171 | 171 | return $pdf->download('order-'.$order->generated_custom_order_id.'.pdf'); |
| 172 | - } elseif($data['type'] == 'product-list') { |
|
| 172 | + } elseif ($data['type'] == 'product-list') { |
|
| 173 | 173 | $products = OrderService::productsByOrderIds($data['order']); |
| 174 | 174 | |
| 175 | - if($products) { |
|
| 175 | + if ($products) { |
|
| 176 | 176 | |
| 177 | 177 | |
| 178 | - Excel::create('products', function ($excel) use ($products) { |
|
| 178 | + Excel::create('products', function($excel) use ($products) { |
|
| 179 | 179 | |
| 180 | - $excel->sheet('Products', function ($sheet) use ($products) { |
|
| 180 | + $excel->sheet('Products', function($sheet) use ($products) { |
|
| 181 | 181 | $newArray = array(); |
| 182 | 182 | foreach ($products as $key => $row) { |
| 183 | 183 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | if ($orders) { |
| 210 | 210 | $request->session()->put('print_orders', $orders->toArray()); |
| 211 | - return response()->json(array('orders' => $orders->toArray() )); |
|
| 211 | + return response()->json(array('orders' => $orders->toArray())); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | $request->session()->destroy('print_orders'); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | public function downloadLabel($orderId) |
| 252 | 252 | { |
| 253 | 253 | $order = OrderService::find($orderId); |
| 254 | - if($order->orderLabel()->count()) { |
|
| 254 | + if ($order->orderLabel()->count()) { |
|
| 255 | 255 | header("Content-type: application/octet-stream"); |
| 256 | 256 | header("Content-disposition: attachment;filename=label.pdf"); |
| 257 | 257 | echo $order->orderLabel->data; |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | 'clientDeliveryCompany' => $order->orderDeliveryAddress->company |
| 282 | 282 | ); |
| 283 | 283 | foreach ($replace as $key => $val) { |
| 284 | - $content = str_replace("[" . $key . "]", $val, $content); |
|
| 284 | + $content = str_replace("[".$key."]", $val, $content); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | return $content; |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | |
| 295 | 295 | public function update(Request $request, $orderId) |
| 296 | 296 | { |
| 297 | - $result = OrderService::updateById($request->all(), $orderId); |
|
| 297 | + $result = OrderService::updateById($request->all(), $orderId); |
|
| 298 | 298 | |
| 299 | 299 | if ($result->errors()->all()) { |
| 300 | 300 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | function ($query) use ($keyword) { |
| 69 | 69 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 70 | 70 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 71 | - $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
|
| 71 | + $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
|
| 72 | 72 | ; |
| 73 | 73 | } |
| 74 | 74 | ); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ['product.*', |
| 28 | 28 | 'brand.title as brandtitle', |
| 29 | 29 | 'product_category.title as categorytitle'] |
| 30 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 30 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 31 | 31 | |
| 32 | 32 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 33 | 33 | |
@@ -36,23 +36,23 @@ discard block |
||
| 36 | 36 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 37 | 37 | |
| 38 | 38 | $datatables = \DataTables::of($product) |
| 39 | - ->filterColumn('reference_code', function ($query, $keyword) { |
|
| 39 | + ->filterColumn('reference_code', function($query, $keyword) { |
|
| 40 | 40 | $query->whereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 41 | 41 | }) |
| 42 | - ->filterColumn('active', function ($query, $keyword) { |
|
| 42 | + ->filterColumn('active', function($query, $keyword) { |
|
| 43 | 43 | $query->whereRaw("product.active like ?", ["%{$keyword}%"]); |
| 44 | 44 | ; |
| 45 | 45 | }) |
| 46 | 46 | |
| 47 | - ->addColumn('rank', function ($product) { |
|
| 47 | + ->addColumn('rank', function($product) { |
|
| 48 | 48 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="/admin/product/change-rank/'.$product->id.'">'; |
| 49 | 49 | |
| 50 | 50 | }) |
| 51 | 51 | |
| 52 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 52 | + ->filterColumn('title', function($query, $keyword) { |
|
| 53 | 53 | |
| 54 | 54 | $query->where( |
| 55 | - function ($query) use ($keyword) { |
|
| 55 | + function($query) use ($keyword) { |
|
| 56 | 56 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 57 | 57 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 58 | 58 | $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | ); |
| 62 | 62 | }) |
| 63 | 63 | |
| 64 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 64 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 65 | 65 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 66 | 66 | }) |
| 67 | 67 | |
| 68 | - ->addColumn('active', function ($product) { |
|
| 68 | + ->addColumn('active', function($product) { |
|
| 69 | 69 | if ($product->active) { |
| 70 | 70 | return '<a href="#" class="change-active" data-url="'.url()->route('product.change-active', array('productId' => $product->id)).'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 71 | 71 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | return '<a href="#" class="change-active" data-url="'.url()->route('product.change-active', array('productId' => $product->id)).'"><span class="glyphicon glyphicon-remove icon-red"></span></a>'; |
| 74 | 74 | }) |
| 75 | 75 | |
| 76 | - ->addColumn('title', function ($product) { |
|
| 76 | + ->addColumn('title', function($product) { |
|
| 77 | 77 | if ($product->brand) { |
| 78 | 78 | return $product->brand->title.' | '.$product->title; |
| 79 | 79 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | }) |
| 83 | 83 | |
| 84 | 84 | |
| 85 | - ->addColumn('amount', function ($product) { |
|
| 85 | + ->addColumn('amount', function($product) { |
|
| 86 | 86 | if ($product->attributes->count()) { |
| 87 | 87 | return '<a href="/admin/product/'.$product->id.'/product-combination">combinations</a>'; |
| 88 | 88 | } |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | return '<input type="text" class="change-amount" value="'.$product->amount.'" style="width:50px;" data-url="'.url()->route('product.change-amount', array('productId' => $product->id)).'">'; |
| 91 | 91 | }) |
| 92 | 92 | |
| 93 | - ->addColumn('image', function ($product) { |
|
| 93 | + ->addColumn('image', function($product) { |
|
| 94 | 94 | if ($product->productImages->count()) { |
| 95 | 95 | return '<img src="/files/product/100x100/'.$product->id.'/'.$product->productImages->first()->file.'" />'; |
| 96 | 96 | } |
| 97 | 97 | }) |
| 98 | - ->addColumn('price', function ($product) { |
|
| 98 | + ->addColumn('price', function($product) { |
|
| 99 | 99 | |
| 100 | 100 | $result = ""; |
| 101 | 101 | if ($product->price) { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | 'amount' => $product->amount |
| 146 | 146 | ); |
| 147 | 147 | |
| 148 | - $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 148 | + $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | if ($product->discount_value) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | }) |
| 158 | 158 | |
| 159 | 159 | |
| 160 | - ->addColumn('categorytitle', function ($product) { |
|
| 160 | + ->addColumn('categorytitle', function($product) { |
|
| 161 | 161 | if ($product->subcategories()->count()) { |
| 162 | 162 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 163 | 163 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | return $product->categorytitle; |
| 167 | 167 | }) |
| 168 | 168 | |
| 169 | - ->addColumn('action', function ($product) { |
|
| 169 | + ->addColumn('action', function($product) { |
|
| 170 | 170 | $deleteLink = \Form::deleteajax(url()->route('product.destroy', $product->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $product->title); |
| 171 | 171 | $copy = '<a href="'.url()->route('product.copy', $product->id).'" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>'; |
| 172 | 172 | |
@@ -189,26 +189,26 @@ discard block |
||
| 189 | 189 | ['product.*', |
| 190 | 190 | 'brand.title as brandtitle', |
| 191 | 191 | 'product_category.title as categorytitle'] |
| 192 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 192 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 193 | 193 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 194 | 194 | ->leftJoin('brand as brand', 'brand.id', '=', 'product.brand_id') |
| 195 | 195 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 196 | 196 | |
| 197 | 197 | $datatables = \DataTables::of($product) |
| 198 | - ->addColumn('rank', function ($product) { |
|
| 198 | + ->addColumn('rank', function($product) { |
|
| 199 | 199 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="'.url()->route('product.change-rank', array('productId' => $product->id)).'">'; |
| 200 | 200 | }) |
| 201 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 201 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 202 | 202 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 203 | 203 | }) |
| 204 | - ->addColumn('title', function ($product) { |
|
| 204 | + ->addColumn('title', function($product) { |
|
| 205 | 205 | if ($product->brand) { |
| 206 | 206 | return $product->brand->title.' | '.$product->title; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | return $product->title; |
| 210 | 210 | }) |
| 211 | - ->addColumn('categorytitle', function ($product) { |
|
| 211 | + ->addColumn('categorytitle', function($product) { |
|
| 212 | 212 | if ($product->subcategories()->count()) { |
| 213 | 213 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 214 | 214 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | public function store(Request $request) |
| 239 | 239 | { |
| 240 | - $result = ProductService::create($request->all()); |
|
| 240 | + $result = ProductService::create($request->all()); |
|
| 241 | 241 | return ProductService::notificationRedirect('product.index', $result, 'The product was inserted.'); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -282,10 +282,10 @@ discard block |
||
| 282 | 282 | public function postExport() |
| 283 | 283 | { |
| 284 | 284 | |
| 285 | - $result = ProductService::selectAllExport(); |
|
| 286 | - Excel::create('export', function ($excel) use ($result) { |
|
| 285 | + $result = ProductService::selectAllExport(); |
|
| 286 | + Excel::create('export', function($excel) use ($result) { |
|
| 287 | 287 | |
| 288 | - $excel->sheet('Products', function ($sheet) use ($result) { |
|
| 288 | + $excel->sheet('Products', function($sheet) use ($result) { |
|
| 289 | 289 | $newArray = array(); |
| 290 | 290 | foreach ($result as $row) { |
| 291 | 291 | $category = ""; |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $i = 0; |
| 315 | 315 | foreach ($row->productImages as $image) { |
| 316 | 316 | $i++; |
| 317 | - $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 317 | + $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | } |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | public function update(Request $request, $productId) |
| 385 | 385 | { |
| 386 | 386 | $input = $request->all(); |
| 387 | - $result = ProductService::updateById($input, $productId); |
|
| 387 | + $result = ProductService::updateById($input, $productId); |
|
| 388 | 388 | |
| 389 | 389 | $redirect = redirect()->route('product.index'); |
| 390 | 390 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | |
| 415 | 415 | public function destroy($id) |
| 416 | 416 | { |
| 417 | - $result = ProductService::destroy($id); |
|
| 417 | + $result = ProductService::destroy($id); |
|
| 418 | 418 | |
| 419 | 419 | if ($result) { |
| 420 | 420 | flash('The product was deleted.'); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | }) |
| 49 | 49 | ->addColumn('bill', function ($addresses) { |
| 50 | 50 | if ($addresses->clientBillAddress()->count()) { |
| 51 | - return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
|
| 51 | + return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
@@ -25,24 +25,24 @@ discard block |
||
| 25 | 25 | $addresses = ClientService::getAddressModel()->with(array('clientDeliveryAddress', 'clientBillAddress'))->where('client_id', '=', $clientId); |
| 26 | 26 | |
| 27 | 27 | $datatables = DataTables::of($addresses) |
| 28 | - ->addColumn('housenumber', function ($addresses) { |
|
| 28 | + ->addColumn('housenumber', function($addresses) { |
|
| 29 | 29 | return $addresses->housenumber.$addresses->housenumber_suffix; |
| 30 | 30 | }) |
| 31 | - ->addColumn('delivery', function ($addresses) { |
|
| 31 | + ->addColumn('delivery', function($addresses) { |
|
| 32 | 32 | if ($addresses->clientDeliveryAddress()->count()) { |
| 33 | 33 | return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
| 37 | 37 | }) |
| 38 | - ->addColumn('bill', function ($addresses) { |
|
| 38 | + ->addColumn('bill', function($addresses) { |
|
| 39 | 39 | if ($addresses->clientBillAddress()->count()) { |
| 40 | 40 | return '<span class="glyphicon glyphicon-ok icon-green"></span>'; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | return '<span class="glyphicon glyphicon-remove icon-red"></span>'; |
| 44 | 44 | }) |
| 45 | - ->addColumn('action', function ($addresses) use ($clientId) { |
|
| 45 | + ->addColumn('action', function($addresses) use ($clientId) { |
|
| 46 | 46 | $deleteLink = Form::deleteajax(url()->route('client.addresses.destroy', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 47 | 47 | $links = '<a href="'.url()->route('client.addresses.edit', array('clientId' => $clientId, 'clientAddressId' => $addresses->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 48 | 48 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function store(Request $request, $clientId) |
| 65 | 65 | { |
| 66 | - $result = ClientService::createAddress($request->all(), $clientId); |
|
| 66 | + $result = ClientService::createAddress($request->all(), $clientId); |
|
| 67 | 67 | return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is inserted.'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function update(Request $request, $clientId, $id) |
| 77 | 77 | { |
| 78 | - $result = ClientService::editAddress($clientId, $id, $request->all()); |
|
| 78 | + $result = ClientService::editAddress($clientId, $id, $request->all()); |
|
| 79 | 79 | return ClientService::notificationRedirect(array('client.addresses.index', $clientId), $result, 'The client adress is updated.'); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function destroy($clientId, $id) |
| 83 | 83 | { |
| 84 | - $result = ClientService::destroyAddress($id); |
|
| 84 | + $result = ClientService::destroyAddress($id); |
|
| 85 | 85 | |
| 86 | 86 | if ($result) { |
| 87 | 87 | flash('The client address is deleted.'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | if ($request->wantsJson()) { |
| 15 | 15 | $query = TaxRateService::getModel()->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 16 | - $datatables = DataTables::of($query)->addColumn('action', function ($query) { |
|
| 16 | + $datatables = DataTables::of($query)->addColumn('action', function($query) { |
|
| 17 | 17 | $deleteLink = Form::deleteajax(url()->route('tax-rate.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $query->title); |
| 18 | 18 | $links = '<a href="'.url()->route('tax-rate.edit', $query->id).'" class="btn btn-sm btn-success"><i class="fi-pencil"></i>Edit</a> '.$deleteLink; |
| 19 | 19 | return $links; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | Notification::error($validator->errors()->all()); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - Mail::send('frontend.email.contact', ['data' => $input], function ($m) use ($input) { |
|
| 38 | + Mail::send('frontend.email.contact', ['data' => $input], function($m) use ($input) { |
|
| 39 | 39 | $m->from('[email protected]', 'Dutchbridge'); |
| 40 | 40 | $m->replyTo($input['email'], $input['name']); |
| 41 | 41 | $m->to('[email protected]')->subject(': thnx for your contact!'); |