@extends('admin.layouts.app') @push('styles_top') @endpush @section('content') {{ $pageTitle }} {{trans('admin/main.dashboard')}} {{ trans('admin/main.discounts') }} {{ csrf_field() }} {{ trans('admin/main.title') }} @error('title') {{ $message }} @enderror {{ trans('update.discount_type') }} discount_type == 'percentage')) ? 'selected' : '' }}>{{ trans('admin/main.percentage') }} discount_type == 'fixed_amount') ? 'selected' : '' }}>{{ trans('update.fixed_amount') }} @error('discount_type') {{ $message }} @enderror {{ trans('update.source') }} @foreach(\App\Models\Discount::$discountSource as $source) source == $source) ? 'selected' : '' }}>{{ trans('update.discount_source_'.$source) }} @endforeach @error('source') {{ $message }} @enderror {{ trans('admin/main.courses') }} @if(!empty($discount) and !empty($discount->discountCourses)) @foreach($discount->discountCourses as $discountCourse) @if(!empty($discountCourse->course)) {{ $discountCourse->course->title }} @endif @endforeach @endif {{ trans('update.bundles') }} @if(!empty($discount) and !empty($discount->discountBundles)) @foreach($discount->discountBundles as $discountBundle) @if(!empty($discountBundle->bundle)) {{ $discountBundle->bundle->title }} @endif @endforeach @endif {{ trans('admin/main.categories') }} @if(!empty($discount) and !empty($discount->discountCategories)) @foreach($discount->discountCategories as $discountCategory) @if(!empty($discountCategory->category)) {{ $discountCategory->category->title }} @endif @endforeach @endif {{ trans('update.product_type') }} {{ trans('admin/main.all') }} product_type == 'physical') ? 'selected' : '' }}>{{ trans('update.physical') }} product_type == 'virtual') ? 'selected' : '' }}>{{ trans('update.virtual') }} {{ trans('admin/main.users') }} @if(!empty($userDiscounts) && $userDiscounts->count() > 0) @foreach($userDiscounts as $userDiscount) {{ $userDiscount->user->full_name }} @endforeach @endif {{ trans('admin/main.groups') }} @if(!empty($userGroups)) @foreach($userGroups as $userGroup) id, $discountGroupIds)) selected @endif>{{ $userGroup->name }} @endforeach @endif @error('group_ids') {{ $message }} @enderror {{ trans('admin/main.discount_percentage') }} @error('percent') {{ $message }} @enderror {{ trans('admin/main.max_amount') }} @error('max_amount') {{ $message }} @enderror {{ trans('admin/main.amount') }} @error('amount') {{ $message }} @enderror {{ trans('update.minimum_order') }} @error('minimum_order') {{ $message }} @enderror {{ trans('admin/main.usable_times') }} @error('count') {{ $message }} @enderror {{ trans('admin/main.discount_code') }} @error('code') {{ $message }} @enderror {{ trans('admin/main.discount_code_hint') }} {{ trans('admin/main.expiration') }} @error('expired_at') {{ $message }} @enderror for_first_purchase) ? 'checked="checked"' : '' }} class="custom-switch-input"/> {{ trans('update.apply_only_for_the_first_purchase') }} {{ trans('update.apply_only_for_the_first_purchase_hint') }} {{ trans('admin/main.submit') }} @endsection @push('scripts_bottom') @endpush