The aim of the project is to show how the basket works and some rules for the e-commerce site.
Category class represents the product category.
It can include Title, Parent Category, and Child Categories.
Product class represents salable product. It contains the Price, Category and Title fields.
The class used to calculate a shopping cart's delivery cost.
Each delivery keeps unit rates and fixed shipping rates for the item.
Calculates the shipping cost of the cart sent by the CalculateFor method.
It stores the type of discount. A discount can be either on a rate or amount basis.
It is the base abstract discount class. Stores the discount type and amount.
It applies a discount according to the type and amount of
discount it stores to the amount sent with the Apply Discount method.
Returns how much discount will be applied to the amount sent by the Discount By Price method.
Campaigns are discounts that can be applied to categories.
It stores the category, type of discount,
amount of discount and how many products there should be in the basket for this
discount to be applied.
Campaigns are discounts that can be applied to categories.
It stores the category, type of discount, amount of discount and how many
products there should be in the basket for this discount to be applied.
Checks whether the sent campaign or coupon code can be applied to the basket.
It is a shopping cart item. It contains product and quantity information.
Shopping Cart stores Shopping Cart items, Applied coupons, Applied campaigns, per delivery cost, per product cost and fixed shipping cost.
With the AddItem method, it adds the specified product and quantity to the shopping cart as a shopping cart item.
It applies the campaigns or campaigns sent with the ApplyDiscounts method to the basket, if the conditions are met.
ApplyCoupon method applies the coupon sent to the shopping cart, if the conditions are met.
Returns the total discount amount of coupons with GetCouponDiscounts applied.
GetCampaignDiscounts returns the total discount amount of campaigns applied.
GetTotalAmountAfterDiscounts returns the amount after discounts are deducted from the basket total.
Print prints information such as product name, category name, price, and discount for each of the products in the shopping cart.
GetDeliveryCost returns the delivery cost.