first upload all files
This commit is contained in:
20
Modules/Coupon/Resources/lang/en/attributes.php
Normal file
20
Modules/Coupon/Resources/lang/en/attributes.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Name',
|
||||
'code' => 'Code',
|
||||
'is_percent' => 'Discount Type',
|
||||
'value' => 'Value',
|
||||
'free_shipping' => 'Free Shipping',
|
||||
'start_date' => 'Start date',
|
||||
'end_date' => 'End date',
|
||||
'is_active' => 'Status',
|
||||
'minimum_spend' => 'Minimum Spend',
|
||||
'maximum_spend' => 'Maximum Spend',
|
||||
'products' => 'Products',
|
||||
'exclude_products' => 'Exclude Products',
|
||||
'categories' => 'Categories',
|
||||
'exclude_categories' => 'Exclude Categories',
|
||||
'usage_limit_per_coupon' => 'Usage Limit Per Coupon',
|
||||
'usage_limit_per_customer' => 'Usage Limit Per Customer',
|
||||
];
|
||||
27
Modules/Coupon/Resources/lang/en/coupons.php
Normal file
27
Modules/Coupon/Resources/lang/en/coupons.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'coupon' => 'Coupon',
|
||||
'coupons' => 'Coupons',
|
||||
'table' => [
|
||||
'name' => 'Name',
|
||||
'code' => 'Code',
|
||||
'discount' => 'Discount',
|
||||
],
|
||||
'tabs' => [
|
||||
'group' => [
|
||||
'coupon_information' => 'Coupon Information',
|
||||
],
|
||||
'general' => 'General',
|
||||
'usage_restrictions' => 'Usage Restrictions',
|
||||
'usage_limits' => 'Usage Limits',
|
||||
],
|
||||
'form' => [
|
||||
'price_types' => [
|
||||
'0' => 'Fixed',
|
||||
'1' => 'Percent',
|
||||
],
|
||||
'allow_free_shipping' => 'Allow free shipping',
|
||||
'enable_the_coupon' => 'Enable the coupon',
|
||||
],
|
||||
];
|
||||
11
Modules/Coupon/Resources/lang/en/messages.php
Normal file
11
Modules/Coupon/Resources/lang/en/messages.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'not_exists' => 'The coupon does not exist.',
|
||||
'already_applied' => 'The coupon has been already applied.',
|
||||
'invalid_coupon' => 'The coupon is not valid.',
|
||||
'minimum_spend' => 'You need to spend at least :amount to apply this coupon.',
|
||||
'maximum_spend' => 'You need to spend less than :amount to apply this coupon.',
|
||||
'inapplicable' => 'This coupon is not applicable to your cart.',
|
||||
'usage_limit_reached' => 'The coupon usage limit has been reached.',
|
||||
];
|
||||
8
Modules/Coupon/Resources/lang/en/permissions.php
Normal file
8
Modules/Coupon/Resources/lang/en/permissions.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'index' => 'Index Coupons',
|
||||
'create' => 'Create Coupons',
|
||||
'edit' => 'Edit Coupons',
|
||||
'destroy' => 'Delete Coupons',
|
||||
];
|
||||
@@ -0,0 +1,18 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('admin::resource.create', ['resource' => trans('coupon::coupons.coupon')]))
|
||||
|
||||
<li><a href="{{ route('admin.coupons.index') }}">{{ trans('coupon::coupons.coupons') }}</a></li>
|
||||
<li class="active">{{ trans('admin::resource.create', ['resource' => trans('coupon::coupons.coupon')]) }}</li>
|
||||
@endcomponent
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ route('admin.coupons.store') }}" class="form-horizontal" id="coupon-create-form" novalidate>
|
||||
{{ csrf_field() }}
|
||||
|
||||
{!! $tabs->render(compact('coupon')) !!}
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@include('coupon::admin.coupons.partials.scripts')
|
||||
20
Modules/Coupon/Resources/views/admin/coupons/edit.blade.php
Normal file
20
Modules/Coupon/Resources/views/admin/coupons/edit.blade.php
Normal file
@@ -0,0 +1,20 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('admin::resource.edit', ['resource' => trans('coupon::coupons.coupon')]))
|
||||
@slot('subtitle', $coupon->name)
|
||||
|
||||
<li><a href="{{ route('admin.coupons.index') }}">{{ trans('coupon::coupons.coupons') }}</a></li>
|
||||
<li class="active">{{ trans('admin::resource.edit', ['resource' => trans('coupon::coupons.coupon')]) }}</li>
|
||||
@endcomponent
|
||||
|
||||
@section('content')
|
||||
<form method="POST" action="{{ route('admin.coupons.update', $coupon) }}" class="form-horizontal" id="coupon-edit-form" novalidate>
|
||||
{{ csrf_field() }}
|
||||
{{ method_field('put') }}
|
||||
|
||||
{!! $tabs->render(compact('coupon')) !!}
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@include('coupon::admin.coupons.partials.scripts')
|
||||
42
Modules/Coupon/Resources/views/admin/coupons/index.blade.php
Normal file
42
Modules/Coupon/Resources/views/admin/coupons/index.blade.php
Normal file
@@ -0,0 +1,42 @@
|
||||
@extends('admin::layout')
|
||||
|
||||
@component('admin::components.page.header')
|
||||
@slot('title', trans('coupon::coupons.coupons'))
|
||||
|
||||
<li class="active">{{ trans('coupon::coupons.coupons') }}</li>
|
||||
@endcomponent
|
||||
|
||||
@component('admin::components.page.index_table')
|
||||
@slot('buttons', ['create'])
|
||||
@slot('resource', 'coupons')
|
||||
@slot('name', trans('coupon::coupons.coupon'))
|
||||
|
||||
@slot('thead')
|
||||
<tr>
|
||||
@include('admin::partials.table.select_all')
|
||||
|
||||
<th data-sort>{{ trans('admin::admin.table.id') }}</th>
|
||||
<th>{{ trans('coupon::coupons.table.name') }}</th>
|
||||
<th>{{ trans('coupon::coupons.table.code') }}</th>
|
||||
<th>{{ trans('coupon::coupons.table.discount') }}</th>
|
||||
<th>{{ trans('admin::admin.table.status') }}</th>
|
||||
<th data-sort>{{ trans('admin::admin.table.created') }}</th>
|
||||
</tr>
|
||||
@endslot
|
||||
@endcomponent
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
new DataTable('#coupons-table .table', {
|
||||
columns: [
|
||||
{ data: 'checkbox', orderable: false, searchable: false, width: '3%' },
|
||||
{ data: 'id', width: '5%' },
|
||||
{ data: 'name', name: 'translations.name', orderable: false, defaultContent: '' },
|
||||
{ data: 'code' },
|
||||
{ data: 'discount', name: 'value' },
|
||||
{ data: 'status', name: 'is_active', searchable: false },
|
||||
{ data: 'created', name: 'created_at' },
|
||||
],
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,16 @@
|
||||
@include('admin::partials.selectize_remote')
|
||||
|
||||
@push('shortcuts')
|
||||
<dl class="dl-horizontal">
|
||||
<dt><code>b</code></dt>
|
||||
<dd>{{ trans('admin::admin.shortcuts.back_to_index', ['name' => trans('coupon::coupons.coupon')]) }}</dd>
|
||||
</dl>
|
||||
@endpush
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
keypressAction([
|
||||
{ key: 'b', route: "{{ route('admin.coupons.index') }}" },
|
||||
]);
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::text('name', trans('coupon::attributes.name'), $errors, $coupon, ['required' => true]) }}
|
||||
{{ Form::text('code', trans('coupon::attributes.code'), $errors, $coupon, ['required' => true]) }}
|
||||
{{ Form::select('is_percent', trans('coupon::attributes.is_percent'), $errors, trans('coupon::coupons.form.price_types'), $coupon) }}
|
||||
{{ Form::number('value', trans('coupon::attributes.value'), $errors, $coupon, ['min' => 0]) }}
|
||||
{{ Form::checkbox('free_shipping', trans('coupon::attributes.free_shipping'), trans('coupon::coupons.form.allow_free_shipping'), $errors, $coupon->freeShipping()) }}
|
||||
{{ Form::text('start_date', trans('coupon::attributes.start_date'), $errors, $coupon, ['class' => 'datetime-picker', 'data-default-date' => $coupon->start_date]) }}
|
||||
{{ Form::text('end_date', trans('coupon::attributes.end_date'), $errors, $coupon, ['class' => 'datetime-picker', 'data-default-date' => $coupon->end_date]) }}
|
||||
{{ Form::checkbox('is_active', trans('coupon::attributes.is_active'), trans('coupon::coupons.form.enable_the_coupon'), $errors, $coupon) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::number('usage_limit_per_coupon', trans('coupon::attributes.usage_limit_per_coupon'), $errors, $coupon) }}
|
||||
{{ Form::number('usage_limit_per_customer', trans('coupon::attributes.usage_limit_per_customer'), $errors, $coupon) }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::number('minimum_spend', trans('coupon::attributes.minimum_spend'), $errors, $coupon, ['min' => 0]) }}
|
||||
{{ Form::number('maximum_spend', trans('coupon::attributes.maximum_spend'), $errors, $coupon, ['min' => 0]) }}
|
||||
{{ Form::select('products', trans('coupon::attributes.products'), $errors, $products, $coupon, ['class' => 'selectize prevent-creation', 'data-url' => route('admin.products.index'), 'multiple' => true]) }}
|
||||
{{ Form::select('exclude_products', trans('coupon::attributes.exclude_products'), $errors, $excludeProducts, $coupon, ['class' => 'selectize prevent-creation', 'data-url' => route('admin.products.index'), 'multiple' => true]) }}
|
||||
{{ Form::select('categories', trans('coupon::attributes.categories'), $errors, $categories, $coupon, ['class' => 'selectize prevent-creation', 'multiple' => true]) }}
|
||||
{{ Form::select('exclude_categories', trans('coupon::attributes.exclude_categories'), $errors, $categories, $coupon, ['class' => 'selectize prevent-creation', 'multiple' => true]) }}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user