WP Manifestindependent plugin directory
manifest / ecommerce / wc-coupon-mobile

مدیریت کوپن های ووکامرس با شماره موبایل

A simple WooCommerce plugin that allows customers to apply discount coupons using their mobile phone number instead of traditional coupon codes.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/amirsafaridevs/wc-coupon-mobile/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Arta WooCommerce Mobile Coupon Plugin

A comprehensive WooCommerce plugin for mobile-based coupon management with SMS notifications and advanced debugging capabilities.

🚀 Features

  • Mobile-Based Coupon Management: Associate coupons with specific mobile phone numbers
  • Shopping Cart Integration: Display available coupons directly in the WooCommerce cart
  • SMS Notifications: Send automatic SMS notifications when users log in
  • IPPanel SMS Integration: Built-in integration with IPPanel SMS service
  • Advanced Debugging System: Comprehensive logging system with database storage
  • Mobile Number Normalization: Consistent mobile number formatting across the system
  • WooCommerce Settings Integration: Seamless integration with WooCommerce admin panel
  • AJAX-Powered Interface: Modern, responsive admin interface
  • Credit Balance Monitoring: Real-time SMS credit balance checking
  • Error Handling: Robust error handling and user feedback

📋 Requirements

  • WordPress 5.0+
  • WooCommerce 3.0+
  • PHP 7.4+
  • IPPanel SMS account

🛠️ Installation

  1. Upload the plugin files to /wp-content/plugins/arta-wc-coupon-mobile/
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Navigate to WooCommerce > Settings > Arta Mobile Coupons
  4. Configure your IPPanel API key and SMS settings
  5. Set up your coupon patterns and mobile restrictions

⚙️ Configuration

SMS Settings

  • IPPanel API Key configuration
  • SMS pattern selection (with/without name)
  • Credit balance monitoring
  • Test SMS functionality

Coupon Management

  • Mobile restriction settings per coupon
  • Usage limits and allowed mobile numbers
  • Cart display preferences
  • Debug logging configuration

Debug Features

  • Real-time debug logging (50 entries limit)
  • Mobile number testing tools
  • Coupon availability debugging
  • SMS sending diagnostics

🏗️ Technical Architecture

The plugin is built using object-oriented PHP following WordPress coding standards and best practices:

Core Classes

  • Arta_Coupon_Settings: Main settings management and admin interface
  • Arta_Cart_Coupon_Display: Handles coupon display in shopping cart
  • Arta_Coupon_Mobile_Limits: Manages mobile usage limits for coupons
  • Arta_Login_Notification: Handles SMS notifications on user login

Key Features

  • Custom WooCommerce settings tab with integrated UI
  • Database-backed logging system (stored in WordPress options)
  • Mobile number normalization for consistent comparisons
  • AJAX-powered admin interface for real-time interactions
  • Comprehensive error handling and user feedback

📁 File Structure

arta-wc-coupon-mobile/
├── arta-wc-coupon-mobile.php (Main plugin file)
├── include/
│   ├── class/
│   │   ├── Arta_Coupon_Settings.php (Settings management)
│   │   ├── Arta_Cart_Coupon_Display.php (Cart integration)
│   │   ├── Arta_Coupon_Mobile_Limits.php (Usage limits)
│   │   └── Arta_Login_Notification.php (SMS notifications)
│   └── function.php (General functions)
└── README.md (This file)

🔧 Usage

For Administrators

  1. Create coupons in WooCommerce with mobile restrictions
  2. Configure SMS settings in the plugin admin panel
  3. Test SMS functionality using the built-in test tools
  4. Monitor debug logs for troubleshooting
  5. Check credit balance and manage SMS costs

For Users

  1. Log in with a mobile number associated with coupons
  2. View available coupons in the shopping cart
  3. Receive SMS notifications with discount codes
  4. Apply coupons during checkout

🔒 Technical Details

Database Storage

  • Plugin settings stored in WordPress options table
  • Debug logs stored in arta_debug_logs option
  • SMS errors stored in arta_sms_errors option

API Integration

  • IPPanel SMS API for message sending
  • Credit balance checking via REST API
  • Secure API key management

Mobile Number Handling

  • Automatic normalization (removes leading zeros, country codes)
  • Consistent formatting across all functions
  • Support for various input formats

Security Features

  • WordPress nonce verification for AJAX requests
  • Input sanitization and validation
  • User capability checks for admin functions

🧪 Development

Coding Standards

  • WordPress Coding Standards
  • PSR-4 autoloading structure
  • Object-oriented architecture
  • Comprehensive error handling

Testing

  • Built-in debug logging system
  • Test SMS functionality
  • Mobile number validation tools
  • Coupon availability debugging

❓ FAQ

How do I set up mobile restrictions for coupons?

  1. Create a coupon in WooCommerce
  2. Add custom fields for mobile restrictions
  3. Configure allowed mobile numbers
  4. Enable mobile restriction for the coupon

How does the SMS notification system work?

The plugin automatically sends SMS notifications when users log in, including available discount codes for their mobile number.

Can I test the SMS functionality?

Yes, the plugin includes a built-in test SMS feature in the admin panel that allows you to send test messages.

How do I monitor debug logs?

Debug logs are available in the plugin settings panel with a toggle button to show/hide the log display.

What SMS service does this plugin use?

The plugin integrates with IPPanel SMS service for sending messages and checking credit balance.

📸 Screenshots

  1. Plugin settings page with SMS configuration
  2. Debug logs display with toggle functionality
  3. Shopping cart with mobile coupons display
  4. SMS test functionality in admin panel

📝 Changelog

1.0.0

  • Initial release
  • Mobile-based coupon management
  • SMS notification system
  • Advanced debugging capabilities
  • WooCommerce integration
  • IPPanel SMS API integration

🤝 Support

For support, feature requests, or bug reports, please use the GitHub repository issues section.

📄 License

This project is licensed under the GPL v2 or later - see the LICENSE file for details.

👨‍💻 Credits

Developed by Amir Safari for WooCommerce mobile coupon management with SMS integration capabilities.


⭐ Star this repository if you find it useful!