Merge pull request #2946 from jitendra-webkul/1.0
Cancel feature added in customer order
This commit is contained in:
commit
b3e18c063e
|
|
@ -87,4 +87,23 @@ class OrderController extends Controller
|
|||
|
||||
return $pdf->download('invoice-' . $invoice->created_at->format('d-m-Y') . '.pdf');
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel action for the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function cancel($id)
|
||||
{
|
||||
$result = $this->orderRepository->cancel($id);
|
||||
|
||||
if ($result) {
|
||||
session()->flash('success', trans('admin::app.response.cancel-success', ['name' => 'Order']));
|
||||
} else {
|
||||
session()->flash('error', trans('admin::app.response.cancel-error', ['name' => 'Order']));
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
|
@ -275,6 +275,8 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
|
|||
'view' => 'shop::customers.account.orders.print'
|
||||
])->name('customer.orders.print');
|
||||
|
||||
Route::get('/orders/cancel/{id}', 'Webkul\Shop\Http\Controllers\OrderController@cancel')->name('customer.orders.cancel');
|
||||
|
||||
/* Reviews route */
|
||||
//Customer reviews
|
||||
Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [
|
||||
|
|
|
|||
|
|
@ -313,6 +313,7 @@ return [
|
|||
'individual-refund' => 'Refund #:refund_id',
|
||||
'adjustment-refund' => 'Adjustment Refund',
|
||||
'adjustment-fee' => 'Adjustment Fee',
|
||||
'cancel-btn-title' => 'Cancel',
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,18 @@
|
|||
|
||||
<div class="account-head">
|
||||
<span class="back-icon"><a href="{{ route('customer.account.index') }}"><i class="icon icon-menu-back"></i></a></span>
|
||||
|
||||
<span class="account-heading">
|
||||
{{ __('shop::app.customer.account.order.view.page-tile', ['order_id' => $order->increment_id]) }}
|
||||
</span>
|
||||
<span></span>
|
||||
|
||||
|
||||
@if ($order->canCancel())
|
||||
<a href="{{ route('customer.orders.cancel', $order->id) }}" class="btn btn-lg btn-primary" v-alert:message="'{{ __('admin::app.sales.orders.cancel-confirm-msg') }}'" style="float: right">
|
||||
{{ __('shop::app.customer.account.order.view.cancel-btn-title') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{!! view_render_event('bagisto.shop.customers.account.orders.view.before', ['order' => $order]) !!}
|
||||
|
|
|
|||
Loading…
Reference in New Issue