Convert Customers to Users

function eddccu_add_tools_tab( $tabs ) { $tabs[‘eddccu_customers’] = __( ‘Customers’, ‘edd-convert-customers-to-users’ ); return $tabs; } add_filter( ‘edd_tools_tabs’, ‘eddccu_add_tools_tab’ ); /** * Display the Customers tab content in Downloads > Tools */ function eddccu_display_tools_tab() { if ( !current_user_can( ‘manage_shop_settings’ ) ) {…Continue reading

Kupon kódok megjelenítése az értesítő email-ekben

add_action( ‘woocommerce_email_order_meta’, function( $order, $sent_to_admin, $plain_text, $email ) { // Check if coupon is used in order if ( $order->get_used_coupons() ) { // Get the coupon codes used in the order $coupon_codes = implode( ‘, ‘, $order->get_used_coupons() ); // Set…Continue reading

Format USD Currency

function pw_edd_custom_currency_format( $formatted, $currency, $price ) { return $price . ‘ USD’; } add_filter( ‘edd_usd_currency_filter_before’, ‘pw_edd_custom_currency_format’, 10, 3 ); add_filter( ‘edd_usd_currency_filter_after’, ‘pw_edd_custom_currency_format’, 10, 3 );Continue reading

Change user role for buyers

function ao_edd_set_customer_role( $payment_id ) { $email = edd_get_payment_user_email( $payment_id ); $downloads = edd_get_payment_meta_downloads( $payment_id ); $user_id = edd_get_payment_user_id( $payment_id ); if( $user_id ) { $user = new WP_User( $user_id ); // Add role $user->add_role( ‘buyer’ ); } } add_action( ‘edd_complete_purchase’,…Continue reading