Skip to content

Instantly share code, notes, and snippets.

View mahircoding's full-sized avatar
🏠
Working from home

MahirCoding mahircoding

🏠
Working from home
  • surakarta Indonesia
  • 02:46 (UTC +07:00)
View GitHub Profile
@amdrew
amdrew / gist:40fcef36a7842d80f66c
Last active July 13, 2023 00:30
EDD 2.0 - Show discount field by default
<?php
/**
* Unhook default EDD discount field
*/
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 );
/**
* Add our own callback for the discount field, keeping the same CSS as before
*/
@pippinsplugins
pippinsplugins / gist:9557012
Created March 14, 2014 21:10
Send an email anytime a payment is recurring through EDD Recurring Payments
<?php
function pw_edd_recurring_payment_received_notice( $payment, $parent_id, $amount, $txn_id, $unique_key ) {
$user_id = edd_get_payment_user_id( $parent_id );
$email = edd_get_payment_user_email( $parent_id );
$user_data = get_userdata( $user_id );
$subject = 'Payment Received';
$message = "Hello $usera_data->display_name, your payment for $amount has been received. Thanks!";
<?php
function pw_edd_send_email_on_pending( $payment_id, $payment_data ) {
// grab the gateway so we can only send on email for specific gateways
$gateway = isset( $_POST['edd-gateway'] ) ? $_POST['edd-gateway'] : '';
// TODO: replace "bacs" with your gateway ID
if( $gateway != 'bacs' )
return;