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:
marination
2021-02-23 14:06:38 +05:30
parent 333d08f459
commit d93e3a32da
12 changed files with 143 additions and 16 deletions

View File

@@ -14,13 +14,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))