Skip to content

Enable Teachers to Create and Sell Merchandise on the Platform (Feature #65)#68

Merged
A1L13N merged 20 commits into
alphaonelabs:mainfrom
Satyamkumarnavneet:feature/enable-teachers-to-sell-merchandise-65
Mar 7, 2025
Merged

Enable Teachers to Create and Sell Merchandise on the Platform (Feature #65)#68
A1L13N merged 20 commits into
alphaonelabs:mainfrom
Satyamkumarnavneet:feature/enable-teachers-to-sell-merchandise-65

Conversation

@Satyamkumarnavneet
Copy link
Copy Markdown
Contributor

This PR adds functionality #65 for teachers to sell merchandise on the platform. Key updates include:

  • Storefront: Customizable storefronts for teachers.
  • Product Listings: Add, edit, and manage products (e.g., books, apparel).
  • Payment Integration: Stripe/PayPal for secure transactions.
  • Order Management: Track and manage orders.
  • Analytics Dashboard: Insights into sales and customer engagement.

Copy link
Copy Markdown
Contributor

@A1L13N A1L13N left a comment

Choose a reason for hiding this comment

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

It would be good to use the existing cart so students can register for a course or session as well as purchase goods in one checkout. Detect if there are goods in the cart and show an address form if so. Also we can remove the separate return and privacy policies and have one for all storefronts on the site. Can also remove PayPal for now since we don't have that setup. Hopefully this will reduce some code. It looks amazing though. I can't wait to have it live.

@Satyamkumarnavneet
Copy link
Copy Markdown
Contributor Author

It would be good to use the existing cart so students can register for a course or session as well as purchase goods in one checkout. Detect if there are goods in the cart and show an address form if so. Also we can remove the separate return and privacy policies and have one for all storefronts on the site. Can also remove PayPal for now since we don't have that setup. Hopefully this will reduce some code. It looks amazing though. I can't wait to have it live.

Thanks for the feedback! I'll combine the checkout, update the policies, and remove PayPal for now.

Copy link
Copy Markdown
Contributor

@A1L13N A1L13N left a comment

Choose a reason for hiding this comment

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

LGTM!

@A1L13N A1L13N merged commit 795b515 into alphaonelabs:main Mar 7, 2025
@Satyamkumarnavneet
Copy link
Copy Markdown
Contributor Author

Pull Request Summary:

This pull request introduces a comprehensive e-commerce feature to the education platform, enabling teachers to create storefronts, list and sell merchandise (both physical and digital), manage orders, and track sales analytics. It seamlessly integrates with the existing educational framework, including the cart and checkout systems, while maintaining platform consistency and security.

Key Features Introduced

1. Storefront Creation and Management

  • Teachers can create and manage a single storefront linked to their profile.
  • Storefront attributes include:
    • Customizable name, description, logo, and banner.
    • Unique, URL-friendly slug for storefront URLs.
    • Active/inactive toggle for public visibility.
  • Intuitive forms with validation ensure proper setup and updates.

2. Merchandise Management

  • Supports two product types:
    • Physical Products: Requires stock tracking and shipping details.
    • Digital Products: Requires file uploads for downloadable content.
  • Product fields include:
    • Name, description, price, discount price, stock, category, and up to 8 images.
  • Teachers can create, update, and delete listings with strict ownership restrictions.
  • Validation ensures proper product type rules (e.g., digital products cannot have stock).

3. Product Creation Workflow

  • Teachers can easily create new products through an intuitive form:
    • Dynamic form fields based on product type (e.g., stock for physical, file upload for digital).
    • Real-time validation for pricing, stock, and file uploads.
    • Image upload with preview and deletion functionality.
  • Product creation success page with options to add more products or manage existing ones.

4. Store Settings and Customization

  • Teachers can customize their storefront settings:
    • Update store name, description, logo, and banner.
    • Modify store policies (e.g., refund, privacy).
    • Toggle store visibility (active/inactive).
  • Changes are reflected in real-time on the storefront.

5. Preview Store

  • Teachers can preview their storefront before making it public.
  • Preview mode shows exactly how the store will appear to students.
  • Includes product listings, store branding, and policies.

6. Cart and Checkout Enhancements

  • The existing cart system is extended to include merchandise alongside courses and sessions.
  • Enhanced checkout process:
    • Collects shipping addresses for physical goods.
    • Integrates with Stripe for secure payment processing.
    • Creates Order objects with detailed status tracking (e.g., draft, pending, shipped, completed).
  • Guest checkout support for non-registered users.

7. Order Management

  • Teachers can view and manage orders for their storefront.
  • Key features:
    • Status updates (e.g., processing to shipped).
    • Tracking number assignment for physical goods.
    • Pagination and filtering by status for easy navigation.
  • Students can view their order history and track shipments.

8. Analytics and Reporting

  • Teacher Dashboard:
    • Total revenue, order count, and top-selling products.
    • Interactive charts using Chart.js for visual insights.
    • Real-time updates via JavaScript for dynamic data display.
  • Admin Dashboard:
    • Platform-wide sales, revenue, and top-performing storefronts.
    • Comprehensive metrics for monitoring overall platform performance.

Technical Highlights

Database

  • New models introduced:
    • Storefront: Represents a teacher's store.
    • Goods: Represents products with physical/digital variants.
    • Order: Tracks purchases and order status.
    • ProductImage: Supports multiple images per product.
  • Relationships ensure proper ownership and tracking (e.g., Goods belongs to Storefront, Order belongs to User).

Validation

  • Enforces product type rules (e.g., digital products cannot have stock).
  • Ensures discount prices are lower than base prices.
  • Validates file uploads for digital products and image constraints (e.g., max 8 images, 5MB each).

UI/UX

  • Responsive design using Tailwind CSS for seamless user experience across devices.
  • Interactive charts and dashboards powered by Chart.js.
  • Intuitive forms and workflows for teachers and students.

Security

  • Ownership checks via UserPassesTestMixin to ensure teachers can only manage their own storefronts and products.
  • Login-required decorators for sensitive actions (e.g., order management, analytics).
  • GDPR-compliant data handling for user privacy.

Integration

  • Extends the existing cart and checkout system to support merchandise.
  • Integrates with Stripe for secure payment processing.
  • Supports guest checkout for non-registered users.

@Satyamkumarnavneet Satyamkumarnavneet deleted the feature/enable-teachers-to-sell-merchandise-65 branch March 12, 2025 06:46
Inshamhaque pushed a commit to Inshamhaque/education-website that referenced this pull request Mar 16, 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.

2 participants