Skip to content

Ahmed-Hazem37/Ecommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

E-Commerce System

This is a simple console-based e-commerce system built in Java. It demonstrates the basic structure of an e-commerce application, including managing products, customers, a shopping cart, placing orders, and processing payments.

Features

  • Product Management: Add products with details like product ID, name, price, and category.
  • Shopping Cart: Add or remove products from the shopping cart, view the cart contents, and calculate the total price of the products in the cart.
  • Order Placement: Place an order for a customer using the products in the cart and add it to the customer's order history.
  • Payment Processing: Process payment for the placed order using a specified payment method.
  • Order History: View the customer's previous orders.

Classes Overview

Product

Represents an individual product in the system.

  • Attributes:
    • int productId
    • String name
    • double price
    • String category
  • Methods:
    • void displayProductDetails(): Displays details about the product.

Customer

Represents a customer in the system.

  • Attributes:
    • String name
    • String email
    • List<Order> orderHistory: A list of all the customer's past orders.
  • Methods:
    • void viewOrderHistory(): Displays the customer's order history.
    • void addOrderToHistory(Order order): Adds an order to the customer's history.

ShoppingCart

Represents a shopping cart that holds products for the customer.

  • Attributes:
    • List<Product> products: A list of products in the cart.
  • Methods:
    • void addToCart(Product product): Adds a product to the cart.
    • void removeFromCart(Product product): Removes a product from the cart.
    • double calculateTotal(): Calculates and returns the total price of all products in the cart.
    • void displayCartContents(): Displays all products in the cart.

Order

Represents an order made by the customer.

  • Attributes:
    • Customer customer
    • ShoppingCart cart
  • Methods:
    • void placeOrder(): Places the order for the customer and adds it to the customer's order history.

Payment

Represents the payment process for an order.

  • Attributes:
    • double amount: The total amount for the order.
    • String paymentMethod: The payment method (e.g., Credit Card, PayPal).
  • Methods:
    • void processPayment(Order order): Processes the payment for the order.

How to Run

  1. Clone the repository:
    git clone https://github.com/your-username/ecommerce-system-java.git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages