From 7a0c6f56c8b715ae1fcb405ff457c827207b03c7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 23:16:07 +0000 Subject: [PATCH] Complete demo data with VirtueMart, MembershipPro, and Dolibarr --- data/demo/dolibarr/README.md | 256 +++++++++++++++++++++ data/demo/dolibarr/integration-config.sql | 153 ++++++++++++ data/demo/membershippro/README.md | 161 +++++++++++++ data/demo/membershippro/sample-data.sql | 160 +++++++++++++ data/demo/virtuemart/custom-fields.sql | 103 +++++++++ data/demo/virtuemart/featured-products.sql | 21 ++ data/demo/virtuemart/manufacturers.sql | 40 ++++ data/demo/virtuemart/product-variants.sql | 58 +++++ data/demo/virtuemart/stock-management.sql | 36 +++ 9 files changed, 988 insertions(+) create mode 100644 data/demo/dolibarr/README.md create mode 100644 data/demo/dolibarr/integration-config.sql create mode 100644 data/demo/membershippro/README.md create mode 100644 data/demo/membershippro/sample-data.sql create mode 100644 data/demo/virtuemart/custom-fields.sql create mode 100644 data/demo/virtuemart/featured-products.sql create mode 100644 data/demo/virtuemart/manufacturers.sql create mode 100644 data/demo/virtuemart/product-variants.sql create mode 100644 data/demo/virtuemart/stock-management.sql diff --git a/data/demo/dolibarr/README.md b/data/demo/dolibarr/README.md new file mode 100644 index 0000000..c97537a --- /dev/null +++ b/data/demo/dolibarr/README.md @@ -0,0 +1,256 @@ +# Dolibarr Integration Sample Data + +This directory contains sample configuration and data mapping for integrating Joomla/VirtueMart with Dolibarr ERP/CRM. + +## Contents + +- `integration-config.sql` - Sample Dolibarr integration configuration +- `README.md` - This file + +## Overview + +Dolibarr is an open-source ERP and CRM system. This integration allows you to: +- Sync customers between Joomla and Dolibarr +- Sync products and orders from VirtueMart to Dolibarr +- Manage invoices and accounting +- Track inventory across systems + +## Prerequisites + +1. **Dolibarr** installed (14.x or later) +2. **Dolibarr API** enabled with API key +3. **VirtueMart** installed in Joomla +4. **Joomla-Dolibarr connector plugin** or custom integration + +## Integration Methods + +### Option 1: REST API Integration +Connect Joomla to Dolibarr using REST API: +- Real-time synchronization +- Bidirectional data flow +- Event-driven updates + +### Option 2: Database Integration +Direct database connection (not recommended for production): +- Fast data sync +- Complex queries +- Security considerations + +### Option 3: File-Based Integration +CSV export/import: +- Scheduled batch sync +- Manual control +- No real-time updates + +## What Gets Configured + +### API Connection +- Dolibarr URL +- API key/token +- Authentication method +- SSL/TLS settings + +### Data Mapping +- Customer fields +- Product fields +- Order fields +- Tax codes +- Payment methods +- Shipping methods + +### Sync Rules +- Sync direction (one-way or bidirectional) +- Sync frequency +- Conflict resolution +- Error handling + +## Installation + +### Step 1: Configure Dolibarr API + +1. Log into Dolibarr admin +2. Go to Setup > Modules +3. Enable "Web services" module +4. Go to Home > Setup > Security +5. Generate API key for integration user + +### Step 2: Import Configuration + +```bash +# Import SQL configuration +mysql -u username -p database_name < integration-config.sql +``` + +### Step 3: Install Connector Plugin + +Install a Joomla-Dolibarr connector plugin: +- Search Joomla Extensions Directory +- Or develop custom integration + +### Step 4: Configure Mapping + +Configure field mapping in plugin settings: +- Map Joomla user fields to Dolibarr contacts +- Map VirtueMart products to Dolibarr products +- Map order statuses + +## Data Flow + +### Customer Sync +``` +Joomla User Registration + ↓ +Create/Update Dolibarr Contact (Third Party) + ↓ +Sync custom fields + ↓ +Assign to customer group +``` + +### Order Sync +``` +VirtueMart Order Placed + ↓ +Create Dolibarr Order + ↓ +Create Invoice (when paid) + ↓ +Update Stock Levels + ↓ +Create Shipment +``` + +### Product Sync +``` +VirtueMart Product Created/Updated + ↓ +Sync to Dolibarr Product + ↓ +Update pricing + ↓ +Sync stock levels +``` + +## Sample Mappings + +### Customer Fields +| Joomla/VirtueMart | Dolibarr | +|-------------------|----------| +| name | nom (lastname) | +| email | email | +| username | ref_ext | +| company | client.nom | +| address | address | +| city | town | +| state | state | +| zip | zip | +| country | country_code | +| phone | phone | + +### Product Fields +| VirtueMart | Dolibarr | +|------------|----------| +| product_name | label | +| product_sku | ref | +| product_desc | description | +| product_price | price | +| product_weight | weight | +| product_in_stock | stock_reel | +| virtuemart_product_id | ref_ext | + +### Order Status Mapping +| VirtueMart Status | Dolibarr Status | +|-------------------|-----------------| +| Pending | Draft | +| Confirmed | Validated | +| Shipped | Closed (delivered) | +| Cancelled | Cancelled | +| Refunded | Cancelled (refunded) | + +## Configuration Options + +### API Settings +```php +// Sample configuration +$dolibarr_url = 'https://your-dolibarr-domain.com'; +$dolibarr_api_key = 'your-api-key-here'; +$sync_enabled = true; +$sync_direction = 'bidirectional'; // or 'joomla_to_dolibarr', 'dolibarr_to_joomla' +$sync_interval = 300; // seconds (5 minutes) +``` + +### Sync Settings +- Auto-sync on create/update +- Manual sync button +- Scheduled cron sync +- Real-time webhook sync + +## Testing Integration + +1. **Test Customer Sync** + - Create test user in Joomla + - Verify creation in Dolibarr + - Update user details + - Verify sync + +2. **Test Product Sync** + - Create test product in VirtueMart + - Verify in Dolibarr products + - Update price/stock + - Verify sync + +3. **Test Order Flow** + - Place test order in VirtueMart + - Verify order in Dolibarr + - Update order status + - Verify invoice creation + +## Troubleshooting + +**API Connection Fails** +- Verify API is enabled in Dolibarr +- Check API key is valid +- Verify SSL certificate +- Check firewall rules + +**Data Not Syncing** +- Check sync logs +- Verify field mapping +- Check API permissions +- Test API endpoints manually + +**Duplicate Records** +- Check unique identifier mapping +- Verify conflict resolution rules +- Review sync logs + +## Security Considerations + +- Use HTTPS/SSL for all API calls +- Rotate API keys regularly +- Limit API permissions to necessary operations +- Log all sync activities +- Monitor for unusual activity +- Backup before major syncs + +## Support Resources + +- Dolibarr Documentation: https://www.dolibarr.org/documentation +- Dolibarr API Docs: https://wiki.dolibarr.org/index.php/API +- Dolibarr Forum: https://www.dolibarr.org/forum +- Joomla Forums: https://forum.joomla.org +- Moko Consulting: hello@mokoconsulting.tech + +## Notes + +- This is sample configuration data +- Actual implementation requires custom development or plugin +- Always test in staging environment first +- Monitor sync performance and errors +- Plan for data migration and cleanup + +## Version + +Version: 1.0.0 +Last Updated: 2026-01-29 +Compatible with: Dolibarr 14.x+, Joomla 4.x/5.x diff --git a/data/demo/dolibarr/integration-config.sql b/data/demo/dolibarr/integration-config.sql new file mode 100644 index 0000000..7f2ac7c --- /dev/null +++ b/data/demo/dolibarr/integration-config.sql @@ -0,0 +1,153 @@ +-- Dolibarr Integration Configuration +-- Version: 1.0.0 +-- Sample configuration for Joomla-Dolibarr integration +-- NOTE: This is reference data - actual integration requires custom plugin/development + +-- Configuration table (example - actual implementation varies) +CREATE TABLE IF NOT EXISTS `#__dolibarr_config` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `config_key` varchar(255) NOT NULL, + `config_value` text, + `description` text, + PRIMARY KEY (`id`), + UNIQUE KEY `config_key` (`config_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- API Connection Settings +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('dolibarr_url', 'https://erp.example.com', 'Base URL of Dolibarr installation'), +('dolibarr_api_key', '', 'API key for authentication - SET THIS'), +('api_enabled', '1', 'Enable/disable API integration'), +('api_timeout', '30', 'API request timeout in seconds'), +('verify_ssl', '1', 'Verify SSL certificates'), +('sync_enabled', '1', 'Enable automatic synchronization'), +('sync_direction', 'bidirectional', 'Sync direction: joomla_to_dolibarr, dolibarr_to_joomla, bidirectional'), +('sync_interval', '300', 'Sync interval in seconds (5 minutes)'), +('log_enabled', '1', 'Enable sync logging'), +('log_level', 'info', 'Log level: debug, info, warning, error'); + +-- Customer/Contact Field Mapping +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('map_customer_enabled', '1', 'Enable customer sync'), +('map_customer_name', 'name|nom', 'Map Joomla name to Dolibarr nom'), +('map_customer_email', 'email|email', 'Map email field'), +('map_customer_phone', 'phone|phone', 'Map phone field'), +('map_customer_company', 'company|client.nom', 'Map company name'), +('map_customer_address', 'address_1|address', 'Map address field'), +('map_customer_city', 'city|town', 'Map city field'), +('map_customer_state', 'state|state', 'Map state/province'), +('map_customer_zip', 'zip|zip', 'Map postal code'), +('map_customer_country', 'country_code|country_code', 'Map country code'), +('map_customer_ref', 'id|ref_ext', 'Map Joomla user ID to Dolibarr external reference'); + +-- Product Field Mapping +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('map_product_enabled', '1', 'Enable product sync'), +('map_product_name', 'product_name|label', 'Map product name'), +('map_product_sku', 'product_sku|ref', 'Map product SKU/reference'), +('map_product_desc', 'product_desc|description', 'Map product description'), +('map_product_price', 'product_price|price', 'Map product price'), +('map_product_weight', 'product_weight|weight', 'Map product weight'), +('map_product_stock', 'product_in_stock|stock_reel', 'Map stock quantity'), +('map_product_category', 'category|fk_product_type', 'Map product category'), +('map_product_ref', 'virtuemart_product_id|ref_ext', 'Map product ID to external reference'); + +-- Order Field Mapping +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('map_order_enabled', '1', 'Enable order sync'), +('map_order_number', 'order_number|ref', 'Map order number'), +('map_order_date', 'created_on|date_commande', 'Map order date'), +('map_order_status', 'order_status|fk_statut', 'Map order status'), +('map_order_total', 'order_total|total_ttc', 'Map order total with tax'), +('map_order_subtotal', 'order_subtotal|total_ht', 'Map order subtotal without tax'), +('map_order_tax', 'order_tax|total_tva', 'Map tax amount'), +('map_order_shipping', 'order_shipment|total_port', 'Map shipping cost'), +('map_order_ref', 'virtuemart_order_id|ref_ext', 'Map order ID to external reference'); + +-- Order Status Mapping +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('status_pending', 'P|0', 'VirtueMart Pending to Dolibarr Draft'), +('status_confirmed', 'C|1', 'VirtueMart Confirmed to Dolibarr Validated'), +('status_shipped', 'S|3', 'VirtueMart Shipped to Dolibarr Closed/Delivered'), +('status_cancelled', 'X|-1', 'VirtueMart Cancelled to Dolibarr Cancelled'), +('status_refunded', 'R|-1', 'VirtueMart Refunded to Dolibarr Cancelled'); + +-- Payment Method Mapping +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('payment_cash', 'Cash|LIQ', 'Cash payment'), +('payment_check', 'Check|CHQ', 'Check payment'), +('payment_transfer', 'Bank Transfer|VIR', 'Bank transfer'), +('payment_creditcard', 'Credit Card|CB', 'Credit card'), +('payment_paypal', 'PayPal|PRE', 'PayPal'), +('payment_stripe', 'Stripe|PRE', 'Stripe'); + +-- Sync Log Table +CREATE TABLE IF NOT EXISTS `#__dolibarr_sync_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `sync_type` varchar(50) NOT NULL COMMENT 'customer, product, order', + `sync_direction` varchar(50) NOT NULL, + `joomla_id` int(11) DEFAULT NULL, + `dolibarr_id` int(11) DEFAULT NULL, + `status` varchar(20) NOT NULL COMMENT 'success, error, pending', + `message` text, + `sync_date` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `sync_type` (`sync_type`), + KEY `status` (`status`), + KEY `sync_date` (`sync_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Sync Queue Table (for batch processing) +CREATE TABLE IF NOT EXISTS `#__dolibarr_sync_queue` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `sync_type` varchar(50) NOT NULL, + `sync_direction` varchar(50) NOT NULL, + `joomla_id` int(11) DEFAULT NULL, + `priority` int(11) DEFAULT 5, + `attempts` int(11) DEFAULT 0, + `max_attempts` int(11) DEFAULT 3, + `created_date` datetime NOT NULL, + `scheduled_date` datetime NOT NULL, + `processed_date` datetime DEFAULT NULL, + `status` varchar(20) DEFAULT 'pending', + PRIMARY KEY (`id`), + KEY `status` (`status`), + KEY `scheduled_date` (`scheduled_date`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Field Mapping Cache (stores last synced values) +CREATE TABLE IF NOT EXISTS `#__dolibarr_field_cache` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `entity_type` varchar(50) NOT NULL COMMENT 'customer, product, order', + `joomla_id` int(11) NOT NULL, + `dolibarr_id` int(11) NOT NULL, + `last_sync` datetime NOT NULL, + `joomla_hash` varchar(64) DEFAULT NULL COMMENT 'MD5 of Joomla data', + `dolibarr_hash` varchar(64) DEFAULT NULL COMMENT 'MD5 of Dolibarr data', + PRIMARY KEY (`id`), + UNIQUE KEY `entity_mapping` (`entity_type`, `joomla_id`), + KEY `dolibarr_id` (`dolibarr_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Webhook Configuration (for real-time sync) +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('webhook_enabled', '0', 'Enable webhook notifications'), +('webhook_url_customer', '', 'Webhook URL for customer events'), +('webhook_url_product', '', 'Webhook URL for product events'), +('webhook_url_order', '', 'Webhook URL for order events'), +('webhook_secret', '', 'Webhook secret for verification'); + +-- Sample sync schedule (for cron jobs) +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('cron_customer_sync', '0 */6 * * *', 'Sync customers every 6 hours'), +('cron_product_sync', '0 */4 * * *', 'Sync products every 4 hours'), +('cron_order_sync', '*/15 * * * *', 'Sync orders every 15 minutes'), +('cron_cleanup_logs', '0 2 * * 0', 'Cleanup old logs weekly'); + +-- Error Handling Configuration +INSERT INTO `#__dolibarr_config` (`config_key`, `config_value`, `description`) VALUES +('error_retry_enabled', '1', 'Enable automatic retry on errors'), +('error_retry_max', '3', 'Maximum retry attempts'), +('error_retry_delay', '300', 'Delay between retries in seconds'), +('error_notification_enabled', '1', 'Send email on persistent errors'), +('error_notification_email', 'admin@example.com', 'Email for error notifications'); diff --git a/data/demo/membershippro/README.md b/data/demo/membershippro/README.md new file mode 100644 index 0000000..72b040b --- /dev/null +++ b/data/demo/membershippro/README.md @@ -0,0 +1,161 @@ +# MembershipPro Sample Data + +This directory contains sample membership plans, groups, and configuration for MembershipPro (also known as Membership Pro or J2Store Membership). + +## Contents + +- `sample-data.sql` - Membership plans, groups, and sample configuration +- `README.md` - This file + +## Prerequisites + +1. **MembershipPro 3.x or 4.x** installed and configured +2. **Database backup** - Always backup before importing +3. **Joomla 4.x or 5.x** with Moko-Cassiopeia template + +## What Gets Imported + +### Membership Plans (3 tiers) +1. **Basic Membership** - $9.99/month + - Access to basic resources + - Community forum + - Monthly newsletter + +2. **Professional Membership** - $24.99/month + - Everything in Basic + - Premium resources + - Monthly webinars + - Priority support + +3. **Enterprise Membership** - $49.99/month + - Everything in Professional + - 1-on-1 consulting + - Custom training + - VIP events + - API access + +### User Groups +- Basic Members +- Professional Members +- Enterprise Members +- Free Trial Members + +### Configuration +- Payment methods (PayPal, Stripe) +- Email templates +- Access levels +- Subscription rules + +## Installation + +### Method 1: phpMyAdmin +``` +1. Login to phpMyAdmin +2. Select your Joomla database +3. Import sample-data.sql +4. Verify in MembershipPro dashboard +``` + +### Method 2: Command Line +```bash +mysql -u username -p database_name < sample-data.sql +``` + +### Method 3: MembershipPro Admin +Some data can be configured through the MembershipPro admin interface: +1. Components > MembershipPro +2. Plans > Add New +3. Configure settings manually + +## Post-Import Steps + +1. **Configure Payment Gateway** + - Setup PayPal/Stripe credentials + - Test payment processing + - Configure currency + +2. **Email Templates** + - Review welcome emails + - Customize branding + - Test email delivery + +3. **Access Levels** + - Verify Joomla user groups + - Check article access + - Test member-only content + +4. **Subscription Rules** + - Review renewal settings + - Configure grace periods + - Setup upgrade paths + +5. **Integration** + - Link to articles + - Setup member dashboard + - Configure menus + +## Membership Features + +- Recurring subscriptions +- Trial periods +- Proration on upgrades +- Automatic renewals +- Email notifications +- Member dashboard +- Coupon codes +- Gift subscriptions +- Group subscriptions +- Access control integration + +## Customization + +All plans can be customized: +- Adjust pricing +- Modify features +- Add/remove tiers +- Change billing cycles +- Update descriptions +- Configure trials + +## Database Tables + +This data affects these MembershipPro tables: +- `#__osmembership_plans` +- `#__osmembership_categories` +- `#__osmembership_fields` +- `#__osmembership_emailtemplates` +- `#__osmembership_coupons` + +## Troubleshooting + +**Plans not showing?** +- Check plan publish status +- Verify category assignment +- Clear Joomla cache + +**Payment issues?** +- Configure payment plugin +- Test in sandbox mode +- Check gateway credentials + +**Access not working?** +- Verify user group mapping +- Check access level configuration +- Test with different plan levels + +## Support + +For MembershipPro issues: +- Documentation: https://docs.joomdonation.com/membership-pro +- Support forum: https://joomdonation.com/forum +- Moko Consulting: hello@mokoconsulting.tech + +## Warning + +⚠️ **IMPORTANT**: This is sample data. Review and customize all plans, pricing, and features before going live. Always backup before importing. + +## Version + +Version: 1.0.0 +Last Updated: 2026-01-29 +Compatible with: MembershipPro 3.x/4.x, Joomla 4.x/5.x diff --git a/data/demo/membershippro/sample-data.sql b/data/demo/membershippro/sample-data.sql new file mode 100644 index 0000000..1f425e1 --- /dev/null +++ b/data/demo/membershippro/sample-data.sql @@ -0,0 +1,160 @@ +-- MembershipPro Sample Data +-- Version: 1.0.0 +-- Compatible with: MembershipPro 3.x/4.x +-- NOTE: Replace #__ with your actual Joomla table prefix + +-- Membership Plan Categories +INSERT INTO `#__osmembership_categories` (`id`, `title`, `alias`, `description`, `published`, `ordering`) VALUES +(1, 'Individual Memberships', 'individual-memberships', '
Membership plans for individuals.
', 1, 1), +(2, 'Team Memberships', 'team-memberships', 'Membership plans for teams and organizations.
', 1, 2); + +-- Membership Plans +INSERT INTO `#__osmembership_plans` (`id`, `category_id`, `title`, `alias`, `short_description`, `description`, `subscription_length`, `subscription_length_unit`, `price`, `trial_duration`, `trial_duration_unit`, `trial_price`, `recurring_subscription`, `lifetime_membership`, `enable_upgrade_downgrade`, `publish_up`, `publish_down`, `published`, `ordering`, `created_date`) VALUES +-- Basic Plan +(1, 1, 'Basic Membership', 'basic-membership', +'Essential access to our platform and resources.
', +'Perfect for individuals getting started with our community.
', +1, 'month', 9.99, 7, 'day', 0.00, 1, 0, 1, '2026-01-01 00:00:00', NULL, 1, 1, '2026-01-29 00:00:00'), + +-- Professional Plan +(2, 1, 'Professional Membership', 'professional-membership', +'Premium access with exclusive benefits and priority support.
', +'Everything in Basic, plus:
+Ideal for professionals serious about growth and networking.
', +1, 'month', 24.99, 14, 'day', 0.00, 1, 0, 1, '2026-01-01 00:00:00', NULL, 1, 2, '2026-01-29 00:00:00'), + +-- Enterprise Plan +(3, 1, 'Enterprise Membership', 'enterprise-membership', +'Complete VIP access with personalized support and benefits.
', +'Everything in Professional, plus:
+Perfect for organizations and power users who need the best.
', +1, 'month', 49.99, 0, 'day', 0.00, 1, 0, 1, '2026-01-01 00:00:00', NULL, 1, 3, '2026-01-29 00:00:00'), + +-- Annual Basic (discounted) +(4, 1, 'Basic Membership (Annual)', 'basic-membership-annual', +'Save 20% with annual payment!
', +'Same great Basic features with annual billing. Save $24 per year!
', +12, 'month', 95.99, 7, 'day', 0.00, 0, 0, 1, '2026-01-01 00:00:00', NULL, 1, 4, '2026-01-29 00:00:00'), + +-- Team Plan +(5, 2, 'Team Membership (5 seats)', 'team-membership-5', +'Professional membership for teams of up to 5 members.
', +'Leading technology manufacturer providing cutting-edge electronics and computer equipment.
', 'Technology manufacturer, electronics, computers', 'technology, electronics, computers'), +(2, 'Fashion brand offering stylish and comfortable clothing for men, women, and children.
', 'Fashion brand, clothing, apparel', 'fashion, clothing, style'), +(3, 'Home furniture and decor solutions for modern living spaces.
', 'Home furniture, decor, modern living', 'furniture, home, decor'), +(4, 'Professional sports equipment and athletic gear for all levels.
', 'Sports equipment, athletic gear', 'sports, fitness, equipment'), +(5, 'Premium audio equipment manufacturer specializing in headphones and speakers.
', 'Audio equipment, headphones, speakers', 'audio, headphones, sound'); + +-- Link Products to Manufacturers +INSERT INTO `#__virtuemart_product_manufacturers` (`virtuemart_product_id`, `virtuemart_manufacturer_id`) VALUES +-- Electronics +(100, 1), -- Laptop by TechBrand +(101, 1), +(102, 1), -- Smartphone by TechBrand +(103, 1), +(104, 5), -- Headphones by AudioTech +(105, 5), +-- Clothing +(200, 2), -- Shirt by StyleWear +(201, 2), +(202, 2), +(203, 2), +(204, 4), -- Shoes by SportsPro +(205, 2), +-- Home & Garden +(300, 3), -- Furniture by HomeComfort +(301, 3), +(302, 3), +(303, 3); diff --git a/data/demo/virtuemart/product-variants.sql b/data/demo/virtuemart/product-variants.sql new file mode 100644 index 0000000..88f55ab --- /dev/null +++ b/data/demo/virtuemart/product-variants.sql @@ -0,0 +1,58 @@ +-- VirtueMart Product Variants (Child Products) +-- Version: 1.0.0 +-- Create product variations for size, color, storage, etc. + +-- Example: Smartphone with different storage capacities as child products +-- Parent Product: Smartphone Pro 12 (102) + +-- Child Products for Smartphone Pro 12 +INSERT INTO `#__virtuemart_products` (`virtuemart_product_id`, `virtuemart_vendor_id`, `product_parent_id`, `product_sku`, `product_gtin`, `product_mpn`, `product_weight`, `product_weight_uom`, `product_in_stock`, `low_stock_notification`, `product_available_date`, `product_special`, `published`, `created_on`) VALUES +-- 128GB variant (this is the default already created as 102) +-- 256GB variant +(102256, 1, 102, 'PHONE-001-256', '1234567890225', 'PH-PRO-12-256', 0.19, 'kg', 75, 15, '2026-01-01 00:00:00', 1, 1, '2026-01-29 00:00:00'), +-- 512GB variant +(102512, 1, 102, 'PHONE-001-512', '1234567890325', 'PH-PRO-12-512', 0.19, 'kg', 60, 15, '2026-01-01 00:00:00', 1, 1, '2026-01-29 00:00:00'); + +-- Descriptions for variants +INSERT INTO `#__virtuemart_products_en_gb` (`virtuemart_product_id`, `product_name`, `slug`) VALUES +(102256, 'Smartphone Pro 12 - 256GB', 'smartphone-pro-12-256gb'), +(102512, 'Smartphone Pro 12 - 512GB', 'smartphone-pro-12-512gb'); + +-- Pricing for variants +INSERT INTO `#__virtuemart_product_prices` (`virtuemart_product_price_id`, `virtuemart_product_id`, `virtuemart_shoppergroup_id`, `product_price`, `product_currency`, `created_on`) VALUES +(103, 102256, 0, 899.99, 47, '2026-01-29 00:00:00'), +(104, 102512, 0, 999.99, 47, '2026-01-29 00:00:00'); + +-- Example: T-Shirt with different sizes and colors as variants +-- Parent Product: Men's Shirt (200) + +-- Color variants +INSERT INTO `#__virtuemart_products` (`virtuemart_product_id`, `virtuemart_vendor_id`, `product_parent_id`, `product_sku`, `product_mpn`, `product_weight`, `product_weight_uom`, `product_in_stock`, `low_stock_notification`, `published`, `created_on`) VALUES +-- White variant +(200002, 1, 200, 'MENS-SHIRT-001-WHT', 'MS-CS-WHT-M', 0.3, 'kg', 45, 10, 1, '2026-01-29 00:00:00'), +-- Black variant +(200003, 1, 200, 'MENS-SHIRT-001-BLK', 'MS-CS-BLK-M', 0.3, 'kg', 55, 10, 1, '2026-01-29 00:00:00'); + +INSERT INTO `#__virtuemart_products_en_gb` (`virtuemart_product_id`, `product_name`, `slug`) VALUES +(200002, 'Classic Men\'s Shirt - White', 'classic-mens-shirt-white'), +(200003, 'Classic Men\'s Shirt - Black', 'classic-mens-shirt-black'); + +INSERT INTO `#__virtuemart_product_prices` (`virtuemart_product_price_id`, `virtuemart_product_id`, `virtuemart_shoppergroup_id`, `product_price`, `product_currency`, `created_on`) VALUES +(105, 200002, 0, 49.99, 47, '2026-01-29 00:00:00'), +(106, 200003, 0, 49.99, 47, '2026-01-29 00:00:00'); + +-- Link variants to same categories as parent +INSERT INTO `#__virtuemart_product_categories` (`virtuemart_product_id`, `virtuemart_category_id`, `ordering`) VALUES +(102256, 11, 3), +(102512, 11, 4), +(200002, 20, 3), +(200003, 20, 4); + +-- Variant attributes (size, color, etc.) +INSERT INTO `#__virtuemart_product_customfields` (`virtuemart_product_id`, `virtuemart_custom_id`, `custom_value`, `ordering`, `published`) VALUES +-- Smartphone variants get storage specification +(102256, 7, '256GB', 1, 1), +(102512, 7, '512GB', 1, 1), +-- Shirt variants get color specification +(200002, 2, 'White', 1, 1), +(200003, 2, 'Black', 1, 1); diff --git a/data/demo/virtuemart/stock-management.sql b/data/demo/virtuemart/stock-management.sql new file mode 100644 index 0000000..704b15b --- /dev/null +++ b/data/demo/virtuemart/stock-management.sql @@ -0,0 +1,36 @@ +-- VirtueMart Stock Management Sample Data +-- Version: 1.0.0 +-- Configure stock levels, tracking, and low stock notifications + +-- Update stock levels (already set in products.sql, but here for reference) +-- Low stock products (for testing notifications) +UPDATE `#__virtuemart_products` SET + `product_in_stock` = 5, + `low_stock_notification` = 10 +WHERE `virtuemart_product_id` = 300; -- Sofa (low stock) + +UPDATE `#__virtuemart_products` SET + `product_in_stock` = 8, + `low_stock_notification` = 15 +WHERE `virtuemart_product_id` = 103; -- Smartphone Max + +-- Out of stock examples (for testing) +-- UPDATE `#__virtuemart_products` SET +-- `product_in_stock` = 0, +-- `product_availability` = 'Out of Stock - Ships in 2-3 weeks' +-- WHERE `virtuemart_product_id` = 999; + +-- Stock notification settings (global configuration) +-- These would typically be set in VirtueMart configuration, not via SQL +-- But included here for reference + +-- Stock history tracking (if enabled) +-- INSERT INTO `#__virtuemart_product_stock_history` (`virtuemart_product_id`, `stock_level`, `stock_change`, `reason`, `user_id`, `created_on`) VALUES +-- (100, 50, 0, 'Initial stock', 1, '2026-01-29 00:00:00'), +-- (101, 35, 0, 'Initial stock', 1, '2026-01-29 00:00:00'); + +-- Inventory tracking by warehouse (if multi-warehouse is enabled) +-- INSERT INTO `#__virtuemart_product_warehouses` (`virtuemart_product_id`, `virtuemart_warehouse_id`, `stock_level`) VALUES +-- (100, 1, 30), -- Main warehouse +-- (100, 2, 20), -- Secondary warehouse +-- (101, 1, 35);