Fallback Added

This commit is contained in:
devansh bawari 2021-02-10 18:57:50 +05:30
parent 363037e72c
commit 0ee4cfec08
5 changed files with 6 additions and 8 deletions

View File

@ -23,7 +23,7 @@
@foreach (core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }}
{{ $channelModel->name ?? $channelModel->translate($locale)->name ?? $channelModel->translate('en')->name }}
</option>
@endforeach

View File

@ -93,7 +93,7 @@
<select v-validate="'required'" class="control" id="channel_id" name="channel_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.channel') }}&quot;">
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
<option value="{{ $channel->id }}" {{ old('channel_id') == $channel->id ? 'selected' : '' }}>
{{ $channel->name }}
{{ $channel->name ?? $channel->translate(app()->getLocale())->name ?? $channel->translate('en')->name }}
</option>
@endforeach
</select>
@ -114,7 +114,7 @@
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
</div>

View File

@ -97,7 +97,7 @@
<select v-validate="'required'" class="control" id="channel_id" name="channel_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.channel') }}&quot;">
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
<option value="{{ $channel->id }}" {{ $selectedOption == $channel->id ? 'selected' : '' }}>
{{ $channel->name }}
{{ $channel->name ?? $channel->translate(app()->getLocale())->name ?? $channel->translate('en')->name }}
</option>
@endforeach
</select>
@ -119,7 +119,7 @@
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
</div>

View File

@ -35,8 +35,6 @@
<option
value="{{ $channelModel->code }}"
{{ (isset($channel) && ($channelModel->code) == $channel) ? 'selected' : '' }}>
{{-- if translation not found then first will check from the default locale and if still not then last hard code value --}}
{{ $channelModel->name ?? $channelModel->translate($locale)->name ?? $channelModel->translate('en')->name }}
</option>
@endforeach

View File

@ -38,7 +38,7 @@
<option
value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }}
{{ $channelModel->name ?? $channelModel->translate($locale)->name ?? $channelModel->translate('en')->name }}
</option>
@endforeach