Gravity Forms Login User After Registration.

/** * Snippet Name: Gravity Forms Login User After Registration. */ remove_action(“gform_post_submission”, array(“GFUser”, “gf_create_user”)); add_action(“gform_after_submission”, array(“GFUser”, “gf_create_user”), 10, 2); add_action(“gform_user_registered”, “gforms_autologin”, 10, 4); function gforms_autologin($user_id, $config, $entry, $password) { $form = RGFormsModel::get_form_meta($entry[‘form_id’]); $user_login = apply_filters(“gform_username_{$form[‘id’]}”, apply_filters(‘gform_username’, GFUser::get_meta_value(‘username’, $config, $form, $entry),…Continue reading

Finanziamento Sella con maxirata solo per Z6III

add_filter(‘woocommerce_consel_plans_filter’, function($plans, $order) { if ($order != null) { //se prodotto in promo è contenuto nel carrello, ed è l’unico prodotto $items = $order->get_items(); $product = $order->get_product_from_item( array_pop(array_reverse($items)) ); print_r($product->get_sku()); if ($items && count($items) === 1 && in_array($product->get_sku(), array(‘NMZ640’, ‘NMZ642’,…Continue reading

Disabilita metodi di pagamento se azienda o partita iva

add_filter( ‘woocommerce_checkout_fields’, function( $fields ) { $fields[‘billing’][‘tipologia_cliente’][‘class’][] = ‘update_totals_on_change’; $fields[‘billing’][‘billing_company’][‘class’][] = ‘update_totals_on_change’; $fields[‘billing’][‘billing_piva’][‘class’][] = ‘update_totals_on_change’; return $fields; }, 9999); add_filter( ‘woocommerce_available_payment_gateways’, function($available_gateways) { if ( ! is_admin() && WC()->session ) { $billing_azienda = false; //nikon store ha la tipologia cliente…Continue reading

Nital Legacy User Password Check

add_filter(‘check_password’, function($check, $password, $hash, $user_id) { if ( !$check ) { //se il check standard non è andato a buon fine verifichiamo la password legacy $user_salt = get_user_meta( $user_id, ‘nlup_salt’, true ); if ( $user_salt ) { $check = hash_equals($hash,…Continue reading