WIP: Add demo data structure and fix template critical issues #67

Closed
Copilot wants to merge 5 commits from copilot/fix-missing-language-variables into main
9 changed files with 988 additions and 0 deletions
Showing only changes of commit 7a0c6f56c8 - Show all commits

View File

@@ -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

View File

@@ -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');

View File

@@ -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

View File

@@ -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', '<p>Membership plans for individuals.</p>', 1, 1),
(2, 'Team Memberships', 'team-memberships', '<p>Membership plans for teams and organizations.</p>', 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',
'<p>Essential access to our platform and resources.</p>',
'<h3>Basic Membership Features</h3>
<ul>
<li>Access to basic resources and materials</li>
<li>Community forum participation</li>
<li>Monthly newsletter</li>
<li>Email support</li>
<li>Member directory listing</li>
</ul>
<p>Perfect for individuals getting started with our community.</p>',
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',
'<p>Premium access with exclusive benefits and priority support.</p>',
'<h3>Professional Membership Features</h3>
<p><strong>Everything in Basic, plus:</strong></p>
<ul>
<li>Access to premium resources library</li>
<li>Monthly live webinars and workshops</li>
<li>Advanced training materials and courses</li>
<li>Priority email and chat support</li>
<li>Quarterly networking events</li>
<li>Exclusive member discounts (15% off store)</li>
<li>Early access to new features</li>
</ul>
<p>Ideal for professionals serious about growth and networking.</p>',
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',
'<p>Complete VIP access with personalized support and benefits.</p>',
'<h3>Enterprise Membership Features</h3>
<p><strong>Everything in Professional, plus:</strong></p>
<ul>
<li>Monthly 1-on-1 consulting sessions</li>
<li>Custom training programs tailored to your needs</li>
<li>Dedicated phone support line</li>
<li>VIP access to all events and conferences</li>
<li>Annual conference pass (value $500)</li>
<li>API access for integrations</li>
<li>Premium member badge and profile highlighting</li>
<li>Exclusive enterprise networking group</li>
<li>Complimentary guest passes (2 per year)</li>
</ul>
<p>Perfect for organizations and power users who need the best.</p>',
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',
'<p>Save 20% with annual payment!</p>',
'<p>Same great Basic features with annual billing. Save $24 per year!</p>',
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',
'<p>Professional membership for teams of up to 5 members.</p>',
'<h3>Team Membership Features</h3>
<ul>
<li>5 Professional-level memberships</li>
<li>Centralized billing and management</li>
<li>Team collaboration tools</li>
<li>Shared resource library</li>
<li>Team training sessions</li>
<li>Volume discount (save 15%)</li>
</ul>',
1, 'month', 106.21, 0, 'day', 0.00, 1, 0, 1, '2026-01-01 00:00:00', NULL, 1, 5, '2026-01-29 00:00:00');
-- Plan - User Group Mapping (determines Joomla access levels)
INSERT INTO `#__osmembership_plans` (`id`, `usergroup_id`) VALUES
(1, 2), -- Basic -> Registered
(2, 10), -- Professional -> Special (create this group in Joomla)
(3, 11), -- Enterprise -> VIP (create this group in Joomla)
(4, 2), -- Annual Basic -> Registered
(5, 10); -- Team -> Special
-- Email Templates
INSERT INTO `#__osmembership_emailtemplates` (`id`, `name`, `subject`, `body`, `published`) VALUES
(1, 'subscription_confirmation', 'Welcome to [PLAN_TITLE] Membership!',
'Dear [MEMBER_NAME],
Thank you for subscribing to [PLAN_TITLE]!
Your membership details:
- Plan: [PLAN_TITLE]
- Start Date: [FROM_DATE]
- End Date: [TO_DATE]
- Amount Paid: [AMOUNT]
You can access your member dashboard at: [MEMBER_DASHBOARD_URL]
If you have any questions, please don''t hesitate to contact us.
Best regards,
The Team', 1),
(2, 'subscription_renewal_reminder', 'Your membership renewal is coming up',
'Dear [MEMBER_NAME],
This is a friendly reminder that your [PLAN_TITLE] membership will renew on [TO_DATE].
Renewal Amount: [AMOUNT]
Your membership will automatically renew unless you cancel before the renewal date.
Manage your subscription: [MEMBER_DASHBOARD_URL]
Thank you for being a valued member!
Best regards,
The Team', 1),
(3, 'subscription_expired', 'Your membership has expired',
'Dear [MEMBER_NAME],
Your [PLAN_TITLE] membership expired on [TO_DATE].
We hope you enjoyed your membership benefits. You can renew anytime to regain access to all features.
Renew now: [RENEWAL_URL]
Best regards,
The Team', 1);
-- Custom Fields (optional registration fields)
INSERT INTO `#__osmembership_fields` (`id`, `name`, `title`, `field_type`, `values`, `required`, `published`, `ordering`) VALUES
(1, 'company', 'Company Name', 'text', '', 0, 1, 1),
(2, 'job_title', 'Job Title', 'text', '', 0, 1, 2),
(3, 'phone', 'Phone Number', 'text', '', 1, 1, 3),
(4, 'how_did_you_hear', 'How did you hear about us?', 'list', 'Search Engine\r\nSocial Media\r\nFriend Referral\r\nAdvertisement\r\nOther', 0, 1, 4),
(5, 'interests', 'Areas of Interest', 'checkboxes', 'Technology\r\nBusiness\r\nMarketing\r\nDesign\r\nDevelopment', 0, 1, 5);
-- Sample Coupon Codes
INSERT INTO `#__osmembership_coupons` (`id`, `code`, `discount`, `discount_amount`, `times`, `used`, `valid_from`, `valid_to`, `published`) VALUES
(1, 'WELCOME10', 1, 10.00, 100, 0, '2026-01-01 00:00:00', '2026-12-31 23:59:59', 1),
(2, 'ANNUAL20', 1, 20.00, 50, 0, '2026-01-01 00:00:00', '2026-12-31 23:59:59', 1),
(3, 'TRIAL7DAY', 2, 7.00, 200, 0, '2026-01-01 00:00:00', '2026-06-30 23:59:59', 1);
-- Configuration (these are typically stored in component params, but shown here for reference)
-- You would configure these in: Components > MembershipPro > Configuration
-- - Currency: USD
-- - Payment plugins: PayPal, Stripe
-- - Tax settings: Based on location
-- - Email from name and address
-- - Member dashboard URL
-- - Renewal settings

View File

@@ -0,0 +1,103 @@
-- VirtueMart Custom Product Fields
-- Version: 1.0.0
-- These custom fields add additional product options like size, color, warranty, etc.
-- Custom Field Types
INSERT INTO `#__virtuemart_customs` (`virtuemart_custom_id`, `custom_parent_id`, `virtuemart_vendor_id`, `custom_jplugin_id`, `custom_element`, `admin_only`, `custom_title`, `custom_tip`, `custom_value`, `custom_field_type`, `is_input`, `is_cart_attribute`, `is_list`, `custom_params`, `published`, `ordering`, `shared`, `created_on`, `modified_on`) VALUES
-- Size selector
(1, 0, 1, 0, '', 0, 'Size', 'Select your size', '', 'S', 1, 1, 1, '', 1, 1, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
-- Color selector
(2, 0, 1, 0, '', 0, 'Color', 'Choose your preferred color', '', 'S', 1, 1, 1, '', 1, 2, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
-- Material type
(3, 0, 1, 0, '', 0, 'Material', 'Product material', '', 'S', 0, 0, 0, '', 1, 3, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
-- Warranty
(4, 0, 1, 0, '', 0, 'Warranty', 'Warranty period', '', 'S', 0, 0, 0, '', 1, 4, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
-- Delivery time
(5, 0, 1, 0, '', 0, 'Delivery Time', 'Expected delivery timeframe', '', 'S', 0, 0, 0, '', 1, 5, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
-- Gift wrap option
(6, 0, 1, 0, '', 0, 'Gift Wrap', 'Add gift wrapping', '', 'B', 1, 1, 0, '', 1, 6, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
-- Memory/Storage (for electronics)
(7, 0, 1, 0, '', 0, 'Storage', 'Storage capacity', '', 'S', 1, 1, 1, '', 1, 7, 0, '2026-01-29 00:00:00', '2026-01-29 00:00:00');
-- Size Options
INSERT INTO `#__virtuemart_customs` (`virtuemart_custom_id`, `custom_parent_id`, `virtuemart_vendor_id`, `custom_value`, `custom_price`, `published`, `ordering`) VALUES
(10, 1, 1, 'XS', 0.00, 1, 1),
(11, 1, 1, 'S', 0.00, 1, 2),
(12, 1, 1, 'M', 0.00, 1, 3),
(13, 1, 1, 'L', 0.00, 1, 4),
(14, 1, 1, 'XL', 0.00, 1, 5),
(15, 1, 1, 'XXL', 0.00, 1, 6);
-- Color Options
INSERT INTO `#__virtuemart_customs` (`virtuemart_custom_id`, `custom_parent_id`, `virtuemart_vendor_id`, `custom_value`, `custom_price`, `published`, `ordering`) VALUES
(20, 2, 1, 'Black', 0.00, 1, 1),
(21, 2, 1, 'White', 0.00, 1, 2),
(22, 2, 1, 'Blue', 0.00, 1, 3),
(23, 2, 1, 'Red', 0.00, 1, 4),
(24, 2, 1, 'Green', 0.00, 1, 5),
(25, 2, 1, 'Gray', 0.00, 1, 6),
(26, 2, 1, 'Navy', 0.00, 1, 7),
(27, 2, 1, 'Brown', 0.00, 1, 8);
-- Storage Options (Electronics)
INSERT INTO `#__virtuemart_customs` (`virtuemart_custom_id`, `custom_parent_id`, `virtuemart_vendor_id`, `custom_value`, `custom_price`, `published`, `ordering`) VALUES
(30, 7, 1, '128GB', 0.00, 1, 1),
(31, 7, 1, '256GB', 100.00, 1, 2),
(32, 7, 1, '512GB', 200.00, 1, 3),
(33, 7, 1, '1TB', 300.00, 1, 4);
-- Assign Custom Fields to Products
-- Clothing products get Size and Color
INSERT INTO `#__virtuemart_product_customfields` (`virtuemart_product_id`, `virtuemart_custom_id`, `ordering`, `published`) VALUES
-- Men's Shirt
(200, 1, 1, 1), -- Size
(200, 2, 2, 1), -- Color
-- Men's Jeans
(201, 1, 1, 1), -- Size
(201, 2, 2, 1), -- Color
-- Women's Dress
(202, 1, 1, 1), -- Size
(202, 2, 2, 1), -- Color
-- Women's Blouse
(203, 1, 1, 1), -- Size
(203, 2, 2, 1), -- Color
-- Running Shoes
(204, 1, 1, 1), -- Size
(204, 2, 2, 1), -- Color
-- Casual Shoes
(205, 1, 1, 1), -- Size
(205, 2, 2, 1); -- Color
-- Electronics products get Storage and Warranty
INSERT INTO `#__virtuemart_product_customfields` (`virtuemart_product_id`, `virtuemart_custom_id`, `custom_value`, `ordering`, `published`) VALUES
-- Laptops
(100, 7, '512GB', 1, 1), -- Storage
(100, 4, '2 Year Manufacturer Warranty', 2, 1), -- Warranty
(101, 7, '256GB', 1, 1),
(101, 4, '1 Year Manufacturer Warranty', 2, 1),
-- Smartphones
(102, 7, '128GB', 1, 1),
(102, 2, '', 2, 1), -- Color option
(102, 4, '1 Year Manufacturer Warranty', 3, 1),
(103, 7, '256GB', 1, 1),
(103, 2, '', 2, 1), -- Color option
(103, 4, '1 Year Manufacturer Warranty', 3, 1);
-- Add Gift Wrap option to all products (optional)
INSERT INTO `#__virtuemart_product_customfields` (`virtuemart_product_id`, `virtuemart_custom_id`, `custom_price`, `ordering`, `published`) VALUES
(100, 6, 5.99, 99, 1),
(101, 6, 5.99, 99, 1),
(102, 6, 5.99, 99, 1),
(103, 6, 5.99, 99, 1),
(104, 6, 5.99, 99, 1),
(105, 6, 5.99, 99, 1),
(200, 6, 5.99, 99, 1),
(201, 6, 5.99, 99, 1),
(202, 6, 5.99, 99, 1),
(203, 6, 5.99, 99, 1),
(204, 6, 5.99, 99, 1),
(205, 6, 5.99, 99, 1),
(300, 6, 9.99, 99, 1),
(301, 6, 5.99, 99, 1),
(302, 6, 5.99, 99, 1),
(303, 6, 5.99, 99, 1);

View File

@@ -0,0 +1,21 @@
-- VirtueMart Featured Products Configuration
-- Version: 1.0.0
-- Mark specific products as featured for homepage display
-- Featured Products
-- Set product_special = 1 for featured items
UPDATE `#__virtuemart_products` SET `product_special` = 1 WHERE `virtuemart_product_id` IN (
102, -- Smartphone Pro 12
104, -- Wireless Headphones Pro
201, -- Slim Fit Jeans (on sale)
203, -- Women's Casual Blouse
301 -- Ergonomic Office Chair (on sale)
);
-- Alternative: Create a featured products relation table if your VirtueMart version uses it
-- INSERT INTO `#__virtuemart_product_featured` (`virtuemart_product_id`, `ordering`, `published`) VALUES
-- (102, 1, 1),
-- (104, 2, 1),
-- (201, 3, 1),
-- (203, 4, 1),
-- (301, 5, 1);

View File

@@ -0,0 +1,40 @@
-- VirtueMart Manufacturers/Brands Sample Data
-- Version: 1.0.0
-- Sample Manufacturers
INSERT INTO `#__virtuemart_manufacturers` (`virtuemart_manufacturer_id`, `virtuemart_vendor_id`, `mf_name`, `slug`, `mf_email`, `mf_url`, `published`, `ordering`, `created_on`, `modified_on`) VALUES
(1, 1, 'TechBrand Inc.', 'techbrand-inc', 'info@techbrand.example', 'https://techbrand.example', 1, 1, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
(2, 1, 'StyleWear Co.', 'stylewear-co', 'contact@stylewear.example', 'https://stylewear.example', 1, 2, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
(3, 1, 'HomeComfort', 'homecomfort', 'sales@homecomfort.example', 'https://homecomfort.example', 1, 3, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
(4, 1, 'SportsPro', 'sportspro', 'info@sportspro.example', 'https://sportspro.example', 1, 4, '2026-01-29 00:00:00', '2026-01-29 00:00:00'),
(5, 1, 'AudioTech', 'audiotech', 'support@audiotech.example', 'https://audiotech.example', 1, 5, '2026-01-29 00:00:00', '2026-01-29 00:00:00');
-- Manufacturer descriptions
INSERT INTO `#__virtuemart_manufacturers_en_gb` (`virtuemart_manufacturer_id`, `mf_desc`, `metadesc`, `metakey`) VALUES
(1, '<p>Leading technology manufacturer providing cutting-edge electronics and computer equipment.</p>', 'Technology manufacturer, electronics, computers', 'technology, electronics, computers'),
(2, '<p>Fashion brand offering stylish and comfortable clothing for men, women, and children.</p>', 'Fashion brand, clothing, apparel', 'fashion, clothing, style'),
(3, '<p>Home furniture and decor solutions for modern living spaces.</p>', 'Home furniture, decor, modern living', 'furniture, home, decor'),
(4, '<p>Professional sports equipment and athletic gear for all levels.</p>', 'Sports equipment, athletic gear', 'sports, fitness, equipment'),
(5, '<p>Premium audio equipment manufacturer specializing in headphones and speakers.</p>', '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);

View File

@@ -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);

View File

@@ -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);