🛒 WooCommerce Integration Guide

Complete guide to integrating Waply Connect with WooCommerce for powerful e-commerce functionality

🎯 Overview

Waply Connect seamlessly integrates with WooCommerce, allowing you to leverage WooCommerce's robust e-commerce features while maintaining Waply Connect's advanced license management capabilities. This integration provides the best of both worlds - WooCommerce's mature e-commerce ecosystem and Waply Connect's specialized licensing system.

🏪 Unified Product Management

Manage all your products in one place using WooCommerce's comprehensive product management system with full licensing support.

🎨 Theme Compatibility

Works seamlessly with any WooCommerce-compatible theme, maintaining your site's design and user experience.

🔌 Plugin Ecosystem

Access to thousands of WooCommerce extensions for coupons, shipping, taxes, analytics, and more.

💳 Advanced Checkout

Utilize WooCommerce's mature checkout system with multiple payment gateways and checkout optimizations.

🚀 Setup Guide

Install WooCommerce

First, ensure WooCommerce is installed and activated on your WordPress site. You can install it from the WordPress plugin repository.

// Via WordPress Admin Plugins → Add New → Search "WooCommerce" → Install & Activate // Via WP-CLI wp plugin install woocommerce --activate

Enable WooCommerce Integration

Navigate to Waply Connect Settings and enable WooCommerce integration in the WooCommerce Integration tab.

📍 Location

WordPress Admin → Waply Connect → Settings → WooCommerce Integration

Configure Product Settings

Set up your WooCommerce products to work with Waply Connect licensing system.

// Mark products as virtual (no shipping required) $product->set_virtual(true); // Disable downloads (handled by Waply Connect) $product->set_downloadable(false); // Add Waply Connect meta data $product->update_meta_data('_waply_license_enabled', 'yes');

🔧 Available Functions

Waply Connect provides several functions to help you integrate with WooCommerce effectively:

waply_is_woocommerce_active()

Check if WooCommerce is installed and active on the site.

if (waply_is_woocommerce_active()) { // WooCommerce is available wc_get_products(); }

waply_create_wc_product()

Create a new WooCommerce product with Waply Connect licensing enabled.

$product_id = waply_create_wc_product(array( 'name' => 'My Software', 'price' => 49.99, 'license_enabled' => true ));

waply_sync_wc_order()

Sync WooCommerce order data with Waply Connect license system.

waply_sync_wc_order($order_id); // Automatically generates licenses for order items

waply_get_wc_license_products()

Get all WooCommerce products that have licensing enabled.

$license_products = waply_get_wc_license_products(); foreach ($license_products as $product) { echo $product->get_name(); }

waply_wc_add_license_meta()

Add license metadata to WooCommerce products.

waply_wc_add_license_meta($product_id, array( 'license_type' => 'standard', 'max_activations' => 3, 'expiry_days' => 365 ));

waply_wc_process_license_order()

Process license generation when WooCommerce order is completed.

add_action('woocommerce_order_status_completed', 'waply_wc_process_license_order');

💻 Code Examples

1. Creating a License Product

// Create a new WooCommerce product with licensing function create_license_product() { $product = new WC_Product_Simple(); $product->set_name('Premium WordPress Plugin'); $product->set_status('publish'); $product->set_catalog_visibility('visible'); $product->set_price(99.00); $product->set_regular_price(99.00); $product->set_virtual(true); // No shipping required $product->set_downloadable(false); // Handled by Waply Connect // Add Waply Connect licensing metadata $product->update_meta_data('_waply_license_enabled', 'yes'); $product->update_meta_data('_waply_license_type', 'standard'); $product->update_meta_data('_waply_max_activations', 3); $product->update_meta_data('_waply_expiry_days', 365); $product_id = $product->save(); return $product_id; }

2. Processing Orders with Licenses

// Hook into WooCommerce order completion add_action('woocommerce_order_status_completed', 'process_waply_licenses'); function process_waply_licenses($order_id) { $order = wc_get_order($order_id); foreach ($order->get_items() as $item) { $product = $item->get_product(); // Check if product has licensing enabled if ($product->get_meta('_waply_license_enabled') === 'yes') { // Generate license for this product $license_key = waply_generate_license(array( 'product_id' => $product->get_id(), 'customer_email' => $order->get_billing_email(), 'order_id' => $order_id, 'quantity' => $item->get_quantity() )); // Send license email to customer waply_send_license_email($license_key, $order->get_billing_email()); } } }

3. Custom Product Fields

// Add custom fields to WooCommerce product admin add_action('woocommerce_product_options_general_product_data', 'waply_add_product_fields'); function waply_add_product_fields() { echo '
'; woocommerce_wp_checkbox(array( 'id' => '_waply_license_enabled', 'label' => 'Enable Waply Licensing', 'description' => 'Generate license keys for this product' )); woocommerce_wp_text_input(array( 'id' => '_waply_max_activations', 'label' => 'Max Activations', 'type' => 'number', 'custom_attributes' => array('min' => 1) )); echo '
'
; }

⚠️ Important Considerations

🔒 Security Best Practices

  • Always validate and sanitize user input
  • Use WordPress nonces for form submissions
  • Implement proper user capability checks
  • Store sensitive data securely

🔄 Synchronization

When WooCommerce integration is enabled, Waply Connect automatically synchronizes:

  • Product data between systems
  • Order completion events
  • Customer information
  • License generation and delivery

🚫 Limitations

  • Some Waply Connect features may be limited when WooCommerce integration is active
  • Custom checkout flows should be tested thoroughly
  • Plugin conflicts may occur with certain WooCommerce extensions

🆘 Support & Resources

Need help with your WooCommerce integration? Here are some resources:

📚 Documentation

Comprehensive guides and API documentation available in the plugin admin area.

View Docs

💬 Support Forum

Get help from our community and support team for integration questions.

Contact Support

🔧 Custom Development

Need custom integration work? Our team can help with specialized requirements.

Get Quote

🎓 Video Tutorials

Step-by-step video guides for common WooCommerce integration scenarios.

Watch Tutorials

⭐ Best Practices

  1. Test in staging first: Always test WooCommerce integration in a staging environment before going live
  2. Backup before changes: Create full site backups before making integration changes
  3. Monitor performance: Keep an eye on site performance with both plugins active
  4. Regular updates: Keep both WooCommerce and Waply Connect updated to latest versions
  5. Cache considerations: Configure caching properly to avoid license validation issues
  6. Customer communication: Clearly explain the license delivery process to customers
  7. Error handling: Implement proper error handling for failed license generation
  8. Documentation: Document your custom integration code for future maintenance

💡 Pro Tip

Use WooCommerce's built-in hooks and filters to customize the integration without modifying core plugin files. This ensures your customizations survive plugin updates.

🚀 Ready to Integrate WooCommerce?

This guide provides everything you need to successfully integrate Waply Connect with WooCommerce.

Your Cart

Your cart is empty