diff --git a/webshop/templates/includes/macros.html b/webshop/templates/includes/macros.html
index f5a3d8064c..23905a89b7 100644
--- a/webshop/templates/includes/macros.html
+++ b/webshop/templates/includes/macros.html
@@ -65,7 +65,7 @@
{{ card.title }}
{% endmacro %}
-{%- macro item_card(item, is_featured=False, is_full_width=False, align="Left") -%}
+{%- macro item_card(item, is_featured=False, is_full_width=False, align="Left",template="") -%}
{%- set align_items_class = resolve_class({
'align-items-end': align == 'Right',
'align-items-center': align == 'Center',
@@ -86,12 +86,12 @@ {{ card.title }}
- {{ item_card_body(title, description, item, is_featured, align) }}
+ {{ item_card_body(title, description, item, is_featured, align,template) }}
{% else %}
- {{ item_card_body(title, description, item, is_featured, align) }}
+ {{ item_card_body(title, description, item, is_featured, align,template) }}
{% endif %}
@@ -112,13 +112,13 @@ {{ card.title }}
{% endif %}
- {{ item_card_body(title, description, item, is_featured, align) }}
+ {{ item_card_body(title, description, item, is_featured, align,template) }}
{% endif %}
{%- endmacro -%}
-{%- macro item_card_body(title, description, item, is_featured, align) -%}
+{%- macro item_card_body(title, description, item, is_featured, align,template) -%}
{%- set align_class = resolve_class({
'text-right': align == 'Right',
'text-center': align == 'Center' and not is_featured,
@@ -137,7 +137,9 @@ {{ card.title }}
{{ description or '' }}
{% else %}
+ {% if template != "Product Card" %}
{{ item.item_group or '' }}
+ {% endif %}
{% endif %}
{%- endmacro -%}
diff --git a/webshop/webshop/web_template/product_card/product_card.html b/webshop/webshop/web_template/product_card/product_card.html
index e69de29bb2..09a5bcffa7 100644
--- a/webshop/webshop/web_template/product_card/product_card.html
+++ b/webshop/webshop/web_template/product_card/product_card.html
@@ -0,0 +1,10 @@
+{%- from "webshop/templates/includes/macros.html" import item_card -%}
+
+
+
+
+ {%- set item_doc = frappe.get_doc("Website Item", values["item"]) -%}
+ {{ item_card(item=item_doc, is_featured=values["featured"], is_full_width=True, align="Center", template="Product Card") }}
+
+
+
diff --git a/webshop/webshop/web_template/product_card/product_card.json b/webshop/webshop/web_template/product_card/product_card.json
index 72afeec81e..635890d26e 100644
--- a/webshop/webshop/web_template/product_card/product_card.json
+++ b/webshop/webshop/web_template/product_card/product_card.json
@@ -8,7 +8,7 @@
"fieldname": "item",
"fieldtype": "Link",
"label": "Item",
- "options": "Item",
+ "options": "Website Item",
"reqd": 0
},
{
@@ -20,7 +20,7 @@
}
],
"idx": 0,
- "modified": "2023-10-16 18:02:11.801746",
+ "modified": "2024-06-17 15:15:09.902754",
"modified_by": "Administrator",
"module": "Webshop",
"name": "Product Card",