Misc fixes: cleanup templates and supporting updates

This commit is contained in:
Dwindi Ramadhana
2026-06-02 00:39:27 +07:00
parent df969b442d
commit dcdd6d8cac
6 changed files with 102 additions and 417 deletions

View File

@@ -1,6 +1,6 @@
# WooNooW Feature Roadmap - 2025
**Last Updated**: December 31, 2025
**Last Updated**: June 1, 2026
**Status**: Active Development
This document outlines the comprehensive feature roadmap for WooNooW, building upon existing infrastructure.
@@ -301,66 +301,59 @@ class AffiliateTracker {
### Overview
Recurring product subscriptions with flexible billing cycles.
### Status: **Planning** 🔵
### Status: **Shipped**
### What's Already Built
- ✅ Product management
- ✅ Order system
- ✅ Payment gateways
- ✅ Notification system
- ✅ Database tables (`wp_woonoow_subscriptions`, `wp_woonoow_subscription_orders`) — schema below reflects actual shipped columns
- ✅ Per-gateway auto-renew capability table (kill-switchable)
- ✅ Pause/resume/cancel/early-renew customer UI
- ✅ Admin list with bulk actions, search, and per-status filter
- ✅ Renewal cron (`process_renewals`, `check_expirations`, `send_reminders`, `retry_unpaid_renewals`)
### What's Needed
### Schema (as shipped)
#### 1. Database Tables
```sql
wp_woonoow_subscriptions (id, customer_id, product_id, status, billing_period, billing_interval, price, next_payment_date, start_date, end_date, trial_end_date)
wp_woonoow_subscription_orders (id, subscription_id, order_id, payment_status, created_at)
wp_woonoow_subscriptions (
id, user_id, order_id, product_id, variation_id, status,
billing_period, billing_interval, recurring_amount,
start_date, trial_end_date, next_payment_date, end_date, last_payment_date,
payment_method, payment_meta, cancel_reason,
pause_count, failed_payment_count, reminder_sent_at
)
wp_woonoow_subscription_orders (
id, subscription_id, order_id, order_type ENUM 'parent'|'renewal'|'switch'|'resubscribe'
)
```
#### 2. Product Meta
Add subscription options to product:
- Is subscription product (checkbox)
- Billing period (daily, weekly, monthly, yearly)
- Billing interval (e.g., 2 for every 2 months)
- Trial period (days)
Note: the column is `user_id`, not `customer_id` — the original spec used the
WC-style "customer" naming, but WP schema reserves `customer` for the legacy
WP customer user role and the column was renamed before the first migration
shipped.
#### 3. Renewal System
```php
class SubscriptionRenewal {
// WP-Cron daily job
public function process_renewals() {
$due_subscriptions = $this->get_due_subscriptions();
foreach ($due_subscriptions as $subscription) {
// Create renewal order
// Process payment
// Update next payment date
// Send notification
}
}
}
```
#### 4. Customer Dashboard
### Customer Dashboard
**Route**: `/account/subscriptions`
- Active subscriptions list
- Pause/resume subscription
- Pause/resume subscription (capped at `max_pause_count` setting, default 3)
- Cancel subscription
- Update payment method
- View billing history
- Change billing cycle
#### 5. Admin UI
**Route**: `/products/subscriptions`
- All subscriptions list
- Filter by status
- View subscription details
- Manual renewal
### Admin UI
**Route**: `/subscriptions`
- All subscriptions list with checkbox + bulk actions (cancel, CSV export)
- Free-text search by id / email / display name
- Per-status filter
- View subscription details (per-gateway auto-renew badge, pause count)
- Renew Now (creates manual order) or Charge Now (forces auto-debit, M2)
- Cancel/refund
### Priority: **Low** 🟢
### Effort: 4-5 weeks
### Priority: ~~Low~~ Shipped ✅
### Effort: ~~4-5 weeks~~ Shipped
---