Add merchandise, fix articletosell with src for images
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
@section('content')
|
||||
@if ($basket)
|
||||
<div class="row m-0">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="row mb-3">
|
||||
<div class="col-4">
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
</div>
|
||||
@foreach ($basket as $nature => $items)
|
||||
<div class="row mb-3 p-2 bg-green-light">
|
||||
<div class="row mb-3 p-2 bg-green-light border">
|
||||
<div class="col-12">
|
||||
<h2 style="font-size: 1.6em;">{{ ucfirst($nature) }}</h2>
|
||||
@foreach ($items as $item)
|
||||
@@ -73,19 +73,28 @@
|
||||
calculateTotal();
|
||||
|
||||
$('.basket-quantity').change(function() {
|
||||
calculatePrice($(this).parents('.basket-row'));
|
||||
var offer_id = $(this).data('id');
|
||||
quantity = $('.basket-quantity').value;
|
||||
addBasket(offer_id, quantity, function() {
|
||||
calculatePrice($(this).parents('.basket-row'));
|
||||
calculateTotal();
|
||||
});
|
||||
});
|
||||
|
||||
$('.basket-delete').click(function() {
|
||||
var offer_id = $(this).data('id');
|
||||
var data = {offer_id: offer_id, quantity: 0};
|
||||
$.post("{{ route('Shop.Basket.addBasket') }}", data, function() {
|
||||
addBasket(offer_id, 0, function() {
|
||||
$('#basket_offer-' + offer_id).remove();
|
||||
calculateTotal();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addBasket(offer_id, quantity, callback) {
|
||||
var data = {offer_id: offer_id, quantity: 0};
|
||||
$.post("{{ route('Shop.Basket.addBasket') }}", data, callback);
|
||||
}
|
||||
|
||||
function calculatePrice($that) {
|
||||
var quantity = $that.find('.basket-quantity').val();
|
||||
var price = $that.find('.basket-price').text();
|
||||
@@ -103,6 +112,7 @@
|
||||
});
|
||||
$('#basket-total').html(fixNumber(total));
|
||||
calculateTotalShipped();
|
||||
refreshBasketTop();
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user