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.
- 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.
Represents an individual product in the system.
- Attributes:
int productId
String name
double price
String category
- Methods:
void displayProductDetails()
: Displays details about the product.
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.
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.
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.
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.
- Clone the repository:
git clone https://github.com/your-username/ecommerce-system-java.git