Merge pull request #5996 from jitendra-webkul/master

Fixed issues
This commit is contained in:
Jitendra Singh 2022-03-11 17:41:38 +05:30 committed by GitHub
commit 90e0ddb306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 78 additions and 2 deletions

View File

@ -611,6 +611,7 @@ return [
'type' => 'الصفة نوع',
'text' => 'نص',
'textarea' => 'تيكستاريا',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'السعر',
'boolean' => 'قيمة منطقية',
'select' => 'يختار',

View File

@ -602,6 +602,7 @@ return [
'type' => 'Attribut-Typ',
'text' => 'Text',
'textarea' => 'Textarea',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Preis',
'boolean' => 'Boolean',
'select' => 'Select',

View File

@ -622,6 +622,7 @@ return [
'type' => 'Attribute Type',
'text' => 'Text',
'textarea' => 'Textarea',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Price',
'boolean' => 'Boolean',
'select' => 'Select',

View File

@ -623,6 +623,7 @@ return [
'type' => 'Tipo de atributo',
'text' => 'Texto',
'textarea' => 'Área de texto',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Precio',
'boolean' => 'Booleano',
'select' => 'Lista de selección',

View File

@ -600,6 +600,7 @@ return [
'type' => 'نوع ویژگی',
'text' => 'Text',
'textarea' => 'Textarea',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'قیمت',
'boolean' => 'Boolean',
'select' => 'Select',

View File

@ -622,6 +622,7 @@ return [
'type' => 'Type d\'attribut',
'text' => 'Texte',
'textarea' => 'Zone de texte',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Prix',
'boolean' => 'booléen',
'select' => 'Sélectionner',

View File

@ -622,6 +622,7 @@ return [
'type' => 'विशेषता प्रकार',
'text' => 'मूलपाठ',
'textarea' => 'टेक्सटेरिया',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'कीमत',
'boolean' => 'बूलियन',
'select' => 'चुनते हैं',

View File

@ -600,6 +600,7 @@ return [
'type' => 'Attribute Tipo',
'text' => 'Text',
'textarea' => 'Textarea',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Prezzo',
'boolean' => 'Boolean',
'select' => 'Select',

View File

@ -598,6 +598,7 @@ return [
'type' => 'Attribute Type',
'text' => 'Text',
'textarea' => 'Textarea',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Prijs',
'boolean' => 'Boolean',
'select' => 'Select',

View File

@ -598,6 +598,7 @@ return [
'type' => 'Rodzaj atrybutu',
'text' => 'Tekst',
'textarea' => 'Pole tekstowe',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Cena',
'boolean' => 'Boolean',
'select' => 'Wybierz',

View File

@ -597,6 +597,7 @@ return [
'type' => 'Tipo do Atributo',
'text' => 'Texto',
'textarea' => 'Área de Texto',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Preço',
'boolean' => 'Boleano',
'select' => 'Caixa de Seleção',

View File

@ -605,6 +605,7 @@ return [
'type' => 'Nitelik Tipi',
'text' => 'Text',
'textarea' => 'Textarea',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => 'Fiyat',
'boolean' => 'Boolean',
'select' => 'Seçim',

View File

@ -607,6 +607,7 @@ return [
'type' => '属性类型',
'text' => '文本',
'textarea' => '文本框',
'enable-wysiwyg' => 'Enable Wysiwyg Editor',
'price' => '价格',
'boolean' => '布尔值',
'select' => '选择',

View File

@ -58,6 +58,15 @@
</select>
</div>
<div class="control-group hide">
<label for="enable_wysiwyg">{{ __('admin::app.catalog.attributes.enable-wysiwyg') }}</label>
<label class="switch">
<input type="checkbox" id="enable_wysiwyg" name="enable_wysiwyg" value="1" {{ old('enable_wysiwyg') ? 'checked' : '' }}>
<span class="slider round"></span>
</label>
</div>
{!! view_render_event('bagisto.admin.catalog.attribute.create_form_accordian.general.controls.after') !!}
</div>
@ -347,6 +356,12 @@
} else {
$('#options').parent().removeClass('hide')
}
if (['textarea'].indexOf($(e.target).val()) > -1) {
$('#enable_wysiwyg').parents('.control-group').removeClass('hide')
} else {
$('#enable_wysiwyg').parents('.control-group').addClass('hide')
}
})
});

View File

@ -93,6 +93,18 @@
<input type="hidden" name="type" value="{{ $attribute->type }}"/>
</div>
@if ($attribute->type == 'textarea')
<div class="control-group">
<label for="enable_wysiwyg">{{ __('admin::app.catalog.attributes.enable-wysiwyg') }}</label>
<label class="switch">
<input type="checkbox" id="enable_wysiwyg" name="enable_wysiwyg" value="1" {{ (old('enable_wysiwyg') ?: $attribute->enable_wysiwyg) ? 'checked' : '' }}>
<span class="slider round"></span>
</label>
</div>
@endif
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.general.controls.after', ['attribute' => $attribute]) !!}
</div>
</accordian>

View File

@ -236,7 +236,7 @@
});
tinyMCEHelper.initTinyMCE({
selector: 'textarea#description, textarea#short_description',
selector: 'textarea.enable-wysiwyg, textarea.enable-wysiwyg',
height: 200,
width: "100%",
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',

View File

@ -1 +1 @@
<textarea v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;">{{ old($attribute->code) ?: $product[$attribute->code]}}</textarea>
<textarea v-validate="'{{$validations}}'" class="control {{ $attribute->enable_wysiwyg ? 'enable-wysiwyg' : '' }}" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;">{{ old($attribute->code) ?: $product[$attribute->code]}}</textarea>

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddEnableWysiwygColumnInAttributesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('attributes', function (Blueprint $table) {
$table->boolean('enable_wysiwyg')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('attributes', function (Blueprint $table) {
$table->dropColumn('enable_wysiwyg');
});
}
}

View File

@ -20,6 +20,7 @@ class Attribute extends TranslatableModel implements AttributeContract
'code',
'admin_name',
'type',
'enable_wysiwyg',
'position',
'is_required',
'is_unique',

View File

@ -88,6 +88,8 @@ class AttributeRepository extends Repository
Event::dispatch('catalog.attribute.update.before', $id);
$data['enable_wysiwyg'] = ! isset($data['enable_wysiwyg']) ? 0 : 1;
$attribute->update($data);
if (in_array($attribute->type, ['select', 'multiselect', 'checkbox'])) {

View File

@ -203,6 +203,7 @@ class Booking extends Virtual
$data['quantity'] = $qty;
$data['booking']['ticket_id'] = $ticketId;
$data['booking']['slot'] = implode('-', [$bookingProduct->available_from->timestamp, $bookingProduct->available_to->timestamp]);
$cartProducts = parent::prepareForCart($data);
if (is_string($cartProducts)) {