MediStock Commerce

Medical Equipment E-commerce & Inventory Management System

Complete installation, administration, customization and product-use guide.

1. Product Overview

MediStock Commerce is a PHP/MySQL commerce platform for healthcare-product sellers. It combines a public catalogue and checkout experience with product, order, inventory, customer, invoice, CMS, SEO, coupon, tax, shipping and reporting tools in one administration area.

What can be sold with this script?

Examples include patient monitors, ultrasound systems, imaging equipment, operating tables and lights, ventilators, sterilizers, diagnostic analyzers, dental units, examination equipment, hospital beds, trolleys, wheelchairs, surgical kits, PPE and disposable medical supplies. Product availability, specifications, certifications and regulatory suitability must always be verified by the seller/manufacturer before clinical use.

2. Industries & Business Models

3. Frontend Features

4. Order Management

Orders can be created from the customer checkout or from the administration order screen. Each order stores customer details, line items, pricing, discount, tax, shipping, payment and delivery information.

Order statuses

Pending, Processing, Paid, Shipped, Completed and Cancelled are supported by the order workflow.

Status history

The application records status changes in order_status_history, allowing administrators and customers to see the progression of an order.

Customer tracking

The public tracking page validates the order number together with the customer's email address before displaying order information and status history.

5. Automated Order / Purchase Slip

When an order is created, the application can generate a PDF order slip automatically. The order-slip workflow can email the generated PDF to the customer and active administrators when SMTP is configured.

For a production installation, configure SMTP in the admin settings and verify your sender/domain authentication.

6. Invoices

7. Inventory & Stock

The inventory module records stock movements rather than relying only on a single quantity field.

MovementTypical use
OpeningInitial stock when setting up a product.
PurchaseReceiving stock from a supplier.
SaleStock consumed by an order.
ReturnCustomer return received back into inventory.
AdjustmentManual stock correction.
DamageDamaged or written-off stock.
TransferStock transfer or location adjustment.

Low-stock thresholds, stock status, stock quantity, backorders and variation-level inventory are supported by the product model.

8. Products, Brands & Attributes

9. Coupons

The coupon engine supports percentage and fixed discounts, minimum spend, maximum discount, usage limits, start/end dates, product/category inclusion and product/category exclusions.

Demo coupons are included in the database: WELCOME10, SAVE50 and MEDI20.

10. Tax & Shipping

11. Payments

The application contains payment-method configuration and Stripe integration hooks. Stripe is disabled in the demo database for safety.

To enable Stripe, configure the test or live publishable key, secret key and webhook secret in the application's settings. Never publish live payment secrets in source code or documentation.

12. Customer Management

13. Admin Dashboard & Management

14. Reports

The reports module provides date/product/category/salesperson-oriented reporting with sales, tax, revenue, cost and gross-profit information where the underlying product/order data is available. CSV export and browser print/save-to-PDF workflows are included.

15. CMS & SEO

16. Roles & Permissions

The database contains role definitions for administrator, ecommerce manager and sales person. The admin permission layer controls access to management areas such as orders, inventory and users.

17. Installation

Step 1 — Hosting

Use Apache or compatible hosting with PHP 8.1+ and MySQL/MariaDB.

Step 2 — Database

Create a database, for example medistock_commerce, and import database.sql.

Step 3 — Configuration

Edit config/config.php:

const SITE_NAME = 'MediStock Commerce';
const BASE_URL = 'https://www.yourdomain.com';
const DB_HOST = 'localhost';
const DB_NAME = 'medistock_commerce';
const DB_USER = 'your_database_user';
const DB_PASS = 'your_database_password';

Step 4 — Permissions

Make uploads/ and its writable subdirectories available to the PHP process.

Step 5 — Login

Open /admin/login.php and use the demo administrator credentials shown in the README. Change the password after login.

Step 6 — Settings

Configure your company identity, SMTP, Stripe, tax, shipping and payment methods before production use.

18. Demo Database

The supplied database intentionally uses fictional administrator/customer information and example.com email addresses. It includes catalogue data, categories, brands, attributes, variations, demo orders, order history, invoices, inventory movements, coupons, tax and shipping configuration.

Demo admin: admin@example.com / Admin@123
Demo customer: demo.customer@example.com / Customer@123

19. Customization

20. Security & Production Checklist

This software is a commerce and inventory platform. It does not certify, approve or validate medical devices, clinical claims or regulatory compliance.

21. Third-Party Libraries

The project includes Composer-managed libraries for PDF generation, email delivery and Stripe payment integration. See composer.json, composer.lock and the relevant package license files inside vendor/ for exact versions and licensing information.

22. Support & Troubleshooting

500 Internal Server Error

Check the hosting PHP error log. Confirm PHP 8.1+ and the required extensions are enabled.

Database connection error

Verify the five database constants in config/config.php.

Images not uploading

Check PHP upload limits and write permissions on the uploads directories.

Emails not sending

Enable SMTP and enter valid SMTP credentials in Settings; check email_logs for delivery results.

Clean URLs not working

Ensure Apache rewrite support is enabled and the supplied .htaccess file is present.

23. Product Positioning for Code Marketplace

Suggested marketplace title: MediStock Commerce – Medical Equipment E-commerce & Inventory Management System.

Suggested positioning: a ready-to-customize PHP/MySQL platform for medical equipment distributors, healthcare suppliers, clinics, laboratories and related B2B/B2C sellers that need catalogue, ordering, inventory, invoices, customer accounts and administration in one application.