Hi there.
When accessing a Item’s details in website, the system throws the following error:
Traceback (most recent call last):
File "apps/frappe/frappe/website/render.py", line 49, in render
data = render_page_by_language(path)
File "apps/frappe/frappe/website/render.py", line 178, in render_page_by_language
return render_page(path)
File "apps/frappe/frappe/website/render.py", line 194, in render_page
return build(path)
File "apps/frappe/frappe/website/render.py", line 201, in build
return build_page(path)
File "apps/frappe/frappe/website/render.py", line 216, in build_page
context = get_context(path)
File "apps/frappe/frappe/website/context.py", line 28, in get_context
context = build_context(context)
File "apps/frappe/frappe/website/context.py", line 97, in build_context
ret = context.doc.get_context(context)
File "apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py", line 213, in get_context
self.set_variant_context(context)
File "apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py", line 274, in set_variant_context
if self.slideshow and context.variant and context.variant.slideshow:
AttributeError: 'Item' object has no attribute 'slideshow'
To reproduce the error, follow:
Make sure the “Hide variants” checkbox in E Commerce Setting is checked
Create a template Item (“has variants” checked)
Create some variants
Create a Website Slideshow
Create Website Items for template and variants items created previously (Item > Actions > Publish in Website)
Enter the template’s Website Item and set the slideshow
A workaround is to edit the frappe-bench/apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py, line 274:
context.variant.slideshow = self.slideshow
if self.slideshow and context.variant and context.variant.slideshow:
context.update(get_slideshow(context.variant))
That is, just set the slideshow in context.variant.slideshow, because the get_slideshow function tries to get the slideshow field but the context.variant is a Item doctype and it does not have a slideshow field, so just use the Website Item’s slideshow.
This solve my problem for the moment. But surely it wouldn’t work for all cases.
The presented workaround assumes that you can make changes in the code. AFAIK, this is not possible in frappe cloud.
Possible solution: Try to create a custom field in the Item doctype, via Customize Form. The name of this field should be slideshow, type=Link, options: ‘Website Slideshow’. After you create this field, you should set the slideshow for each Item that you want to be showed in the website.
I didn’t try this approach. So, let me know if this works.
I have used this and worked for me. The problem I am still experiencing is that my thumbnails keep crashing. Initially, they work, but after some seconds they disappear. Any idea what this could be?
I could narrow the problem down. Apparently, it is a Browser problem. With Apple Safari I couldnt get it to work. With Chrome and Firefox, it worked without any problems.