Skip to content

Comments

Transformation from hardcoded elements to a fully configurable system.#4

Merged
Rl0007 merged 25 commits intoBuildWithHussain:developfrom
EPIUSECX:develop_cohenix
Oct 10, 2025
Merged

Transformation from hardcoded elements to a fully configurable system.#4
Rl0007 merged 25 commits intoBuildWithHussain:developfrom
EPIUSECX:develop_cohenix

Conversation

@Altrix-One
Copy link
Contributor

image image image image

Major Accomplishments:

  • Dynamic Store Branding - Configurable store name, logos, and favicon
  • Comprehensive Color System - 11 different color controls including primary, accent, UI elements, and footer colors
  • Flexible Footer Management - Database-driven footer sections with nested links
  • Contact & Social Media Integration - Configurable contact info and social platform links
  • Email Template System - Automated order confirmations, stock alerts, and cancellations

Technical Implementation:

  • 3 New Doctypes: Footer Section Config, Footer Link, Ecommerce Category
  • 25+ New Fields in Lifestyle Settings across 4 organized tabs
  • CSS Custom Properties system for real-time color changes
  • Template Updates across 8+ files replacing hardcoded classes
  • Migration Scripts with default data population

Key Benefits:

  • No Code Changes Required - Full customization through ERPNext UI
  • Real-time Updates - Changes apply immediately
  • Brand Consistency - Centralized control over all visual elements
  • Maintainable Architecture - Clean separation of configuration and presentation

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.
@NagariaHussain
Copy link
Contributor

Hi 👋

This looks awesome! Can you please add some screenshots or video of the frontend after applying this customisations?

Comment on lines 41 to 45
parent_categories = {
"Engine Parts": "Engine Parts",
"Brake System": "Brake System",
"Interior Accessories": "Interior Accessories"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hard coded, can we make this dynamic too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

image

The rest is already dynamic and can be controlled from the Ecommerce Catergory doctype:
image

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a demo site: https://shopping.cohenix.cloud/

@Altrix-One
Copy link
Contributor Author

Hi 👋

This looks awesome! Can you please add some screenshots or video of the frontend after applying this customisations?

image image image image
enhancments.mp4

@Rl0007
Copy link
Collaborator

Rl0007 commented Oct 7, 2025

Hi @Altrix-One this looks awesome 🌟🌟
We were thinking of doing something similar.. 😅

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..

Screenshot 2025-10-07 at 4 20 23 PM Screenshot 2025-10-07 at 4 20 31 PM Screenshot 2025-10-07 at 4 20 40 PM

Really looking forward to collaborate with you...

@Altrix-One
Copy link
Contributor Author

@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.

@Altrix-One
Copy link
Contributor Author

Hi @Altrix-One this looks awesome 🌟🌟 We were thinking of doing something similar.. 😅

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..

Screenshot 2025-10-07 at 4 20 23 PM Screenshot 2025-10-07 at 4 20 31 PM Screenshot 2025-10-07 at 4 20 40 PM
Really looking forward to collaborate with you...

I have now updated the last few color elements:

image image

@NagariaHussain
Copy link
Contributor

Let's get this merged as soon as the tests pass @Rl0007

@Rl0007
Copy link
Collaborator

Rl0007 commented Oct 8, 2025

@NagariaHussain Updated tests..

@Rl0007
Copy link
Collaborator

Rl0007 commented Oct 9, 2025

@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..

@Altrix-One
Copy link
Contributor Author

take

@Rl0007 Sure ! I am on it !

@Altrix-One
Copy link
Contributor Author

@Rl0007 I have merged with develop, not seeing any issues with Linters. Could you please try again ?

@Altrix-One
Copy link
Contributor Author

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.

@Rl0007
Copy link
Collaborator

Rl0007 commented Oct 9, 2025

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.
@Altrix-One
Copy link
Contributor Author

@Rl0007 I have now fixed all of the Linting, Semgrep and Commit issues. Please see if it passes now.

@Rl0007 Rl0007 merged commit 3575ae9 into BuildWithHussain:develop Oct 10, 2025
2 of 4 checks passed
Rl0007 added a commit that referenced this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants