new: add channel management

This commit is contained in:
Valentin Lab
2025-10-05 09:39:27 +02:00
parent 5bee7c5e50
commit dc05eb31ac
16 changed files with 541 additions and 65 deletions

View File

@@ -58,7 +58,7 @@
updateBasket(offer_id, quantity, function() {
calculatePrice($row);
calculateTotal();
});
}, $row);
});
$('.basket-delete').click(function() {
@@ -70,13 +70,20 @@
});
}
function updateBasket(offer_id, quantity, callback) {
function updateBasket(offer_id, quantity, callback, $row) {
var data = {
offer_id: offer_id,
quantity: quantity,
update: true
};
$.post("{{ route('Shop.Basket.addBasket') }}", data, callback);
$.post("{{ route('Shop.Basket.addBasket') }}", data, function(response) {
if ($row && response && response.added && typeof response.added.price !== 'undefined') {
$row.find('.basket-price').text(fixNumber(response.added.price));
$row.find('.basket-total-row').text(fixNumber(response.added.price * $row.find('.basket-quantity').val()));
}
callback(response);
refreshBasketTop();
});
}
function calculatePrice($that) {