This commit is contained in:
jitendra 2019-11-06 13:54:57 +05:30
parent 30e2a743e8
commit 19b8de0ffb
6 changed files with 15 additions and 15 deletions

View File

@ -1,12 +1,6 @@
<select v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;">
<?php $selectedOption = old($attribute->code) ?: $product[$attribute->code] ?>
<?php $selectedOption = old($attribute->code) ?: $product[$attribute->code] ?>
<option value="0" {{ $selectedOption ? '' : 'selected'}}>
{{ $attribute->code == 'status' ? __('admin::app.catalog.products.disabled') : __('admin::app.catalog.products.no') }}
</option>
<option value="1" {{ $selectedOption ? 'selected' : ''}}>
{{ $attribute->code == 'status' ? __('admin::app.catalog.products.enabled') : __('admin::app.catalog.products.yes') }}
</option>
</select>
<label class="switch">
<input type="checkbox" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" {{ $selectedOption ? 'checked' : ''}}>
<span class="slider round"></span>
</label>

View File

@ -159,6 +159,10 @@ abstract class AbstractType
$product->update($data);
foreach ($product->attribute_family->custom_attributes as $attribute) {
if ($attribute->type == 'boolean') {
$data[$attribute->code] = isset($data[$attribute->code]) ? 1 : 0;
}
if (! isset($data[$attribute->code]) || (in_array($attribute->type, ['date', 'datetime']) && ! $data[$attribute->code]))
continue;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=1eae825cea6916507733",
"/css/ui.css": "/css/ui.css?id=b61e212bdad67ef040f5"
"/js/ui.js": "/js/ui.js?id=62a1f3ccf04e55a10ae8",
"/css/ui.css": "/css/ui.css?id=dec1ede3219df6514109"
}

View File

@ -685,6 +685,8 @@ h5 {
display: inline-block;
width: 60px;
height: 34px;
margin-top: 10px;
margin-bottom: 5px;
}
.switch input {