MemberPress: Allow Importing Coupons Associated With Affiliates (Easy Affiliate)

function mpimp_load_expanded_coupon_importer() { global $mpimp; $mpimp->importers[‘couponaffiliate’] = ‘MpimpExtendedCouponsImporter’; } add_action(‘admin_init’, ‘mpimp_load_expanded_coupon_importer’, 110); //has to be after the MP hook function runs class MpimpExtendedCouponsImporter extends MpimpCouponsImporter { public function form() { } public function import($row,$args) { $ea_active = is_plugin_active(‘easy-affiliate/easy-affiliate.php’) ? true…Continue reading

Apply a Coupon for Minimum Cart Total

function g9_add_coupon_notice() { $cart_total = WC()->cart->get_subtotal(); $minimum_amount = 50; $currency_code = get_woocommerce_currency(); wc_clear_notices(); if ($cart_total < $minimum_amount) { WC()->cart->remove_coupon(‘COUPON’); wc_print_notice(“Get 50% off if you spend more than $minimum_amount $currency_code!”, ‘notice’); } else { WC()->cart->apply_coupon(‘COUPON’); wc_print_notice(‘You just got 50% off your…Continue reading