# Phase 5 — Marketplace-wide product discovery

## What changed
- New public route: `/products`.
- Keyword search over product name/description, business name and town.
- Filters: category, county, town, estate, minimum price and maximum price.
- Sorting: best match, newest, price low-to-high, price high-to-low and name A–Z.
- Server-side pagination (12 products per page) with filters preserved between pages.
- Homepage and customer dashboard link to the product marketplace.
- Only published/available products from approved, published businesses with active owners are discoverable.
- Uses prepared SQL statements and validated filter values.

## Installation
1. Back up your current `bizmtaani` folder and database.
2. Extract this package to a temporary folder. Merge its `bizmtaani` contents into `C:\xampp\htdocs\bizmtaani`, keeping your `.env`, uploaded images, private storage and keys.
3. No migration is required for Phase 5. Existing Phase 4 migrations remain unchanged.
4. Start Apache and MySQL, then open `http://localhost/bizmtaani/products`.

## Acceptance tests
- Open `/products` logged out and confirm public discovery works.
- Search by product name and seller name.
- Apply category, county, town and estate filters independently and together.
- Test min/max price and reversed min/max values.
- Test each sort mode and paginate while preserving filters.
- Confirm unpublished products and products from unapproved businesses do not appear.
- Confirm a product links to its seller business page, where existing ordering/cart flow remains.

## Scope notes
Product orders continue to be arranged directly with sellers; Phase 5 does not add online payments, delivery integrations, or new database tables. Test on the actual XAMPP database before production deployment.
