/** * 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
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
// Remove tags add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
add_filter(‘wpcf7_autop_or_not’, ‘__return_false’);Continue reading
add_filter( ‘yith_ywpo_pre_order_product_label’, function($message, $pre_order, $id, $cart_item) { return ‘Questo prodotto potrebbe subire ritardi rispetto ai tempi di spedizione standard’; }, 10, 4 );Continue reading
add_filter(“gtm_ecommerce_woo_item”, function($item, $product) { $item->setItemId($product->get_sku()); return $item; }, 10, 2);Continue reading
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
// add upsells below add-to-cart button add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_upsell_display’, 40 );Continue reading
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
add_action( ‘template_redirect’, function() { if (is_404()) { wp_safe_redirect(home_url()); exit(); } } );Continue reading