Try ERPNext Buy Support Partners Foundation

Customising shopping cart

I am trying to customise the shopping cart, need the behavior as follows:

  1. I do not wish to show the price of item on the website.
  2. The client can select the product and quantity he/she needs and place order.
  3. When the sales order is recieved, it would be as a draft and not committed so that i can add the price per item from the back.

Can someone please point to me how i can achieve the same?

1 Like

Price List selection in mandatory for enabling Shopping Cart in ERPNext. As a work-around, set rate in the Item Price as zero, so no rate will be visible on the Website.

On receipt of order, Sales Order will be in the submitted form. Perhaps you can directly create Sales Invoice against it and enter selling rate there.

Thanks for your response @umair but recreating the sales invoice implies redundant work…

is there any change i can make even in core files that can help me…?

Sales Invoice will have all the details fetched from Sales Order, the only work will be to enter Item rates.

Hope someone will help you on how to achieve this with customization. May be if you can just get the draft of the SAles Order (not submitted), that should resolve your query.

yeah getting the draft would solve the problem actually

@ridua

You can comment/remove the code for sales order submit to save it as draft only

@frappe.whitelist()
def place_order():
	quotation = _get_cart_quotation()
	quotation.company = frappe.db.get_value("Shopping Cart Settings", None, "company")
	for fieldname in ["customer_address", "shipping_address_name"]:
		if not quotation.get(fieldname):
			throw(_("{0} is required").format(quotation.meta.get_label(fieldname)))

	quotation.flags.ignore_permissions = True
	quotation.submit()

	if quotation.lead:
		# company used to create customer accounts
		frappe.defaults.set_user_default("company", quotation.company)

	from erpnext.selling.doctype.quotation.quotation import _make_sales_order
	sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True))
	for item in sales_order.get("items"):
		item.reserved_warehouse = frappe.db.get_value("Item", item.item_code, "website_warehouse") or None

	sales_order.flags.ignore_permissions = True
	sales_order.insert()
	#sales_order.submit() 

in erpnext/shopping_cart/cart.py

2 Likes

thanks @Amalendu