fix adding price for count(prices) > 3
This commit is contained in:
@@ -29,7 +29,9 @@ class PriceLists
|
|||||||
{
|
{
|
||||||
$price_list = self::getFull($id)->toArray();
|
$price_list = self::getFull($id)->toArray();
|
||||||
$n = count($price_list['price_list_values']);
|
$n = count($price_list['price_list_values']);
|
||||||
|
if ($n <= 3) {
|
||||||
$price_list['price_list_values'] += array_fill($n, 3 - $n, '');
|
$price_list['price_list_values'] += array_fill($n, 3 - $n, '');
|
||||||
|
}
|
||||||
return $price_list;
|
return $price_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
$('#add_price').click( function () {
|
$('#add_price').click( function () {
|
||||||
var index = $('#prices-table tbody tr').length;
|
var index = $('#prices-table tbody tr').length;
|
||||||
$.get("{{ route('Admin.Shop.PriceListValues.addPrice') }}/" + index, function(data) {
|
$.get("{{ route('Admin.Shop.PriceListValues.addPrice') }}/" + index, function(data) {
|
||||||
$("#prices-table").prepend(data);
|
$("#prices-table").append(data);
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user