Add response when displaying item prices. #780
This commit is contained in:
parent
7f4675a8a2
commit
b592390554
1 changed files with 30 additions and 1 deletions
|
|
@ -79,7 +79,7 @@ class ItemPricingController extends Controller
|
||||||
foreach ($pt_items as $pt_item)
|
foreach ($pt_items as $pt_item)
|
||||||
{
|
{
|
||||||
// make item price hash
|
// make item price hash
|
||||||
$pt_prices[$pt_item->->getID()] = $pt_item->getPrice();
|
$pt_prices[$pt_item->getID()] = $pt_item->getPrice();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -98,6 +98,35 @@ class ItemPricingController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$data_items = [];
|
$data_items = [];
|
||||||
|
foreach ($items as $item)
|
||||||
|
{
|
||||||
|
$item_id = $item->getID();
|
||||||
|
|
||||||
|
// get default price
|
||||||
|
if ($it->getCode() == 'battery')
|
||||||
|
$price = $item->getSellingPrice();
|
||||||
|
else
|
||||||
|
$price = $item->getFee();
|
||||||
|
|
||||||
|
// check if tier has price for item
|
||||||
|
if (isset($pt_prices[$item_id]))
|
||||||
|
{
|
||||||
|
$price = $pt_prices[$item_id];
|
||||||
|
|
||||||
|
// actual price
|
||||||
|
$actual_price = number_format($price / 100, 2, '.', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$actual_price = $price;
|
||||||
|
|
||||||
|
// TODO: recheck this
|
||||||
|
$data_items[] = [
|
||||||
|
'id' => $item_id,
|
||||||
|
'name' => '',
|
||||||
|
'item_type' => '',
|
||||||
|
'price' = $actual_price,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
// response
|
// response
|
||||||
return new JsonResponse([
|
return new JsonResponse([
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue