mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
chore: Patches for Website Item
- Patch to make website item from item - Patch to move Products and Shopping Cart Settings into E Commerce Settings - Patch to move products in Homepage from Item to Website Item - Minor cleanup, replacing/removing references to Item website fields (obsolete)
This commit is contained in:
@@ -16,12 +16,14 @@ class Homepage(Document):
|
||||
delete_page_cache('home')
|
||||
|
||||
def setup_items(self):
|
||||
for d in frappe.get_all('Item', fields=['name', 'item_name', 'description', 'image'],
|
||||
filters={'published_in_website': 1}, limit=3):
|
||||
for d in frappe.get_all('Website Item', fields=['name', 'item_name', 'description', 'image', 'route'],
|
||||
filters={'published': 1}, limit=3):
|
||||
|
||||
doc = frappe.get_doc('Item', d.name)
|
||||
doc = frappe.get_doc('Website Item', d.name)
|
||||
if not doc.route:
|
||||
# set missing route
|
||||
doc.save()
|
||||
self.append('products', dict(item_code=d.name,
|
||||
item_name=d.item_name, description=d.description, image=d.image))
|
||||
item_name=d.item_name, description=d.description,
|
||||
image=d.image, route=d.route))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user