andrevanzuydam/tina4store

Tina4 Store Module

Maintainers

Package info

github.com/tina4stack/tina4-store

Language:Twig

pkg:composer/andrevanzuydam/tina4store

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-main 2026-03-14 18:23 UTC

This package is auto-updated.

Last update: 2026-03-14 18:25:22 UTC


README

An e-commerce store module for the Tina4 PHP framework. Provides product management, customer accounts, invoicing, and an admin dashboard that integrates with the Tina4 CMS.

Features

  • Product catalog with categories, attributes, images, pricing, and inventory
  • Customer management with addresses, accounts, and authentication
  • Document and ledger system for invoices and transactions
  • Shopping cart
  • Payment gateway integration (Paygate)
  • Admin dashboard with product and customer grids
  • Auto-migrating database schema on first use
  • Registers as a Tina4 CMS menu item under "Store"

Installing

composer require andrevanzuydam/tina4store

Requirements

  • PHP >= 8.1
  • tina4php with routing support
  • tina4-cms
  • A Tina4 database connection (configured in your index.php)

Usage

Add a database connection in your index.php before the store module loads:

require_once "vendor/autoload.php";

global $DBA;
$DBA = new \Tina4\DataSQLite3("store.db");

echo new \Tina4\Tina4Php();

The module auto-registers with Tina4 and runs database migrations on first use. Once loaded, the following routes are available:

Route Description
/store/dashboard Store admin dashboard
/store/dashboard/landing Dashboard landing page
/store/customers Customer management grid
/store/products Product management grid

ORM Objects

The module provides the following ORM objects:

Object Description
Product Products with code, description, cost/retail price, image, quantity
Customer Customer accounts with contact details and authentication
Address Customer addresses
Document Invoices and transaction documents
DocumentDetail Line items for documents
Ledger Financial ledger entries (linked to products and customers)
Cart Shopping cart
ProductCategory Product categories
ProductAttribute Product attributes
ProductImage Product images
Paygate Payment gateway integration

Working with Products

$product = new Product();
$product->productCode = "SKU-001";
$product->description = "Widget";
$product->costPrice = 5.00;
$product->retailPrice = 9.99;
$product->qty = 100;
$product->isActive = 1;
$product->save();

Working with Customers

$customer = new Customer();
$customer->firstName = "Andre";
$customer->lastName = "van Zuydam";
$customer->email = "andre@example.com";
$customer->isActive = 1;
$customer->save();

// Customers have related addresses, documents, and ledger entries
$customer->load("id = 1");
$addresses = $customer->addresses;

License

MIT -- see LICENSE for details.

Our Sponsors

Sponsored with 🩵 by Code Infinity

Code Infinity

Supporting open source communities • Innovate • Code • Empower