Make it possible to merge products (closes #243)

This commit is contained in:
Bernd Bestel
2020-12-20 20:58:22 +01:00
parent dadf93a94c
commit c9b5e14473
9 changed files with 220 additions and 0 deletions

View File

@@ -136,6 +136,13 @@
title="{{ $__t('Copy this item') }}">
<i class="fas fa-copy"></i>
</a>
<a class="btn btn-primary btn-sm merge-products-button"
href="#"
data-product-id="{{ $product->id }}"
data-toggle="tooltip"
title="{{ $__t('Merge this product with another one') }}">
<i class="fas fa-compress-alt"></i>
</a>
<a class="btn btn-danger btn-sm product-delete-button"
href="#"
data-product-id="{{ $product->id }}"
@@ -193,4 +200,53 @@
</table>
</div>
</div>
<div class="modal fade"
id="merge-products-modal"
tabindex="-1">
<div class="modal-dialog">
<div class="modal-content text-center">
<div class="modal-header">
<h4 class="modal-title w-100">{{ $__t('Merge products') }}</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="merge-products-keep">{{ $__t('Product to keep') }}&nbsp;<i class="fas fa-question-circle text-muted"
data-toggle="tooltip"
title="{{ $__t('After merging, this product will be kept') }}"></i>
</label>
<select class="custom-control custom-select"
id="merge-products-keep">
<option></option>
@foreach($products as $product)
<option value="{{ $product->id }}">{{ $product->name }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="merge-products-remove">{{ $__t('Product to remove') }}&nbsp;<i class="fas fa-question-circle text-muted"
data-toggle="tooltip"
title="{{ $__t('After merging, all occurences of this product will be replaced by "Product to keep" (means this product will not exist anymore)') }}"></i>
</label>
<select class="custom-control custom-select"
id="merge-products-remove">
<option></option>
@foreach($products as $product)
<option value="{{ $product->id }}">{{ $product->name }}</option>
@endforeach
</select>
</div>
</div>
<div class="modal-footer">
<button type="button"
class="btn btn-secondary"
data-dismiss="modal">{{ $__t('Cancel') }}</button>
<button id="merge-products-save-button"
type="button"
class="btn btn-primary"
data-dismiss="modal">{{ $__t('OK') }}</button>
</div>
</div>
</div>
</div>
@stop