Fix display of item prices per tier. #780

This commit is contained in:
Korina Cordero 2024-01-15 15:23:07 +08:00
parent b592390554
commit bfe7a5fbf6
2 changed files with 13 additions and 6 deletions

View file

@ -104,9 +104,15 @@ class ItemPricingController extends Controller
// get default price // get default price
if ($it->getCode() == 'battery') if ($it->getCode() == 'battery')
{
$price = $item->getSellingPrice(); $price = $item->getSellingPrice();
$name = $item->getModel()->getName() . ' ' . $item->getSize()->getName();
}
else else
{
$price = $item->getFee(); $price = $item->getFee();
$name = $item->getName();
}
// check if tier has price for item // check if tier has price for item
if (isset($pt_prices[$item_id])) if (isset($pt_prices[$item_id]))
@ -119,12 +125,12 @@ class ItemPricingController extends Controller
$actual_price = $price; $actual_price = $price;
// TODO: recheck this
$data_items[] = [ $data_items[] = [
'id' => $item_id, 'id' => $item_id,
'name' => '', 'name' => $name,
'item_type' => '', 'item_type_id' => $it->getID(),
'price' = $actual_price, 'item_type' => $it->getName(),
'price' => $actual_price,
]; ];
} }

View file

@ -147,8 +147,9 @@ function update_table(data) {
item_html += '<td>' + item.id + '</td>'; item_html += '<td>' + item.id + '</td>';
item_html += '<td>' + item.name + '</td>'; item_html += '<td>' + item.name + '</td>';
item_html += '<td hidden>' + item.item_type_id + '</td>'; item_html += '<td hidden>' + item.item_type_id + '</td>';
item_html += '<td>' + item.item_type + '</td>';
item_html += '<td class="py-1">'; item_html += '<td class="py-1">';
item_html += '<input name="price[' + item.id + ']" class="form-control ca-filter" type="number" value="' + item.sell_price + '" step="0.01">'; item_html += '<input name="price[' + item.id + ']" class="form-control ca-filter" type="number" value="' + item.price + '" step="0.01">';
item_html += '</td>'; item_html += '</td>';
item_html += '</tr>'; item_html += '</tr>';
} }