chore: Drive E-commerce via Website Item

- Removed Shopping Cart Settings
- Portal fully driven via E Commerce Settings
- All Item listing querying will happen via ProductQuery engine only
- Product Listing via Website Items
- removed redundant code
- Moved all website logic from Item to Website Item
This commit is contained in:
marination
2021-02-16 18:45:36 +05:30
parent 939b0dd67d
commit eef9cf152f
33 changed files with 667 additions and 1099 deletions

View File

@@ -23,7 +23,7 @@
})
</script>
{% else %}
{{ product_image(website_image or image or 'no-image.jpg', alt=website_image_alt or item_name) }}
{{ product_image(doc.website_image or doc.image or 'no-image.jpg', alt=doc.website_image_alt or doc.item_name) }}
{% endif %}
<!-- Simple image preview -->

View File

@@ -4,7 +4,7 @@
{% set select_address = True %}
{% endif %}
{% set show_coupon_code = frappe.db.get_single_value('Shopping Cart Settings', 'show_apply_coupon_code_in_website') %}
{% set show_coupon_code = frappe.db.get_single_value('E Commerce Settings', 'show_apply_coupon_code_in_website') %}
{% if show_coupon_code == 1%}
<div class="mb-3">
<div class="row no-gutters">

View File

@@ -1,4 +1,4 @@
{% from "erpnext/templates/includes/macros.html" import item_card, item_card_body %}
{% from "erpnext/templates/includes/macros.html" import item_card, item_card_body, product_image_square %}
<a class="product-link product-list-link" href="{{ route|abs_url }}">
<div class='row'>

View File

@@ -6,10 +6,7 @@ from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import (
show_attachments,
)
from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import show_attachments
def get_context(context):
context.no_cache = 1
@@ -26,7 +23,7 @@ def get_context(context):
context.payment_ref = frappe.db.get_value("Payment Request",
{"reference_name": frappe.form_dict.name}, "name")
context.enabled_checkout = frappe.get_doc("Shopping Cart Settings").enable_checkout
context.enabled_checkout = frappe.get_doc("E Commerce Settings").enable_checkout
default_print_format = frappe.db.get_value('Property Setter', dict(property='default_print_format', doc_type=frappe.form_dict.doctype), "value")
if default_print_format: