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

View file

@ -74,7 +74,7 @@
</td>
</tr>
{% endfor %}
</tbody>
</tbody>
</table>
<div class="">
<input type="submit" class="btn btn-primary" value="Update Price">
@ -147,8 +147,9 @@ function update_table(data) {
item_html += '<td>' + item.id + '</td>';
item_html += '<td>' + item.name + '</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 += '<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 += '</tr>';
}