Skip to content

Commit

Permalink
feat: add meta and SEO fields to Printrove Settings
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
NagariaHussain committed Nov 24, 2023
1 parent 157b8b9 commit 4ff9146
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
"use_custom_product_view_template",
"custom_product_view_template",
"override_success_page",
"success_page_route"
"success_page_route",
"meta__seo_tab",
"product_page_title",
"meta_image",
"meta_description"
],
"fields": [
{
Expand Down Expand Up @@ -118,12 +122,32 @@
"fieldtype": "Data",
"label": "Success Page Route",
"mandatory_depends_on": "eval:doc.override_success_page==1"
},
{
"fieldname": "meta__seo_tab",
"fieldtype": "Tab Break",
"label": "Meta / SEO"
},
{
"fieldname": "product_page_title",
"fieldtype": "Data",
"label": "Product Page Title"
},
{
"fieldname": "meta_image",
"fieldtype": "Attach Image",
"label": "Meta Image"
},
{
"fieldname": "meta_description",
"fieldtype": "Small Text",
"label": "Meta Description"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2023-11-08 22:27:37.903271",
"modified": "2023-11-24 14:14:48.811392",
"modified_by": "Administrator",
"module": "Printrov Merch Store",
"name": "Printrove Settings",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{% from "printrov_merch_store/templates/includes/categories_macro.html" import categories_list_group %}
{% extends "templates/web.html" %}

{% set settings = frappe.get_cached_doc("Printrove Settings") %}
{% set page_title = settings.product_page_title or "Merch Store" %}
{% set meta_image = settings.meta_image or "" %}

{% block title %} {{ page_title }} {% endblock %}
{% set metatags = {
"title": page_title,
"image": meta_image,
"description": settings.meta_description or page_title,
} %}

{% set category = frappe.form_dict.get("category") %}

{% set parents = [] %}
Expand Down
4 changes: 3 additions & 1 deletion printrov_merch_store/www/store/checkout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{% extends "templates/web.html" %}

{% set product_name = frappe.form_dict.get("product") %}
{% block title %} Checkout - {{ product_name }} {% endblock %}

{% block script %}
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>

Expand Down Expand Up @@ -83,7 +86,6 @@

{% block page_content %}

{% set product_name = frappe.form_dict.get("product") %}
<h2>Buy {{ product_name }}</h2>

{% set product = frappe.get_cached_doc("Store Product", product_name) %}
Expand Down

0 comments on commit 4ff9146

Please sign in to comment.