From bfe7a5fbf67c5c1271cc3bcb6c655241a884f5c3 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 15 Jan 2024 15:23:07 +0800 Subject: [PATCH] Fix display of item prices per tier. #780 --- src/Controller/ItemPricingController.php | 14 ++++++++++---- templates/item-pricing/form.html.twig | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Controller/ItemPricingController.php b/src/Controller/ItemPricingController.php index bcecd5ea..38bc0ce3 100644 --- a/src/Controller/ItemPricingController.php +++ b/src/Controller/ItemPricingController.php @@ -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, ]; } diff --git a/templates/item-pricing/form.html.twig b/templates/item-pricing/form.html.twig index ed41d9e3..c27179a3 100644 --- a/templates/item-pricing/form.html.twig +++ b/templates/item-pricing/form.html.twig @@ -74,7 +74,7 @@ {% endfor %} - +
@@ -147,8 +147,9 @@ function update_table(data) { item_html += '' + item.id + ''; item_html += '' + item.name + ''; item_html += '' + item.item_type_id + ''; + item_html += '' + item.item_type + ''; item_html += ''; - item_html += ''; + item_html += ''; item_html += ''; item_html += ''; }