Forum Replies Created
-
AuthorPosts
-
Hi Rahim, 1. Yes, it bad experience for user after login it redirect to a page they don’t want. I search but do not find a solution. If i found i will share with you. 2. I checked your site it work well http://take.ms/5BXmU like on lTR layout http://take.ms/lCc0r Please clear cache and check again. Regards
Hi Harry,
This was happening on my site because of a function that I have added.
The core of Woocommerce is working fine. If you login in the checkout page, you will be redirect back to the checkout page.
I have found three different functions for login and logout over the net which I would like to share with you.
/* Redirect to home page after sign up */ function iconic_register_redirect( $redirect ) { return wc_get_page_permalink( 'https://look.ir' ); } add_filter( 'woocommerce_registration_redirect', 'iconic_register_redirect' );
/* Redirect to home page after logout */ add_action('wp_logout','auto_redirect_after_logout'); function auto_redirect_after_logout(){ wp_redirect( home_url() ); exit(); }
/* Redirect to home page after any Login */ add_filter('woocommerce_login_redirect', 'wc_login_redirect'); function wc_login_redirect( $redirect_to ) { $redirect_to = home_url(); return $redirect_to; }
I recommend you to add the number 2 to the theme’s functions, because in default mode of the theme, customers after logout are redirect to the default WordPress login page, which is not related to the customers in frront-end.
My problem on checkout page was coming from number 3
Regards.
Rahim Vaziri
CEO & Founder at Look.irHello Guys,
I found this function very helpful.
By adding this to your functions.php of your child-theme (if child-theme is active) you can make the customer to double check his password on two places of account creation. on the my-account page & checkout page.
Hope you enjoy. 🙂
The code is this:
// ----- validate password match on the registration page function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { global $woocommerce; extract( $_POST ); if ( strcmp( $password, $password2 ) !== 0 ) { return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) ); } return $reg_errors; } add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3); // ----- add a confirm password fields match on the registration page function wc_register_form_password_repeat() { ?> <p class="form-row form-row-wide"> <label for="reg_password2"><?php _e( 'Password Repeat', 'woocommerce' ); ?> <span class="required">*</span></label> <input type="password" class="input-text" name="password2" id="reg_password2" value="<?php if ( ! empty( $_POST['password2'] ) ) echo esc_attr( $_POST['password2'] ); ?>" /> </p> <?php } add_action( 'woocommerce_register_form', 'wc_register_form_password_repeat' ); // ----- Validate confirm password field match to the checkout page function lit_woocommerce_confirm_password_validation( $posted ) { $checkout = WC()->checkout; if ( ! is_user_logged_in() && ( $checkout->must_create_account || ! empty( $posted['createaccount'] ) ) ) { if ( strcmp( $posted['account_password'], $posted['account_confirm_password'] ) !== 0 ) { wc_add_notice( __( 'Passwords do not match.', 'woocommerce' ), 'error' ); } } } add_action( 'woocommerce_after_checkout_validation', 'lit_woocommerce_confirm_password_validation', 10, 2 ); // ----- Add a confirm password field to the checkout page function lit_woocommerce_confirm_password_checkout( $checkout ) { if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) { $fields = $checkout->get_checkout_fields(); $fields['account']['account_confirm_password'] = array( 'type' => 'password', 'label' => __( 'Confirm password', 'woocommerce' ), 'required' => true, 'placeholder' => _x( 'Confirm Password', 'placeholder', 'woocommerce' ) ); $checkout->__set( 'checkout_fields', $fields ); } } add_action( 'woocommerce_checkout_init', 'lit_woocommerce_confirm_password_checkout', 10, 1 );
For sure you can use your own translation on the code.
Thanks to Harry and the JanStudio team for great support.
Regards.
Rahim Vaziri
CEO & Founder at Look.irHi Harry,
Is there any chance to fix it via css?
I added this and it works now. http://take.ms/MStLu
Is the code correct?
div.filter-sidebar { z-index: 10000; }
Regards.
Rahim Vaziri
CEO & Founder at Look.irHi Harry,
How can I change these numbers? As I see these are in the html and I checked your demo with the same numbers.
I added this code:
/* logo on footer */ img.mb__15.size-full { width: 60% !important; margin-bottom: 0px !important; } @media only screen and (max-width: 736px) { img.mb__15.size-full { width: 45% !important; }}
Did I add a right css code for this?
If it’s wrong help me for the right code please, I want the logo to be something like this on desktop and mobile.
Regards.
Rahim Vaziri
CEO & Founder at Look.irHi Harry,
Is this all?
I mean that, do I need to add any shortcode or any other thing in here?
This is the shortcode of the plugin :
[wcas-search-form]
Regards.
Rahim Vaziri
CEO & Founder at Look.irAs you know in here, this
","
separates the values of variations.Regards.
Rahim Vaziri
CEO & Founder at Look.irHi Harry,
Hope you are doing very well.
According to this topic I recommend you to analyze the Ajax Search for WooCommerce
I installed and just added it to my widget area to just test it. Check this :
https://monosnap.com/file/JfgT0CBvH6cOnfmmlfoYfYdjOyfBS5
And I found out that this plugin finds the results when I search in Persian,
As you remember, the theme only finds the search in English.
I hope you find a solution for this.
Many customers are not English.
Regards.
Rahim Vaziri
CEO & Founder at Look.irHi Harry,
I applied the code, but the page number which is active goes up. http://take.ms/q89iX
any chance to increase the space of action without this?
Regards.
Rahim Vaziri
CEO & Founder at Look.irHi Harry,
Could you please check this on my site? Look.ir/mag
I applied the code and cleared the cache but still same as before.
Regards.
Rahim Vaziri
CEO & Founder at Look.irAnd Harry,
Is the code you gave me for Woocommerce coupon fix RTL?
Rahim Vaziri
CEO & Founder at Look.ir -
AuthorPosts