Fix on refreshing description & images from products
This commit is contained in:
@@ -56,7 +56,9 @@
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@include('Admin.Shop.Articles.partials.product.images')
|
||||
<div id="product_images_inherited">
|
||||
@include('Admin.Shop.Articles.partials.product.images')
|
||||
</div>
|
||||
@include('components.uploader.widget', ['load_url' => route('Admin.Shop.Articles.getImages', ['id' => $article['id'] ?? false]), 'delete_url' => route('Admin.Shop.Articles.deleteImage'), 'title' => 'Photos', 'name' => 'images' ])
|
||||
@include('Admin.Core.Comments.partials.comments', ['model' => 'Shop.Article', 'model_id' => $article['id'] ?? false, 'comments' => $article['comments'] ?? false])
|
||||
</div>
|
||||
@@ -69,16 +71,14 @@
|
||||
var product = $('#product_id').select2('data');
|
||||
var name = product[0]['text'];
|
||||
$('input[name="name"]').val(name);
|
||||
console.log(product);
|
||||
|
||||
var product_type = $('#product_type').select2('data');
|
||||
var name = product_type[0]['id'];
|
||||
console.log(product_type);
|
||||
console.log(name);
|
||||
|
||||
var url = "{{ route('Admin.Shop.Articles.getProductDescription') }}/" + product[0]['id'] + '/' + btoa(name);
|
||||
console.log(url);
|
||||
$('#product_description').load(url);
|
||||
|
||||
var url = "{{ route('Admin.Shop.Articles.getProductImages') }}/" + product[0]['id'] + '/' + btoa(name);
|
||||
$('#product_images_inherited').load(url);
|
||||
});
|
||||
|
||||
$('#product_type').change( function() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@if (count($article['inherited'] ?? []))
|
||||
@component('components.layout.box-collapse', ['id' => 'product_description_box', 'title' => 'Informations héritées'])
|
||||
@component('components.layout.box-collapse', ['id' => 'product_description_box', 'title' => 'Informations héritées', 'collapsed' => $collapsed ?? false])
|
||||
@foreach ($article['inherited'] as $inherited)
|
||||
@component('components.card', ['title' => $inherited['name'], 'class' => 'mb-3'])
|
||||
{!! $inherited['description'] !!}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
@include('components.uploader.widget', ['load_url' => route('Admin.Botanic.Varieties.getImages', ['id' => $article['product_id'] ?? false, 'can_edit' => 0]), 'name' => 'images', 'title' => 'Photos produits', 'prefix' => 'product_', 'can_edit' => false, 'collapsed' => true ])
|
||||
@if ($article['product_id'] ?? false)
|
||||
@include('components.uploader.widget', ['load_url' => route('Admin.Botanic.Varieties.getImages', ['id' => $article['product_id'] ?? false, 'can_edit' => 0]), 'name' => 'images', 'title' => 'Photos produits', 'prefix' => 'product_', 'can_edit' => false ])
|
||||
@endif
|
||||
@@ -1,5 +1,3 @@
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@component('components.layout.box-collapse', ['id' => ($prefix ?? '') . ($name ?? 'images'), 'title' => $title ?? 'Photos', 'collapsed' => $collapsed ?? false])
|
||||
|
||||
@include('components.uploader.mini-gallery')
|
||||
@@ -17,7 +15,12 @@
|
||||
|
||||
@endcomponent
|
||||
|
||||
@push('js')
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@if ($no_popup ?? true)
|
||||
@push('js')
|
||||
@endif
|
||||
|
||||
<script>
|
||||
@if ($can_edit ?? true)
|
||||
function {{ $prefix ?? '' }}append_image() {
|
||||
@@ -53,4 +56,7 @@
|
||||
{{ $prefix ?? '' }}loadImages();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@if ($no_popup ?? true)
|
||||
@endpush
|
||||
@endif
|
||||
Reference in New Issue
Block a user