Custom Terms Page
/** * Change $page_id to the ID of your terms page below */ function sumobi_edd_terms_agreement() { global $edd_options; if ( isset( $edd_options[‘show_agree_to_terms’] ) ) : ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
/** * Change $page_id to the ID of your terms page below */ function sumobi_edd_terms_agreement() { global $edd_options; if ( isset( $edd_options[‘show_agree_to_terms’] ) ) : ?>Continue reading
function sumobi_edd_set_minimum_password_length( $valid_data, $post_data ) { // how many characters should the password be? $length = 8; if ( strlen( $post_data[‘edd_user_pass’] ) < $length ) { edd_set_error( 'password_too_short', sprintf( __( 'Please enter a password of %s characters or more.', 'edd'…Continue reading
function pw_edd_limit_total_purchase() { if( edd_get_cart_total() > 100 ) { edd_set_error( ‘too_much’, ‘You cannot purchase that much at one time.’ ); } } add_action( ‘edd_checkout_error_checks’, ‘pw_edd_limit_total_purchase’ );Continue reading
/** * Adding a custom field to the checkout screen * * Covers: * * Adding a phone number field to the checkout * Making the phone number field required * Setting an error when the phone number field is…Continue reading
function pw_edd_disable_paypal_on_multi_item_checkout( $gateways ) { global $wp_query; if ( ! empty( $wp_query ) && edd_is_checkout() && count( edd_get_cart_contents() ) > 1 ) { $paypal_gateways = array( ‘paypal’, ‘paypalexpress’, ‘paypalpro’, ‘paypal_commerce’, ); foreach ( $paypal_gateways as $paypal ) { if (…Continue reading
function edd_custom_change_checkout_thumb_image_size( $dimensions ) { $dimensions = array( 60, 60 ); // array( width, height ) in pixels return $dimensions; } add_filter( ‘edd_checkout_image_size’, ‘edd_custom_change_checkout_thumb_image_size’ );Continue reading
function pw_edd_remove_discount_field() { remove_action( ‘edd_checkout_form_top’, ‘edd_discount_field’, -1 ); } add_action( ‘init’, ‘pw_edd_remove_discount_field’ );Continue reading
function pw_edd_remove_state_from_required_fields( $fields ) { if( array_key_exists( ‘card_state’, $fields ) ) { unset( $fields[‘card_state’] ); } return $fields; } add_filter( ‘edd_purchase_form_required_fields’, ‘pw_edd_remove_state_from_required_fields’ );Continue reading
function sumobi_edd_force_account_creation_by_download_category_or_tag( $ret ) { // download categories that the download must belong to before account creation is forced $categories_to_search = array( ‘cat1’, ‘cat2’, ‘cat3’ ); // download tags that the download must belong to before account creation is forced…Continue reading
remove_action( ‘edd_register_fields_before’, ‘edd_user_info_fields’ ); add_action( ‘edd_register_fields_after’, ‘edd_user_info_fields’ );Continue reading