WooCommerce Integration

The Loyalty.lt WooCommerce plugin seamlessly integrates loyalty card functionality into your WordPress e-commerce store. Customers can earn points on purchases, redeem rewards, and track their loyalty status directly from your store.

Plugin Overview

The WooCommerce plugin provides a complete loyalty solution with minimal setup required. It handles point calculation, card management, and customer interactions automatically.

Key Features

Automatic Point Awards

Points are automatically awarded when orders are completed, with configurable rates and rules.

Checkout Integration

Customers can apply point discounts directly during checkout with real-time balance updates.

Customer Dashboard

Dedicated loyalty section in customer accounts showing points, history, and available rewards.

Admin Management

Complete admin interface for managing loyalty settings, viewing customer data, and generating reports.

Installation

Method 1: WordPress Plugin Directory

1

Access Plugin Directory

In your WordPress admin, navigate to PluginsAdd New.
2

Search for Plugin

Search for “Loyalty.lt WooCommerce” in the plugin directory.
3

Install and Activate

Click Install Now, then Activate once installation completes.
4

Configure Settings

Go to WooCommerceLoyalty Settings to configure your API credentials.

Method 2: Manual Installation

1

Download Plugin

Download the latest plugin ZIP file from the Partners Portal.
2

Upload Plugin

In WordPress admin, go to PluginsAdd NewUpload Plugin.
3

Install ZIP File

Choose the downloaded ZIP file and click Install Now.
4

Activate Plugin

After installation, click Activate Plugin to enable the loyalty features.

Configuration

Basic Setup

Configure your Loyalty.lt API credentials in WooCommerceSettingsLoyalty:
API Key: your_api_key_here
API Secret: your_api_secret_here
Environment: Staging (for testing) or Production
Always test with the staging environment before switching to production.

Advanced Configuration

Customer Experience

Registration Flow

1

Account Creation

When customers create a WooCommerce account, a loyalty card is automatically created in the background.
2

Welcome Points

New members receive welcome bonus points as configured in settings.
3

Email Confirmation

Customers receive a welcome email with their loyalty card details and initial balance.
4

Dashboard Access

Loyalty information becomes available in the customer’s “My Account” section.

Earning Points

Points are automatically calculated and awarded when orders are completed:
// Example: $50 order with 1 point per $1 spent
Order Total: $50.00
Points Earned: 50 points
Bonus (if applicable): +10 points (Gold tier 20% bonus)
Total Awarded: 60 points

Redeeming Points

1

Checkout Integration

During checkout, customers see their available points balance and redemption options.
2

Apply Discount

Customers can choose how many points to redeem for instant discounts.
3

Real-time Updates

Point balance and discount amount update in real-time as customers adjust redemption.
4

Order Completion

Final point balance is updated after successful order completion.

Admin Features

Customer Management

View comprehensive loyalty information for each customer:
  • Current points balance
  • Lifetime points earned and redeemed
  • Tier status and progression
  • Recent transaction history
  • Customer activity timeline

Reporting and Analytics

Points Report

Track point earning and redemption patterns:
  • Daily/weekly/monthly summaries
  • Point liability tracking
  • Redemption rate analysis
  • Revenue impact metrics

Customer Insights

Understand customer loyalty behavior:
  • Tier distribution analysis
  • Engagement level metrics
  • Churn risk identification
  • Customer lifetime value

Product Performance

See which products drive loyalty:
  • Point-earning product rankings
  • Category performance analysis
  • Promotional campaign results
  • Cross-sell opportunities

Financial Impact

Measure loyalty program ROI:
  • Revenue attribution to loyalty
  • Average order value impact
  • Customer retention rates
  • Program cost analysis

Customization

Hooks and Filters

The plugin provides numerous WordPress hooks for customization:
// Customize point calculation
add_filter('loyalty_lt_calculate_points', function($points, $order, $customer) {
    // Double points for VIP customers
    if ($customer->has_role('vip')) {
        $points *= 2;
    }
    
    // Bonus points for large orders
    if ($order->get_total() > 200) {
        $points += 50;
    }
    
    return $points;
}, 10, 3);

Template Overrides

Customize the appearance by copying templates to your theme:
1

Copy Templates

Copy plugin templates from /plugins/loyalty-lt/templates/ to /your-theme/loyalty-lt/.
2

Modify Templates

