feat: Slashed Prices and Discount display

- Registered mrp and price after discounts
- slashed price with discount in listing, item page and wishlist
- removed redundant imports
- renamed method to `get_web_item_qty_in_stock` to get Website Item stock
- adjusted styles for resizing
- made add to cart button full width on cards
This commit is contained in:
marination
2021-04-13 00:39:26 +05:30
parent 3d5f029e51
commit 60261852b2
11 changed files with 138 additions and 73 deletions

View File

@@ -11,7 +11,7 @@ from frappe.utils.nestedset import get_root_of
from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import get_shopping_cart_settings
from erpnext.accounts.utils import get_account_name
from erpnext.utilities.product import get_qty_in_stock
from erpnext.utilities.product import get_web_item_qty_in_stock
class WebsitePriceListMissingError(frappe.ValidationError):
@@ -93,7 +93,7 @@ def place_order():
item.item_code, ["website_warehouse", "is_stock_item"])
if is_stock_item:
item_stock = get_qty_in_stock(item.item_code, "website_warehouse")
item_stock = get_web_item_qty_in_stock(item.item_code, "website_warehouse")
if not cint(item_stock.in_stock):
throw(_("{1} Not in Stock").format(item.item_code))
if item.qty > item_stock.stock_qty[0][0]:

View File

@@ -8,7 +8,7 @@ from erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings import (
get_shopping_cart_settings,
show_quantity_in_website
)
from erpnext.utilities.product import get_price, get_qty_in_stock, get_non_stock_item_status
from erpnext.utilities.product import get_price, get_web_item_qty_in_stock, get_non_stock_item_status
@frappe.whitelist(allow_guest=True)
def get_product_info_for_website(item_code, skip_quotation_creation=False):
@@ -30,8 +30,7 @@ def get_product_info_for_website(item_code, skip_quotation_creation=False):
cart_settings.default_customer_group,
cart_settings.company
)
stock_status = get_qty_in_stock(item_code, "website_warehouse")
stock_status = get_web_item_qty_in_stock(item_code, "website_warehouse")
product_info = {
"price": price,