Increase Memory Limit During Download Delivery

if ( ! defined( ‘ABSPATH’ ) ) exit; // Increase memory limit during regular download processes if ( !function_exists( ‘eddiml_increase_memory_limit’ ) ) { function eddiml_increase_memory_limit( $download, $email, $payment ) { @ini_set( ‘memory_limit’, ‘256M’ ); } add_action( ‘edd_process_verified_download’, ‘eddiml_increase_memory_limit’, 10, 3…Continue reading

Grandfather Renewal Rate

/* * Sets renewal discount to 40% for any customer that purchased before April 18, 2016 */ function pw_edd_grandfather_renewal_discount( $renewal_discount, $license_id ) { $license = edd_software_licensing()->get_license( $license_id ); if( strtotime( $license->date_created ) < strtotime( 'January 1, 2020' ) ) {…Continue reading

Prevent Discounts on Upgrades

function pw_edd_disable_discount_on_upgrade( $return ) { $cart_items = edd_get_cart_contents(); if ( $cart_items ) { foreach ( $cart_items as $item ) { if ( isset( $item[‘options’][‘is_upgrade’] ) ) { $error_message = __( ‘Discounts are not valid when upgrading.’, ‘edd’ ); edd_set_error( ‘edd-discount-error’,…Continue reading

Prevent Discounts on Renewals

function kfg_check_if_is_renewal( $return, $discount_id ) { // Check if the discount code is valid and is not for renewals. if ( EDD()->session->get( ‘edd_is_renewal’ ) ) { edd_set_error( ‘edd-discount-error’, __( ‘This discount is not valid with renewals.’, ‘edd’ ) ); return…Continue reading