Edit the copied templates to match your theme’s design and layout.
3

Style with CSS

Add custom CSS to your theme to style the loyalty components.
4

Test Changes

Verify that customizations work across different devices and browsers.

Available Templates

Troubleshooting

Common Issues

Debug Mode

Enable debug logging for troubleshooting:
Add to your wp-config.php:
define('LOYALTY_LT_DEBUG', true);
define('WP_DEBUG_LOG', true);

Performance Optimization

Caching Considerations

Object Caching

  • Cache customer point balances
  • Store tier information locally
  • Cache redemption options
  • Implement cache invalidation on updates

Page Caching

  • Exclude checkout pages from full-page caching
  • Use AJAX for dynamic loyalty content
  • Cache static loyalty pages
  • Implement cache warming for popular pages

Database Optimization

-- Add indexes for better performance
ALTER TABLE wp_loyalty_transactions ADD INDEX idx_customer_date (customer_id, created_at);
ALTER TABLE wp_loyalty_cards ADD INDEX idx_status_tier (status, tier);
ALTER TABLE wp_loyalty_points ADD INDEX idx_card_expiry (card_id, expires_at);

API Request Optimization

// Batch multiple point awards
$batch_transactions = [];
foreach ($orders as $order) {
    $batch_transactions[] = [
        'card_id' => $order->get_customer_loyalty_id(),
        'points' => calculate_points($order),
        'reference' => $order->get_id()
    ];
}

// Single API call for all transactions
$loyalty_api->bulk_award_points($batch_transactions);

Security Best Practices

Always follow security best practices when handling customer loyalty data and API credentials.

API Security

Credential Storage

  • Store API credentials in wp-config.php
  • Use environment variables for sensitive data
  • Never commit credentials to version control
  • Rotate API keys regularly

Request Validation

  • Validate all customer inputs
  • Sanitize point amounts and references
  • Check user permissions before API calls
  • Implement rate limiting for API requests

Data Protection

  • Encrypt sensitive customer data
  • Use HTTPS for all API communications
  • Implement proper session management
  • Log security-related events

Access Control

  • Restrict admin access to loyalty settings
  • Implement role-based permissions
  • Audit admin actions and changes
  • Use strong authentication methods

Migration and Updates

Migrating from Other Loyalty Plugins

1

Export Existing Data

Export customer points and transaction data from your current loyalty system.
2

Data Transformation

Transform exported data to match Loyalty.lt format requirements.
3

Import to Loyalty.lt

Use the bulk import API or admin tools to import customer data.
4

Verify Data Integrity

Compare imported data with original system to ensure accuracy.
5

Customer Communication

Notify customers about the migration and any changes to their accounts.

Plugin Updates

The plugin includes automatic update notifications and can be updated through the WordPress admin interface.
  • Plugin checks for updates daily
  • Notifications appear in WordPress admin
  • One-click updates with backup recommendations
  • Changelog displayed before updating

Advanced Features

Multi-Store Support

For businesses with multiple WooCommerce stores:

API Extensions

// Add custom REST API endpoints
add_action('rest_api_init', function() {
    register_rest_route('loyalty/v1', '/custom-reward', [
        'methods' => 'POST',
        'callback' => 'handle_custom_reward',
        'permission_callback' => 'check_loyalty_permissions'
    ]);
});

Support and Resources

Need help with the WooCommerce integration? Here are your support options:

Documentation and Guides

  • Plugin Documentation: Complete setup and configuration guide
  • Video Tutorials: Step-by-step installation and customization videos
  • Code Examples: Sample implementations and customizations
  • Best Practices: Optimization and security recommendations

Support Channels

Technical Support

Email: woocommerce@loyalty.lt Response Time: 24 hours Coverage: Setup, configuration, troubleshooting

Developer Support

Email: developers@loyalty.lt Response Time: 48 hours Coverage: Custom development, API integration

Community Forum

URL: forum.loyalty.lt Type: Community support and discussions Coverage: General questions, tips, and tricks

Partners Portal

URL: partners.loyalty.lt Access: Plugin downloads, documentation, settings Resources: API credentials, analytics, billing

Professional Services

  • Custom Development: Tailored features and integrations
  • Migration Services: Data migration from other loyalty systems
  • Performance Optimization: Speed and scalability improvements
  • Training and Consultation: Team training and best practices

Next Steps