Product catalog
Create products with names, prices, descriptions, images, and stock quantities, organised by category.
Shopping cart
Clients add items, adjust quantities, and remove products before proceeding to checkout.
Payment processing
Checkout via PayPal. Orders are confirmed automatically once payment completes.
Order lifecycle
Orders progress from
en cours (pending) through to payé (paid) with full history tracking.Product catalog management
Adding a product
Open the product dashboard
Navigate to Back Office → Products. The table shows all products with inline edit controls.
Fill in product details
Click Add Product and complete the form:
| Field | Rules |
|---|---|
| Name | Maximum 50 characters, required |
| Price | Positive integer, required |
| Description | 20 – 100 characters, required |
| Quantity in stock | Zero or positive integer, required |
| Category | Selected from the product category list |
| Image | Uploaded to /img/produit/ |
Editing and deleting products
- Edit — update any field including replacing the product image. Stock level changes take effect immediately.
- Delete — removes the product record. Products that are currently in a customer’s cart cannot be soft-deleted; clear associated cart items first.
Price filtering
The public store provides a price-range filter. Clients slide a range control to show only products within their budget. The filter queries the catalog in real time without reloading the page.Shopping cart workflow
Browse the store
Clients visit the product listing at
/produit/listeproduit. Products are grouped by category, and a count per category is displayed for quick navigation.Add to cart
On a product’s detail page, the client enters a quantity and clicks Add to Cart. Rakcha checks stock before adding:
- If the requested quantity plus the quantity already in the cart exceeds the available stock, an error flash message is shown and the item is not added.
- If the product is already in the cart, the quantity is incremented rather than creating a duplicate entry.
View and update the cart
The cart page (
/listepanier) lists all items with their quantities and individual prices.- Change quantity — the cart sends an inline update; Rakcha validates the new quantity against current stock before accepting it.
- Remove an item — clicking remove deletes that cart line immediately.
Stock is not reserved at the cart stage. Items are deducted from inventory only when an order is created at checkout.
Checkout and payment processing
Proceed to checkout
From the cart, the client selects the items they want to purchase and clicks Checkout. This creates a new order record with status
en cours and deducts the purchased quantities from each product’s stock.Enter shipping details
The checkout form collects the delivery address and any additional order information before payment.
Pay with PayPal
The client is redirected to PayPal to authorise payment. Rakcha passes the order total and a return URL.
- On success — PayPal redirects back to the platform. Rakcha completes the purchase and updates the order status to
payé. - On cancellation — the client is returned to an error page and the order remains in
en cours. The client can retry payment.
Order management lifecycle
Orders move through the following statuses:| Status | Meaning |
|---|---|
en cours | Order created, awaiting payment |
payé | Payment confirmed by PayPal |
Order items
Each order stores a list ofCommandeItem records, one per product line. Each item captures:
- The linked product
- The quantity ordered at time of purchase
Inventory tracking
Stock levels are managed per product via thequantiteP field. Inventory is updated at two points:
- When an order is created — the quantity ordered is deducted from stock for each product in the cart.
- In the cart — add-to-cart and quantity-update operations check available stock in real time and reject requests that would exceed it.