WP Manifestindependent plugin directory
manifest / ecommerce / otslr-sync-coupons

OTSLR Sync Coupons

WordPress plugin to sync coupons between Memberpress and WordPress

★ 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/milliephanillie/otslr-sync-coupons/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.

WordPress plugin that syncs coupons between MemberPress and WooCommerce.

Description

When a coupon is created or updated in MemberPress, this plugin automatically mirrors it to WooCommerce by hooking into the mepr-coupon-save-meta action. It compares discount amount, type, and expiration to determine whether the WooCommerce coupon needs to be created or updated.

Requirements

  • PHP 7.4+
  • WordPress
  • MemberPress
  • WooCommerce

Installation

  1. Copy the plugin to wp-content/plugins/otslr-sync-coupons/
  2. Run composer install in the plugin directory
  3. Activate the plugin in WordPress admin

Plugin Structure

otslr-sync-coupons/
├── otslr-sync-coupons.php          # Main plugin entry point
├── composer.json
├── src/
│   ├── Includes/
│   │   └── OtslrWooCoupon.php      # Coupon sync logic (MemberPress → WooCommerce)
│   └── Routes/
│       └── OtslrScRoutes.php       # REST API routes (WIP)

How It Works

The plugin listens on the MemberPress mepr-coupon-save-meta hook. When a MemberPress coupon is saved, OtslrWooCoupon::sync_coupon() is called with the full MeprCoupon object. The plugin then:

  1. Looks up the coupon code in WooCommerce
  2. If it exists, updates the matching WooCommerce coupon
  3. If it doesn't exist, creates a new WC_Coupon with the synced values

License

GPL-2.0-or-later