Skip to content

Commit

Permalink
feat: web view for store product
Browse files Browse the repository at this point in the history
  • Loading branch information
NagariaHussain committed Oct 23, 2023
1 parent f7f3cb3 commit f8a93a4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"actions": [],
"allow_guest_to_view": 1,
"allow_rename": 1,
"autoname": "prompt",
"creation": "2023-10-21 19:07:31.178460",
Expand All @@ -11,6 +12,7 @@
"retail_price",
"column_break_qyeb",
"is_published",
"route",
"printrove_product_data_section",
"front_mockup_image",
"front_mockup",
Expand Down Expand Up @@ -74,11 +76,18 @@
"fieldtype": "Image",
"label": "Front Mockup Image",
"options": "front_mockup"
},
{
"fieldname": "route",
"fieldtype": "Data",
"label": "Route"
}
],
"has_web_view": 1,
"index_web_pages_for_search": 1,
"is_published_field": "is_published",
"links": [],
"modified": "2023-10-23 10:20:15.440895",
"modified": "2023-10-23 10:56:50.848320",
"modified_by": "Administrator",
"module": "Printrov Merch Store",
"name": "Store Product",
Expand All @@ -98,6 +107,7 @@
"write": 1
}
],
"route": "products",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document
from frappe.website.website_generator import WebsiteGenerator


class StoreProduct(Document):
class StoreProduct(WebsiteGenerator):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "templates/web.html" %}

{% block page_content %}
<h1>{{ title }}</h1>
{% endblock %}

<!-- this is a sample default web page template -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<a href="{{ doc.route }}">{{ doc.title or doc.name }}</a>
</div>
<!-- this is a sample default list template -->

0 comments on commit f8a93a4

Please sign in to comment.