fix: show product price in item card
diff --git a/erpnext/portal/product_configurator/utils.py b/erpnext/portal/product_configurator/utils.py
index 9ba4cdc..4693d44 100644
--- a/erpnext/portal/product_configurator/utils.py
+++ b/erpnext/portal/product_configurator/utils.py
@@ -1,6 +1,7 @@
import frappe
from frappe.utils import cint
from erpnext.portal.product_configurator.item_variants_cache import ItemVariantsCacheManager
+from erpnext.shopping_cart.product_info import get_product_info_for_website
def get_field_filter_data():
product_settings = get_product_settings()
@@ -356,10 +357,10 @@
results = frappe.db.sql('''
SELECT
- `tabItem`.`name`, `tabItem`.`item_name`,
+ `tabItem`.`name`, `tabItem`.`item_name`, `tabItem`.`item_code`,
`tabItem`.`website_image`, `tabItem`.`image`,
`tabItem`.`web_long_description`, `tabItem`.`description`,
- `tabItem`.`route`
+ `tabItem`.`route`, `tabItem`.`item_group`
FROM
`tabItem`
{left_join}
@@ -384,6 +385,8 @@
for r in results:
r.description = r.web_long_description or r.description
r.image = r.website_image or r.image
+ product_info = get_product_info_for_website(r.item_code, skip_quotation_creation=True).get('product_info')
+ r.formatted_price = product_info['price'].get('formatted_price') if product_info['price'] else None
return results
diff --git a/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html b/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html
index d39d1b7..890ae50 100644
--- a/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html
+++ b/erpnext/shopping_cart/web_template/item_card_group/item_card_group.html
@@ -26,7 +26,7 @@
{%- set item = frappe.get_doc("Item", item) -%}
{{ item_card(
item.item_name, item.image, item.route, item.description,
- item.standard_rate, item.item_group, values['card_' + index + '_featured'],
+ None, item.item_group, values['card_' + index + '_featured'],
True, "Center"
) }}
{%- endif -%}
diff --git a/erpnext/www/all-products/item_row.html b/erpnext/www/all-products/item_row.html
index b5280ea..20fc9a4 100644
--- a/erpnext/www/all-products/item_row.html
+++ b/erpnext/www/all-products/item_row.html
@@ -2,6 +2,6 @@
{{ item_card(
item.item_name or item.name, item.website_image or item.image, item.route, item.website_description or item.description,
- item.standard_rate, item.item_group
+ item.formatted_price, item.item_group
) }}