Skip to content

Add price list and price list items #21

Open
JustShah wants to merge 5 commits into
add-user-groupsfrom
add-price-list-and-price-list-items
Open

Add price list and price list items #21
JustShah wants to merge 5 commits into
add-user-groupsfrom
add-price-list-and-price-list-items

Conversation

@JustShah

@JustShah JustShah commented Apr 9, 2025

Copy link
Copy Markdown

Price List and Price List Items Management

This pull request introduces a complete Price List and Price List Items Management system within the Spree Admin. It enhances the flexibility of product pricing by associating price lists with user groups, managing price list items, and offering an improved admin interface for easier management of pricing strategies.

Key Features:

  1. Add Price List Info on User Group Admin:

    • Added a column to the User Group admin interface to display and select the associated price list for each user group.
    • This feature enhances the ability to manage pricing based on specific user groups, providing a more tailored approach for different customer segments.
  2. Price List Management:

    • Introduced PriceListsController to manage price lists within the admin panel.
    • Implemented form fields for the price list name, country, currency, and tax inclusion.
    • Added functionality to display price details associated with each price list.
    • Improved breadcrumb navigation for a better user experience in the admin panel.
  3. Price List Items Management:

    • Introduced PriceListItemsController to manage price list items.
    • Implemented functionality to associate price list items with specific price lists and product variants.
    • Added support for entering price details, including amount, currency, and taxes.
    • Enhanced breadcrumb navigation in the admin panel for easy access to related views.
  4. Model and Database Changes:

    • Introduced Spree::PriceList model to manage collections of prices associated with specific user groups and countries.
    • Added an optional association for price_list on the user_group model.
    • Created Spree::PriceListItem model to establish relationship between prices and price lists.
    • Updated Spree::Price model to include associations with price lists through price list items.
    • Added a contain_taxes attribute to the Spree::Price model to indicate whether prices include taxes.
    • Added necessary database migrations to create the spree_price_lists and spree_price_list_items tables.

Benefits:

  • Flexible Pricing Strategies: Enables store owners to apply different pricing strategies based on user groups and geographical locations.
  • Improved Admin Interface: Enhancements in the admin interface provide a more efficient way for administrators to manage price lists and user-specific pricing.
  • Better User Group Integration: By associating price lists with user groups, administrators can offer tailored pricing to different segments of users.
  • Comprehensive Price Management: With the addition of price list items and their management, administrators can now have more granular control over pricing details for products.

@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from 01b1912 to 7e0f0de Compare April 9, 2025 12:12
@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from 7e0f0de to 5b84a82 Compare April 9, 2025 12:19
@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from 5b84a82 to a510834 Compare April 10, 2025 09:59
@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from a510834 to d398f23 Compare April 10, 2025 13:26
@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from d398f23 to f973070 Compare April 10, 2025 14:38
@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from f973070 to 38b3f9b Compare April 11, 2025 05:07
- Introduced `Spree::PriceList` model to manage collections of prices associated with specific user groups and countries.
- Added optional association for `price_list` on `user_group`
- Created `Spree::PriceListItem` model to establish a many-to-many relationship between prices and price lists.
- Updated `Spree::Price` model to include associations with price lists through price list items.
- Added `contain_taxes` attribute to the `Spree::Price` model to indicate whether prices include taxes.
- Implemented validations for the new models to ensure data integrity.
- Added necessary database migrations to create price lists and price list items tables.

These changes enhance the pricing structure by allowing for more flexible pricing strategies based on user groups and geographical considerations.
- Introduced PriceListsController to handle price list operations.
- Created views for managing price lists, including:
  - New price list form (`new.html.erb`)
  - Price list edit form (`edit.html.erb`)
  - Price list index view (`index.html.erb`)
  - Partial views for price list form fields and price list information.
- Implemented form fields for name, country, currency, and tax inclusion.
- Added functionality to display price details associated with each price list.
- Included breadcrumb navigation for better user experience in the admin panel.

This feature allows administrators to create, edit, and manage price lists effectively, enhancing the overall product pricing strategy.
- Introduced PriceListItemsController to handle price list item operations.
- Created views for managing price list items, including:
  - New price list item form (`new.html.erb`)
  - Price list item edit form (`edit.html.erb`)
  - Partial view for price list item form fields.
- Implemented functionality to associate price list items with specific price lists and variants.
- Added support for entering price details, including amount, currency and taxes.
- Enhanced breadcrumb navigation for better user experience in the admin panel.

This feature allows administrators to create, edit, and manage price list items, facilitating more flexible pricing strategies for products within the Spree application.
- Updated product sub-menu to include a link to price lists if the user has admin permissions.
- Added routes for managing price lists and their associated price list items.
- Updated backend configuration to include price lists in the admin menu, ensuring proper access control based on user permissions.

These enhancements improve the organization of the admin interface, making it easier for administrators to manage price lists effectively.
This commits adds column on user group to display and select the associated price list
for a user group.
@JustShah JustShah force-pushed the add-price-list-and-price-list-items branch from 38b3f9b to 9de007a Compare April 15, 2025 06:28
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.

1 participant