@@ -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 | } |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | $query = RedirectService::selectAll(); |
| 26 | 26 | $datatables = \Datatables::of($query) |
| 27 | 27 | |
| 28 | - ->addColumn('url', function ($query) { |
|
| 28 | + ->addColumn('url', function($query) { |
|
| 29 | 29 | return '<a href="'.$query->url.'" target="_blank">'.$query->url.'</a>'; |
| 30 | 30 | }) |
| 31 | 31 | |
| 32 | - ->addColumn('action', function ($query) { |
|
| 32 | + ->addColumn('action', function($query) { |
|
| 33 | 33 | $deleteLink = \Form::deleteajax(url()->route('redirect.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 34 | 34 | $links = '<a href="'.url()->route('redirect.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 35 | 35 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function store() |
| 53 | 53 | { |
| 54 | - $result = RedirectService::create(Request::all()); |
|
| 54 | + $result = RedirectService::create(Request::all()); |
|
| 55 | 55 | return RedirectService::notificationRedirect('redirect.index', $result, 'The redirect was inserted.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function postImport() |
| 73 | 73 | { |
| 74 | 74 | $file = Request::file('file'); |
| 75 | - Excel::load($file, function ($reader) { |
|
| 75 | + Excel::load($file, function($reader) { |
|
| 76 | 76 | |
| 77 | 77 | $results = $reader->get(); |
| 78 | 78 | |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function getExport() |
| 93 | 93 | { |
| 94 | - $result = RedirectService::selectAll(); |
|
| 94 | + $result = RedirectService::selectAll(); |
|
| 95 | 95 | |
| 96 | - Excel::create('redirects', function ($excel) use ($result) { |
|
| 96 | + Excel::create('redirects', function($excel) use ($result) { |
|
| 97 | 97 | |
| 98 | - $excel->sheet('Redirects', function ($sheet) use ($result) { |
|
| 98 | + $excel->sheet('Redirects', function($sheet) use ($result) { |
|
| 99 | 99 | $newArray = array(); |
| 100 | 100 | foreach ($result as $row) { |
| 101 | 101 | $newArray[$row->id] = array( |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | public function update($redirectId) |
| 114 | 114 | { |
| 115 | - $result = RedirectService::updateById(Request::all(), $redirectId); |
|
| 115 | + $result = RedirectService::updateById(Request::all(), $redirectId); |
|
| 116 | 116 | return RedirectService::notificationRedirect('redirect.index', $result, 'The redirect was updated.'); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | public function destroy($redirectId) |
| 120 | 120 | { |
| 121 | - $result = RedirectService::destroy($redirectId); |
|
| 121 | + $result = RedirectService::destroy($redirectId); |
|
| 122 | 122 | |
| 123 | 123 | if ($result) { |
| 124 | 124 | Notification::success('Redirect item is deleted.'); |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | public function index() |
| 32 | 32 | { |
| 33 | - $shop = auth('hideyobackend')->user()->shop; |
|
| 33 | + $shop = auth('hideyobackend')->user()->shop; |
|
| 34 | 34 | $now = Carbon::now(); |
| 35 | 35 | |
| 36 | 36 | $revenueThisMonth = null; |
@@ -60,15 +60,15 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $datatables = \Datatables::of($order) |
| 62 | 62 | |
| 63 | - ->addColumn('generated_custom_order_id', function ($order) { |
|
| 63 | + ->addColumn('generated_custom_order_id', function($order) { |
|
| 64 | 64 | return $order->generated_custom_order_id; |
| 65 | 65 | }) |
| 66 | 66 | |
| 67 | - ->addColumn('created_at', function ($order) { |
|
| 67 | + ->addColumn('created_at', function($order) { |
|
| 68 | 68 | return date('d F H:i', strtotime($order->created_at)); |
| 69 | 69 | }) |
| 70 | 70 | |
| 71 | - ->addColumn('status', function ($order) { |
|
| 71 | + ->addColumn('status', function($order) { |
|
| 72 | 72 | if ($order->orderStatus) { |
| 73 | 73 | if ($order->orderStatus->color) { |
| 74 | 74 | 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>'; |
@@ -77,46 +77,46 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | }) |
| 79 | 79 | |
| 80 | - ->filterColumn('client', function ($query, $keyword) { |
|
| 80 | + ->filterColumn('client', function($query, $keyword) { |
|
| 81 | 81 | |
| 82 | 82 | $query->where( |
| 83 | - function ($query) use ($keyword) { |
|
| 83 | + function($query) use ($keyword) { |
|
| 84 | 84 | $query->whereRaw("order_address.firstname like ?", ["%{$keyword}%"]); |
| 85 | 85 | $query->orWhereRaw("order_address.lastname like ?", ["%{$keyword}%"]); |
| 86 | 86 | ; |
| 87 | 87 | } |
| 88 | 88 | ); |
| 89 | 89 | }) |
| 90 | - ->addColumn('client', function ($order) { |
|
| 90 | + ->addColumn('client', function($order) { |
|
| 91 | 91 | if ($order->client) { |
| 92 | 92 | if ($order->orderBillAddress) { |
| 93 | - return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count() .')</a>'; |
|
| 93 | + return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count().')</a>'; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | }) |
| 97 | - ->addColumn('products', function ($order) { |
|
| 97 | + ->addColumn('products', function($order) { |
|
| 98 | 98 | if ($order->products) { |
| 99 | 99 | return $order->products->count(); |
| 100 | 100 | } |
| 101 | 101 | }) |
| 102 | - ->addColumn('price_with_tax', function ($order) { |
|
| 102 | + ->addColumn('price_with_tax', function($order) { |
|
| 103 | 103 | $money = '€ '.$order->getPriceWithTaxNumberFormat(); |
| 104 | 104 | return $money; |
| 105 | 105 | }) |
| 106 | 106 | |
| 107 | 107 | |
| 108 | - ->addColumn('paymentMethod', function ($order) { |
|
| 108 | + ->addColumn('paymentMethod', function($order) { |
|
| 109 | 109 | if ($order->orderPaymentMethod) { |
| 110 | 110 | return $order->orderPaymentMethod->title; |
| 111 | 111 | } |
| 112 | 112 | }) |
| 113 | - ->addColumn('sendingMethod', function ($order) { |
|
| 113 | + ->addColumn('sendingMethod', function($order) { |
|
| 114 | 114 | if ($order->orderSendingMethod) { |
| 115 | 115 | return $order->orderSendingMethod->title; |
| 116 | 116 | } |
| 117 | 117 | }) |
| 118 | - ->addColumn('action', function ($order) { |
|
| 119 | - $deleteLink = \Form::deleteajax('/admin/order/'. $order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 118 | + ->addColumn('action', function($order) { |
|
| 119 | + $deleteLink = \Form::deleteajax('/admin/order/'.$order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 120 | 120 | $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 121 | 121 | |
| 122 | 122 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | if ($data and $data['order']) { |
| 151 | 151 | |
| 152 | - if($data['type'] == 'one-pdf') { |
|
| 152 | + if ($data['type'] == 'one-pdf') { |
|
| 153 | 153 | $pdfHtml = ""; |
| 154 | 154 | $countOrders = count($data['order']); |
| 155 | 155 | $i = 0; |
@@ -175,15 +175,15 @@ discard block |
||
| 175 | 175 | $pdf = PDF::loadHTML($pdfHtmlBody); |
| 176 | 176 | |
| 177 | 177 | return $pdf->download('order-'.$order->generated_custom_order_id.'.pdf'); |
| 178 | - } elseif($data['type'] == 'product-list') { |
|
| 178 | + } elseif ($data['type'] == 'product-list') { |
|
| 179 | 179 | $products = OrderService::productsByOrderIds($data['order']); |
| 180 | 180 | |
| 181 | - if($products) { |
|
| 181 | + if ($products) { |
|
| 182 | 182 | |
| 183 | 183 | |
| 184 | - Excel::create('products', function ($excel) use ($products) { |
|
| 184 | + Excel::create('products', function($excel) use ($products) { |
|
| 185 | 185 | |
| 186 | - $excel->sheet('Products', function ($sheet) use ($products) { |
|
| 186 | + $excel->sheet('Products', function($sheet) use ($products) { |
|
| 187 | 187 | $newArray = array(); |
| 188 | 188 | foreach ($products as $key => $row) { |
| 189 | 189 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | if ($orders) { |
| 216 | 216 | Request::session()->put('print_orders', $orders->toArray()); |
| 217 | - return response()->json(array('orders' => $orders->toArray() )); |
|
| 217 | + return response()->json(array('orders' => $orders->toArray())); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | Request::session()->destroy('print_orders'); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | public function downloadLabel($orderId) |
| 258 | 258 | { |
| 259 | 259 | $order = OrderService::find($orderId); |
| 260 | - if($order->orderLabel()->count()) { |
|
| 260 | + if ($order->orderLabel()->count()) { |
|
| 261 | 261 | header("Content-type: application/octet-stream"); |
| 262 | 262 | header("Content-disposition: attachment;filename=label.pdf"); |
| 263 | 263 | echo $order->orderLabel->data; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | ); |
| 291 | 291 | foreach ($replace as $key => $val) { |
| 292 | - $content = str_replace("[" . $key . "]", $val, $content); |
|
| 292 | + $content = str_replace("[".$key."]", $val, $content); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | return $content; |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | |
| 303 | 303 | public function update($orderId) |
| 304 | 304 | { |
| 305 | - $result = OrderService::updateById(Request::all(), $orderId); |
|
| 305 | + $result = OrderService::updateById(Request::all(), $orderId); |
|
| 306 | 306 | |
| 307 | 307 | if ($result->errors()->all()) { |
| 308 | 308 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -30,11 +30,11 @@ discard block |
||
| 30 | 30 | if ($request->wantsJson()) { |
| 31 | 31 | |
| 32 | 32 | $query = AttributeService::getModel() |
| 33 | - ->select(['id','value']) |
|
| 33 | + ->select(['id', 'value']) |
|
| 34 | 34 | ->where('attribute_group_id', '=', $attributeGroupId); |
| 35 | 35 | |
| 36 | 36 | $datatables = Datatables::of($query) |
| 37 | - ->addColumn('action', function ($query) use ($attributeGroupId) { |
|
| 37 | + ->addColumn('action', function($query) use ($attributeGroupId) { |
|
| 38 | 38 | $deleteLink = Form::deleteajax(url()->route('attribute.destroy', array('attributeGroupId' => $attributeGroupId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 39 | 39 | $links = ' <a href="'.url()->route('attribute.edit', array('attributeGroupId' => $attributeGroupId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a>'.$deleteLink; |
| 40 | 40 | return $links; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function store(Request $request, $attributeGroupId) |
| 68 | 68 | { |
| 69 | - $result = AttributeService::create($request->all(), $attributeGroupId); |
|
| 69 | + $result = AttributeService::create($request->all(), $attributeGroupId); |
|
| 70 | 70 | return AttributeService::notificationRedirect(array('attribute.index', $attributeGroupId), $result, 'The attribute was inserted.'); |
| 71 | 71 | } |
| 72 | 72 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | public function update(Request $request, $attributeGroupId, $attributeId) |
| 92 | 92 | { |
| 93 | - $result = AttributeService::updateById($request->all(), $attributeGroupId, $attributeId); |
|
| 93 | + $result = AttributeService::updateById($request->all(), $attributeGroupId, $attributeId); |
|
| 94 | 94 | return AttributeService::notificationRedirect(array('attribute.index', $attributeGroupId), $result, 'The attribute was updated.'); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function destroy($attributeGroupId, $attributeId) |
| 104 | 104 | { |
| 105 | - $result = AttributeService::destroy($attributeId); |
|
| 105 | + $result = AttributeService::destroy($attributeId); |
|
| 106 | 106 | |
| 107 | 107 | if ($result) { |
| 108 | 108 | Notification::success('Atrribute was deleted.'); |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | if (Request::wantsJson()) { |
| 24 | 24 | |
| 25 | 25 | $query = ProductTagGroupService::getModel() |
| 26 | - ->select(['id','tag']) |
|
| 26 | + ->select(['id', 'tag']) |
|
| 27 | 27 | ->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 28 | 28 | |
| 29 | - $datatables = \Datatables::of($query)->addColumn('action', function ($query) { |
|
| 29 | + $datatables = \Datatables::of($query)->addColumn('action', function($query) { |
|
| 30 | 30 | $deleteLink = \Form::deleteajax(url()->route('product-tag-group.destroy', $query->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 31 | 31 | $links = '<a href="'.url()->route('product-tag-group.edit', $query->id).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 32 | 32 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function store() |
| 50 | 50 | { |
| 51 | - $result = ProductTagGroupService::create(\Request::all()); |
|
| 51 | + $result = ProductTagGroupService::create(\Request::all()); |
|
| 52 | 52 | return ProductTagGroupService::notificationRedirect('product-tag-group.index', $result, 'The product group tag was inserted.'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function update($productTagGroupId) |
| 66 | 66 | { |
| 67 | - $result = ProductTagGroupService::updateById(\Request::all(), $productTagGroupId); |
|
| 67 | + $result = ProductTagGroupService::updateById(\Request::all(), $productTagGroupId); |
|
| 68 | 68 | return ProductTagGroupService::notificationRedirect('product-tag-group.index', $result, 'The product group tag was updated.'); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | public function destroy($productTagGroupId) |
| 72 | 72 | { |
| 73 | - $result = ProductTagGroupService::destroy($productTagGroupId); |
|
| 73 | + $result = ProductTagGroupService::destroy($productTagGroupId); |
|
| 74 | 74 | |
| 75 | 75 | if ($result) { |
| 76 | 76 | Notification::success('The product group tag was deleted.'); |
@@ -41,19 +41,19 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | $query = $this->productAmountSeries->getModel()->select( |
| 44 | - ['id', 'series_start', 'series_value', 'active','series_max'] |
|
| 44 | + ['id', 'series_start', 'series_value', 'active', 'series_max'] |
|
| 45 | 45 | )->where('product_id', '=', $productId); |
| 46 | 46 | |
| 47 | 47 | $datatables = Datatables::of($query) |
| 48 | 48 | |
| 49 | - ->addColumn('active', function ($query) { |
|
| 49 | + ->addColumn('active', function($query) { |
|
| 50 | 50 | if ($query->active) { |
| 51 | 51 | return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return '<a href="#" class="change-active" data-url="/admin/html-block/change-active/'.$query->id.'"><span class="glyphicon glyphicon-remove icon-red"></span></a>'; |
| 55 | 55 | }) |
| 56 | - ->addColumn('action', function ($query) use ($productId) { |
|
| 56 | + ->addColumn('action', function($query) use ($productId) { |
|
| 57 | 57 | $deleteLink = Form::deleteajax(url()->route('product.product-amount-series.destroy', array('productId' => $productId, 'id' => $query->id)), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
| 58 | 58 | $links = '<a href="'.url()->route('product.product-amount-series.edit', array('productId' => $productId, 'id' => $query->id)).'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 59 | 59 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function store(Request $request, $productId) |
| 88 | 88 | { |
| 89 | - $result = $this->productAmountSeries->create($request->all(), $productId); |
|
| 89 | + $result = $this->productAmountSeries->create($request->all(), $productId); |
|
| 90 | 90 | |
| 91 | 91 | if (isset($result->id)) { |
| 92 | 92 | Notification::success('The product amount series is updated.'); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | public function update(Request $request, $productId, $id) |
| 118 | 118 | { |
| 119 | - $result = $this->productAmountSeries->updateById($request->all(), $productId, $id); |
|
| 119 | + $result = $this->productAmountSeries->updateById($request->all(), $productId, $id); |
|
| 120 | 120 | |
| 121 | 121 | if (!$result->id) { |
| 122 | 122 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function destroy($productId, $id) |
| 130 | 130 | { |
| 131 | - $result = $this->productAmountSeries->destroy($id); |
|
| 131 | + $result = $this->productAmountSeries->destroy($id); |
|
| 132 | 132 | |
| 133 | 133 | if ($result) { |
| 134 | 134 | Notification::success('The product amount series is deleted.'); |
@@ -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 | ); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | ['product.*', |
| 34 | 34 | 'brand.title as brandtitle', |
| 35 | 35 | 'product_category.title as categorytitle'] |
| 36 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 36 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 37 | 37 | |
| 38 | 38 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 39 | 39 | |
@@ -42,23 +42,23 @@ discard block |
||
| 42 | 42 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 43 | 43 | |
| 44 | 44 | $datatables = \Datatables::of($product) |
| 45 | - ->filterColumn('reference_code', function ($query, $keyword) { |
|
| 45 | + ->filterColumn('reference_code', function($query, $keyword) { |
|
| 46 | 46 | $query->whereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 47 | 47 | }) |
| 48 | - ->filterColumn('active', function ($query, $keyword) { |
|
| 48 | + ->filterColumn('active', function($query, $keyword) { |
|
| 49 | 49 | $query->whereRaw("product.active like ?", ["%{$keyword}%"]); |
| 50 | 50 | ; |
| 51 | 51 | }) |
| 52 | 52 | |
| 53 | - ->addColumn('rank', function ($product) { |
|
| 53 | + ->addColumn('rank', function($product) { |
|
| 54 | 54 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="/admin/product/change-rank/'.$product->id.'">'; |
| 55 | 55 | |
| 56 | 56 | }) |
| 57 | 57 | |
| 58 | - ->filterColumn('title', function ($query, $keyword) { |
|
| 58 | + ->filterColumn('title', function($query, $keyword) { |
|
| 59 | 59 | |
| 60 | 60 | $query->where( |
| 61 | - function ($query) use ($keyword) { |
|
| 61 | + function($query) use ($keyword) { |
|
| 62 | 62 | $query->whereRaw("product.title like ?", ["%{$keyword}%"]); |
| 63 | 63 | $query->orWhereRaw("product.reference_code like ?", ["%{$keyword}%"]); |
| 64 | 64 | $query->orWhereRaw("brand.title like ?", ["%{$keyword}%"]); |
@@ -67,11 +67,11 @@ discard block |
||
| 67 | 67 | ); |
| 68 | 68 | }) |
| 69 | 69 | |
| 70 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 70 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 71 | 71 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 72 | 72 | }) |
| 73 | 73 | |
| 74 | - ->addColumn('active', function ($product) { |
|
| 74 | + ->addColumn('active', function($product) { |
|
| 75 | 75 | if ($product->active) { |
| 76 | 76 | 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>'; |
| 77 | 77 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | 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>'; |
| 80 | 80 | }) |
| 81 | 81 | |
| 82 | - ->addColumn('title', function ($product) { |
|
| 82 | + ->addColumn('title', function($product) { |
|
| 83 | 83 | if ($product->brand) { |
| 84 | 84 | return $product->brand->title.' | '.$product->title; |
| 85 | 85 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | }) |
| 89 | 89 | |
| 90 | 90 | |
| 91 | - ->addColumn('amount', function ($product) { |
|
| 91 | + ->addColumn('amount', function($product) { |
|
| 92 | 92 | if ($product->attributes->count()) { |
| 93 | 93 | return '<a href="/admin/product/'.$product->id.'/product-combination">combinations</a>'; |
| 94 | 94 | } |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | return '<input type="text" class="change-amount" value="'.$product->amount.'" style="width:50px;" data-url="'.url()->route('product.change-amount', array('productId' => $product->id)).'">'; |
| 97 | 97 | }) |
| 98 | 98 | |
| 99 | - ->addColumn('image', function ($product) { |
|
| 99 | + ->addColumn('image', function($product) { |
|
| 100 | 100 | if ($product->productImages->count()) { |
| 101 | 101 | return '<img src="/files/product/100x100/'.$product->id.'/'.$product->productImages->first()->file.'" />'; |
| 102 | 102 | } |
| 103 | 103 | }) |
| 104 | - ->addColumn('price', function ($product) { |
|
| 104 | + ->addColumn('price', function($product) { |
|
| 105 | 105 | |
| 106 | 106 | $result = ""; |
| 107 | 107 | if ($product->price) { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | 'amount' => $product->amount |
| 152 | 152 | ); |
| 153 | 153 | |
| 154 | - $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 154 | + $result = '€ '.$output['orginal_price_ex_tax_number_format'].' / € '.$output['orginal_price_inc_tax_number_format']; |
|
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | if ($product->discount_value) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | }) |
| 164 | 164 | |
| 165 | 165 | |
| 166 | - ->addColumn('categorytitle', function ($product) { |
|
| 166 | + ->addColumn('categorytitle', function($product) { |
|
| 167 | 167 | if ($product->subcategories()->count()) { |
| 168 | 168 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 169 | 169 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | return $product->categorytitle; |
| 173 | 173 | }) |
| 174 | 174 | |
| 175 | - ->addColumn('action', function ($product) { |
|
| 175 | + ->addColumn('action', function($product) { |
|
| 176 | 176 | $deleteLink = \Form::deleteajax(url()->route('product.destroy', $product->id), 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger'), $product->title); |
| 177 | 177 | $copy = '<a href="'.url()->route('product.copy', $product->id).'" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Copy</a>'; |
| 178 | 178 | |
@@ -195,26 +195,26 @@ discard block |
||
| 195 | 195 | ['product.*', |
| 196 | 196 | 'brand.title as brandtitle', |
| 197 | 197 | 'product_category.title as categorytitle'] |
| 198 | - )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages','taxRate')) |
|
| 198 | + )->with(array('productCategory', 'brand', 'subcategories', 'attributes', 'productImages', 'taxRate')) |
|
| 199 | 199 | ->leftJoin('product_category as product_category', 'product_category.id', '=', 'product.product_category_id') |
| 200 | 200 | ->leftJoin('brand as brand', 'brand.id', '=', 'product.brand_id') |
| 201 | 201 | ->where('product.shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 202 | 202 | |
| 203 | 203 | $datatables = \Datatables::of($product) |
| 204 | - ->addColumn('rank', function ($product) { |
|
| 204 | + ->addColumn('rank', function($product) { |
|
| 205 | 205 | return '<input type="text" class="change-rank" value="'.$product->rank.'" style="width:50px;" data-url="'.url()->route('product.change-rank', array('productId' => $product->id)).'">'; |
| 206 | 206 | }) |
| 207 | - ->filterColumn('categorytitle', function ($query, $keyword) { |
|
| 207 | + ->filterColumn('categorytitle', function($query, $keyword) { |
|
| 208 | 208 | $query->whereRaw("product_category.title like ?", ["%{$keyword}%"]); |
| 209 | 209 | }) |
| 210 | - ->addColumn('title', function ($product) { |
|
| 210 | + ->addColumn('title', function($product) { |
|
| 211 | 211 | if ($product->brand) { |
| 212 | 212 | return $product->brand->title.' | '.$product->title; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | return $product->title; |
| 216 | 216 | }) |
| 217 | - ->addColumn('categorytitle', function ($product) { |
|
| 217 | + ->addColumn('categorytitle', function($product) { |
|
| 218 | 218 | if ($product->subcategories()->count()) { |
| 219 | 219 | $subcategories = $product->subcategories()->pluck('title')->toArray(); |
| 220 | 220 | return $product->categorytitle.', <small> '.implode(', ', $subcategories).'</small>'; |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | public function store(Request $request) |
| 245 | 245 | { |
| 246 | - $result = ProductService::create($request->all()); |
|
| 246 | + $result = ProductService::create($request->all()); |
|
| 247 | 247 | return ProductService::notificationRedirect('product.index', $result, 'The product was inserted.'); |
| 248 | 248 | } |
| 249 | 249 | |
@@ -288,10 +288,10 @@ discard block |
||
| 288 | 288 | public function postExport() |
| 289 | 289 | { |
| 290 | 290 | |
| 291 | - $result = ProductService::selectAllExport(); |
|
| 292 | - Excel::create('export', function ($excel) use ($result) { |
|
| 291 | + $result = ProductService::selectAllExport(); |
|
| 292 | + Excel::create('export', function($excel) use ($result) { |
|
| 293 | 293 | |
| 294 | - $excel->sheet('Products', function ($sheet) use ($result) { |
|
| 294 | + $excel->sheet('Products', function($sheet) use ($result) { |
|
| 295 | 295 | $newArray = array(); |
| 296 | 296 | foreach ($result as $row) { |
| 297 | 297 | $category = ""; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $i = 0; |
| 321 | 321 | foreach ($row->productImages as $image) { |
| 322 | 322 | $i++; |
| 323 | - $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 323 | + $newArray[$row->id]['image_'.$i] = url('/').'/files/product/800x800/'.$row->id.'/'.$image->file; |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | public function update(Request $request, $productId) |
| 391 | 391 | { |
| 392 | 392 | $input = $request->all(); |
| 393 | - $result = ProductService::updateById($input, $productId); |
|
| 393 | + $result = ProductService::updateById($input, $productId); |
|
| 394 | 394 | |
| 395 | 395 | $redirect = redirect()->route('product.index'); |
| 396 | 396 | |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | public function destroy($id) |
| 422 | 422 | { |
| 423 | - $result = ProductService::destroy($id); |
|
| 423 | + $result = ProductService::destroy($id); |
|
| 424 | 424 | |
| 425 | 425 | if ($result) { |
| 426 | 426 | Notification::success('The product was deleted.'); |
@@ -44,15 +44,15 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $datatables = \Datatables::of($invoice) |
| 46 | 46 | |
| 47 | - ->addColumn('price_with_tax', function ($order) { |
|
| 47 | + ->addColumn('price_with_tax', function($order) { |
|
| 48 | 48 | $money = '€ '.$order->price_with_tax; |
| 49 | 49 | return $money; |
| 50 | 50 | }) |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | - ->addColumn('action', function ($invoice) { |
|
| 55 | - $deleteLink = \Form::deleteajax('/invoice/'. $invoice->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 54 | + ->addColumn('action', function($invoice) { |
|
| 55 | + $deleteLink = \Form::deleteajax('/invoice/'.$invoice->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
| 56 | 56 | $download = '<a href="/invoice/'.$invoice->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
| 57 | 57 | $links = '<a href="/invoice/'.$invoice->id.'" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Show</a> '.$download; |
| 58 | 58 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function store() |
| 92 | 92 | { |
| 93 | - $result = $this->invoice->create(Request::all()); |
|
| 93 | + $result = $this->invoice->create(Request::all()); |
|
| 94 | 94 | |
| 95 | 95 | if (isset($result->id)) { |
| 96 | 96 | \Notification::success('The invoice was inserted.'); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | public function update($invoiceId) |
| 114 | 114 | { |
| 115 | - $result = $this->invoice->updateById(Request::all(), $invoiceId); |
|
| 115 | + $result = $this->invoice->updateById(Request::all(), $invoiceId); |
|
| 116 | 116 | |
| 117 | 117 | if (isset($result->id)) { |
| 118 | 118 | \Notification::success('The invoice was updated.'); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public function destroy($invoiceId) |
| 127 | 127 | { |
| 128 | - $result = $this->invoice->destroy($invoiceId); |
|
| 128 | + $result = $this->invoice->destroy($invoiceId); |
|
| 129 | 129 | |
| 130 | 130 | if ($result) { |
| 131 | 131 | Notification::success('The invoice was deleted.'); |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | if ($request->wantsJson()) { |
| 27 | 27 | |
| 28 | 28 | $productCategory = ProductCategoryService::getModel()->select( |
| 29 | - ['id', 'active','shop_id','parent_id', 'redirect_product_category_id','title', 'meta_title', 'meta_description'] |
|
| 29 | + ['id', 'active', 'shop_id', 'parent_id', 'redirect_product_category_id', 'title', 'meta_title', 'meta_description'] |
|
| 30 | 30 | )->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
| 31 | 31 | |
| 32 | 32 | $datatables = Datatables::of($productCategory) |
| 33 | 33 | |
| 34 | - ->addColumn('image', function ($productCategory) { |
|
| 34 | + ->addColumn('image', function($productCategory) { |
|
| 35 | 35 | if ($productCategory->productCategoryImages->count()) { |
| 36 | 36 | return '<img src="/files/product_category/100x100/'.$productCategory->id.'/'.$productCategory->productCategoryImages->first()->file.'" />'; |
| 37 | 37 | } |
| 38 | 38 | }) |
| 39 | 39 | |
| 40 | - ->addColumn('title', function ($productCategory) { |
|
| 40 | + ->addColumn('title', function($productCategory) { |
|
| 41 | 41 | |
| 42 | 42 | $categoryTitle = $productCategory->title; |
| 43 | 43 | if ($productCategory->refProductCategory) { |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | return $categoryTitle; |
| 52 | 52 | }) |
| 53 | 53 | |
| 54 | - ->addColumn('products', function ($productCategory) { |
|
| 54 | + ->addColumn('products', function($productCategory) { |
|
| 55 | 55 | return $productCategory->products->count(); |
| 56 | 56 | }) |
| 57 | - ->addColumn('parent', function ($productCategory) { |
|
| 57 | + ->addColumn('parent', function($productCategory) { |
|
| 58 | 58 | |
| 59 | 59 | if ($productCategory->parent()->count()) { |
| 60 | 60 | return $productCategory->parent()->first()->title; |
| 61 | 61 | } |
| 62 | 62 | }) |
| 63 | 63 | |
| 64 | - ->addColumn('active', function ($product) { |
|
| 64 | + ->addColumn('active', function($product) { |
|
| 65 | 65 | if ($product->active) { |
| 66 | 66 | return '<a href="#" class="change-active" data-url="/admin/product-category/change-active/'.$product->id.'"><span class="glyphicon glyphicon-ok icon-green"></span></a>'; |
| 67 | 67 | } |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | }) |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - ->addColumn('seo', function ($productCategory) { |
|
| 73 | + ->addColumn('seo', function($productCategory) { |
|
| 74 | 74 | if ($productCategory->meta_title && $productCategory->meta_description) { |
| 75 | 75 | return '<i class="fa fa-check"></i>'; |
| 76 | 76 | } |
| 77 | 77 | }) |
| 78 | - ->addColumn('action', function ($productCategory) { |
|
| 78 | + ->addColumn('action', function($productCategory) { |
|
| 79 | 79 | $deleteLink = Form::deleteajax(url()->route('product-category.destroy', $productCategory->id), 'Delete', '', array('class'=>'btn btn-sm btn-danger'), $productCategory->title); |
| 80 | 80 | $links = '<a href="'.url()->route('product-category.edit', $productCategory->id).'" class="btn btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
| 81 | 81 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | public function store(Request $request) |
| 138 | 138 | { |
| 139 | - $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 139 | + $result = ProductCategoryService::create($this->generateInput($request->all())); |
|
| 140 | 140 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was inserted.'); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -160,13 +160,13 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | public function update(Request $request, $productCategoryId) |
| 162 | 162 | { |
| 163 | - $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 163 | + $result = ProductCategoryService::updateById($this->generateInput($request->all()), $productCategoryId); |
|
| 164 | 164 | return ProductCategoryService::notificationRedirect('product-category.index', $result, 'The product category was updated.'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | public function destroy($productCategoryId) |
| 168 | 168 | { |
| 169 | - $result = ProductCategoryService::destroy($productCategoryId); |
|
| 169 | + $result = ProductCategoryService::destroy($productCategoryId); |
|
| 170 | 170 | |
| 171 | 171 | if ($result) { |
| 172 | 172 | Notification::success('Category was deleted.'); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | } elseif ($parent->children()->count()) { |
| 237 | 237 | $node->makeLastChildOf($parent); |
| 238 | 238 | foreach ($parent->children()->get() as $key => $row) { |
| 239 | - $positionKey = $position - 1; |
|
| 239 | + $positionKey = $position - 1; |
|
| 240 | 240 | if ($key == $positionKey) { |
| 241 | 241 | $node->moveToRightOf($row); |
| 242 | 242 | } |