Transformation from hardcoded elements to a fully configurable system.#4
Conversation
Missing Required Custom Fields Added custom_displayname and custom_item_group_display_name to all Item Group creations Missing Root Item Group Created get_root_item_group() function to dynamically find or create the root Root Item Group Also Missing Custom Fields Updated root Item Group creation (lines 84-85) to include both required fields
Issue: Products list page crashed with IndexError: list index out of range when no brands exist. Fixed in list.py: Changed if not brands[0]: to if not brands: (line 27) Added filter to remove None/empty brand values: brands = [b.title() for b in brands if b] (line 29) This prevents the error when: No products have brands assigned Brand field is empty/None Fresh installation with no products yet The landing page should now load correctly even without any products or brands in the system.
|
Hi 👋 This looks awesome! Can you please add some screenshots or video of the frontend after applying this customisations? |
ls_shop/migrate.py
Outdated
| parent_categories = { | ||
| "Engine Parts": "Engine Parts", | ||
| "Brake System": "Brake System", | ||
| "Interior Accessories": "Interior Accessories" | ||
| } |
There was a problem hiding this comment.
This is hard coded, can we make this dynamic too?
There was a problem hiding this comment.
I have updated the migrate.py to remove the hardcoded elements, and also added it to the demo data script that can be installed from the Lifestyle Settings:
The rest is already dynamic and can be controlled from the Ecommerce Catergory doctype:

Footers and Sections is also Dynamic now and can be controlled from the Footer Section Config:


There was a problem hiding this comment.
Here is a demo site: https://shopping.cohenix.cloud/
|
Hi @Altrix-One this looks awesome 🌟🌟 I am going through your demo site, can you please setup your email account and also share some test credentials. So I can checkout the complete flow till payment.. I also noticed some places where the colours are not dynamic. Can you also take a look into that..
Really looking forward to collaborate with you... |
|
@Rl0007 Sounds good ! I have made some changes and have not updated the site for the final elements which were not dynamic. Will update that and let you know. I did not make ant changes to the default workflow or files related to that. |
I have now updated the last few color elements:
|
|
Let's get this merged as soon as the tests pass @Rl0007 |
|
@NagariaHussain Updated tests.. |
|
@Altrix-One I tried to push commits into your PR but some reason I am not able to. Can you please take a merge of develop and fix your CI, Linters. Thanks.. |
@Rl0007 Sure ! I am on it ! |
|
@Rl0007 I have merged with develop, not seeing any issues with Linters. Could you please try again ? |
8e6d06c to
5f604a1
Compare
3b051cb to
d21ca8c
Compare
|
Good day @Rl0007 I see the linters issue was caused by commit messages, I have fixed the last 4 and it should work now. If not I will fix the rest. |
Ok.. |
- Updated import statements in lifestyle_settings.py for better formatting. - Cleaned up whitespace and formatting in various methods of lifestyle_settings.py. - Enhanced error logging in migrate.py for better clarity on exceptions. - Streamlined email template creation logic in migrate.py. - Improved item publishing logic in publish_demo_items.py with consistent formatting. - Removed unnecessary whitespace and improved readability in product listing logic in list.py.
|
@Rl0007 I have now fixed all of the Linting, Semgrep and Commit issues. Please see if it passes now. |












Major Accomplishments:
Technical Implementation:
Key Benefits: