Required Fields

/* * Modify the required fields for checkout * * Fields are identified by the input fields “name” attribute. * * This example shows how to make the last name field, which has a name attribute of “edd_last”, required */…Continue reading

Custom Payment Icon

function pw_edd_payment_icon( $icons = array() ) { $icons[‘url/to/your/image/icon.png’] = ‘Name of the Payment Method’; return $icons; } add_filter( ‘edd_accepted_payment_icons’, ‘pw_edd_payment_icon’ );Continue reading

Remove Last Name at Checkout

function pw_edd_remove_last_name_field() { remove_action( ‘edd_purchase_form_after_user_info’, ‘edd_user_info_fields’ ); remove_action( ‘edd_register_fields_before’, ‘edd_user_info_fields’ ); } add_action( ‘init’, ‘pw_edd_remove_last_name_field’ ); function pw_edd_user_info_fields() { if ( is_user_logged_in() ) : $user_data = get_userdata( get_current_user_id() ); endif; ?> *Continue reading

Force account creation by cart total

function sumobi_edd_force_account_creation_by_cart_total( $ret ) { // enter the cart total amount that should force account creation $limit = 100; // get the cart total $cart_total = edd_get_cart_total(); if ( $cart_total >= $limit ) { // if the cart total is…Continue reading

Removing Fields from WooCommerce Checkout

function g9_remove_woocommerce_checkout_fields($fields) { // Remove billing fields unset($fields[‘billing’][‘billing_first_name’]); unset($fields[‘billing’][‘billing_last_name’]); unset($fields[‘billing’][‘billing_company’]); unset($fields[‘billing’][‘billing_address_1’]); unset($fields[‘billing’][‘billing_address_2’]); unset($fields[‘billing’][‘billing_city’]); unset($fields[‘billing’][‘billing_postcode’]); unset($fields[‘billing’][‘billing_country’]); unset($fields[‘billing’][‘billing_state’]); unset($fields[‘billing’][‘billing_phone’]); unset($fields[‘billing’][‘billing_email’]); // Remove shipping fields unset($fields[‘shipping’][‘shipping_first_name’]); unset($fields[‘shipping’][‘shipping_last_name’]); unset($fields[‘shipping’][‘shipping_company’]); unset($fields[‘shipping’][‘shipping_address_1’]); unset($fields[‘shipping’][‘shipping_address_2’]); unset($fields[‘shipping’][‘shipping_city’]); unset($fields[‘shipping’][‘shipping_postcode’]); unset($fields[‘shipping’][‘shipping_country’]); unset($fields[‘shipping’][‘shipping_state’]); // Remove order comment fields unset($fields[‘order’][‘order_comments’]); return $fields; }…Continue reading

Show Terms By Default

function sumobi_edd_show_terms_agreement() { global $edd_options; /*print_r($edd_options);*/ if ( isset( $edd_options[‘show_agree_to_terms’] ) ) { ?>Continue reading