PawsPals is a complete pet shop e-commerce web application with user authentication, shopping cart functionality, and customer management system.
✅ Product catalog with multiple pet categories ✅ Shopping cart with persistent storage (LocalStorage) ✅ User registration with store and pet preference selection ✅ Customer feedback collection ✅ User login system ✅ Order management ✅ Responsive design for all devices ✅ Database storage for user data and orders
CA2 project/
├── index.html # Main shop page
├── Form.html # Registration page
├── login.html # Login page
├── cart.html # Shopping cart page
├── style.css # Main shop styles
├── style1.css # Registration form styles
├── style2.css # Login form styles
├── style3.css # Cart page styles
├── main.js # Frontend JavaScript (cart, forms)
├── backend.php # Backend PHP (database operations)
├── database.sql # Database schema
└── README.md # This file
- Open phpMyAdmin or MySQL command line
- Run the
database.sqlfile to create the database and tables:Or copy-paste the entire content ofSOURCE database.sql;
database.sql
- Open
backend.php - Update database credentials if needed:
$servername = "localhost"; // Your MySQL server $username = "root"; // Your MySQL username $password = ""; // Your MySQL password $dbname = "pawspals"; // Database name
- Copy all files to your web server directory:
- XAMPP:
C:\xampp\htdocs\pawspals\ - WAMP:
C:\wamp\www\pawspals\ - LAMP:
/var/www/html/pawspals/
- XAMPP:
- Start Apache and MySQL from XAMPP/WAMP Control Panel
- Open browser:
http://localhost/pawspals/index.html
1. Browse Products
- Visit the main shop (index.html)
- Click on categories or search products
- Click "Add to Cart" to add items
2. View Cart
- Click "Cart (0)" in header to view shopping cart
- Adjust quantities or remove items
- See real-time total calculation
3. Register
- Click "Registration Form" button
- Fill in details including:
- Full name, email, gender, DOB
- Preferred Store Location (new!)
- Pet Preference (new!)
- Feedback & Requirements (new!)
- Account created successfully
4. Login
- Click "Login" button
- Enter email and password
- Check "Remember me" option to stay logged in
5. Checkout
- Must be logged in
- Click "Proceed to Checkout" in cart
- Order is placed and stored in database
customers
- Stores user registration data
- Includes: name, email, password, gender, DOB, preferred_store, pet_preference, feedback
products
- Product catalog
- Includes: name, category, price, description, image, stock
orders
- Customer orders
- Includes: customer_id, total_amount, status, payment_status
order_items
- Individual items in orders
- Links orders to products
cart
- Persistent cart storage (optional)
User clicks "Add to Cart" → main.js captures product data →
Stored in browser's LocalStorage → Cart count updates →
User navigates to cart.html → main.js displays saved items
User fills form → Clicks "Register Now" → main.js validates →
Sends to backend.php → PHP validates and inserts to database →
Success message → Redirects to login.html
User enters credentials → backend.php verifies →
User stored in localStorage → User can checkout →
Order saved to database → Cart cleared
-
Preferred Store Location
- 6 store options across India
- Helps with targeted marketing
-
Pet Preference Selection
- Dogs, Cats, Birds, Fish, Small Pets, All Pets
- Used for personalized recommendations
-
Feedback & Requirements
- TextArea for customer feedback
- Collects improvement suggestions
- Captures new pet care needs
- Add/remove products
- Update quantities
- Real-time cart count
- Persistent storage (survives page refresh)
- Automatic total calculation with tax & shipping
Email: john@example.com
Password: (Use DOB from database)
Email: sarah@example.com
Password: (Use DOB from database)
Or create new account via registration form.
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Backend: PHP 7+
- Database: MySQL / MariaDB
- Storage: Browser LocalStorage (cart), Database (orders)
Problem: Cart not updating
- Clear browser cache
- Check localStorage in DevTools
Problem: Registration not working
- Ensure database.sql was executed
- Check database connection in backend.php
- Verify email format
Problem: Login fails
- Ensure backend.php is accessible
- Check database connection
- Verify credentials in customers table
Problem: Checkout button not working
- Must be logged in
- Check if cart has items
- Check backend.php permissions
- Security: For production, implement proper password hashing, CSRF tokens, and prepared statements
- Testing: Use browser DevTools Console to check for errors
- Mobile: All pages are fully responsive
- Compatibility: Works on all modern browsers
Add Payment Gateway:
- Integrate Razorpay or PayPal in checkout section
Email Notifications:
- Add PHPMailer for order confirmations
Admin Panel:
- Create admin dashboard for order management
Search Functionality:
- Add product search with filters
For issues or questions, check:
- Browser console (F12 → Console)
- Network tab for failed requests
- PHP error logs
- Database logs
Created: January 2025 Version: 1.0 Status: Active Development
🐾 Happy Pet Shopping! 🐾