issue #848
This commit is contained in:
parent
600bf55f1f
commit
148f942c4a
|
|
@ -98,7 +98,8 @@
|
|||
|
||||
@if (view()->exists($typeView = 'admin::catalog.products.field-types.' . $attribute->type))
|
||||
|
||||
<div class="control-group {{ $attribute->type }}" :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']">
|
||||
<div class="control-group {{ $attribute->type }}" @if ($attribute->type == 'multiselect') :class="[errors.has('{{ $attribute->code }}[]') ? 'has-error' : '']" @else :class="[errors.has('{{ $attribute->code }}') ? 'has-error' : '']" @endif>
|
||||
|
||||
<label for="{{ $attribute->code }}" {{ $attribute->is_required ? 'class=required' : '' }}>
|
||||
{{ $attribute->admin_name }}
|
||||
|
||||
|
|
@ -124,7 +125,13 @@
|
|||
|
||||
@include ($typeView)
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $attribute->code }}')">@{{ errors.first('{!! $attribute->code !!}') }}</span>
|
||||
<span class="control-error" @if ($attribute->type == 'multiselect') v-if="errors.has('{{ $attribute->code }}[]')" @else v-if="errors.has('{{ $attribute->code }}')" @endif>
|
||||
@if ($attribute->type == 'multiselect')
|
||||
@{{ errors.first('{!! $attribute->code !!}[]') }}
|
||||
@else
|
||||
@{{ errors.first('{!! $attribute->code !!}') }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
}
|
||||
?>
|
||||
|
||||
<div class="control-group {{ $field['type'] }}" :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]') ? 'has-error' : '']">
|
||||
<div class="control-group {{ $field['type'] }}" @if ($field['type'] == 'multiselect') :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]') ? 'has-error' : '']" @else :class="[errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]') ? 'has-error' : '']" @endif>
|
||||
|
||||
<label for="{{ $name }}" {{ !isset($field['validation']) || strpos('required', $field['validation']) < 0 ? '' : 'class=required' }}>
|
||||
|
||||
|
|
@ -216,7 +216,14 @@
|
|||
<span class="control-info">{{ trans($field['info']) }}</span>
|
||||
@endif
|
||||
|
||||
<span class="control-error" v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]')">@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}]') }}</span>
|
||||
<span class="control-error" @if ($field['type'] == 'multiselect') v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}][]')" @else v-if="errors.has('{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $field['name'] }}]')" @endif
|
||||
>
|
||||
@if ($field['type'] == 'multiselect')
|
||||
@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}][]') }}
|
||||
@else
|
||||
@{{ errors.first('{!! $firstField !!}[{!! $secondField !!}][{!! $thirdField !!}][{!! $field['name'] !!}]') }}
|
||||
@endif
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class ProductFlat
|
|||
public function afterAttributeDeleted($attributeId)
|
||||
{
|
||||
$attribute = $this->attributeRepository->find($attributeId);
|
||||
|
||||
|
||||
if (Schema::hasColumn('product_flat', strtolower($attribute->code))) {
|
||||
Schema::table('product_flat', function (Blueprint $table) use($attribute) {
|
||||
$table->dropColumn($attribute->code);
|
||||
|
|
@ -180,13 +180,13 @@ class ProductFlat
|
|||
foreach ($familyAttributes[$product->attribute_family->id] as $attribute) {
|
||||
if ($parentProduct && ! in_array($attribute->code, ['sku', 'name', 'price', 'weight', 'status']))
|
||||
continue;
|
||||
|
||||
|
||||
if (in_array($attribute->code, ['short_description', 'tax_category_id', 'meta_title', 'meta_keywords', 'meta_description', 'width', 'height']))
|
||||
continue;
|
||||
|
||||
// if (! Schema::hasColumn('product_flat', $attribute->code))
|
||||
// continue;
|
||||
|
||||
if (! Schema::hasColumn('product_flat', $attribute->code))
|
||||
continue;
|
||||
|
||||
if ($attribute->value_per_channel) {
|
||||
if ($attribute->value_per_locale) {
|
||||
$productAttributeValue = $product->attribute_values()->where('channel', $channel->code)->where('locale', $locale->code)->where('attribute_id', $attribute->id)->first();
|
||||
|
|
|
|||
Loading…
Reference in New Issue