This commit is contained in:
rahul shukla 2019-08-05 21:00:39 +05:30
parent 763a380870
commit 063a58b753
1 changed files with 10 additions and 1 deletions

View File

@ -1,10 +1,19 @@
@inject ('productFlatRepository', 'Webkul\Product\Repositories\ProductFlatRepository')
<?php
$productChannels = $productFlatRepository->findWhere([
'product_id' => $product->id
])->pluck('channel')->unique()->toArray();
?>
<accordian :title="'{{ __('admin::app.catalog.products.channel') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('channels[]') ? 'has-error' : '']">
<label for="channels" class="required">{{ __('admin::app.catalog.products.channel') }}</label>
<select class="control" name="channels[]" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.catalog.products.channel') }}&quot;" multiple>
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
<option value="{{ $channel->id }}">
<option value="{{ $channel->id }}" {{ in_array($channel->code, $productChannels) ? 'selected' : ''}}>
{{ $channel->name }}
</option>
@endforeach