Okay
  Public Ticket #2510633
Shortcode Login
Closed

Comments

  • Douglas started the conversation

    Hello!

    Here again, from here in the Brazilian lands, a big hug for the B2BKing team!

    My question is simple:

    There is Shortcode [b2bking_b2b_registration_only] for only the Registration form.

    Isn't there a shortcode just for login?
    I ask this because the WorPress login does not serve me, and I would like to put the separate login and registration in different columns.

  •  2,365
    WebWizards replied

    Hi Douglas and a big hug to you as wellsmile.png 

    B2BKing does not have such a shortcode but you can add a snippet to functions.php to create one:

    /**
     * @snippet       WooCommerce User Login Shortcode
     * @how-to        Get CustomizeWoo.com FREE
     * @author        Rodolfo Melogli
     * @compatible    WooCommerce 4.0
     * @donate $9     https://businessbloomer.com/bloomer-armada/
     */
      
    add_shortcode( 'wc_login_form_bbloomer', 'bbloomer_separate_login_form' );
      
    function bbloomer_separate_login_form() {
       if ( is_admin() ) return;
       if ( is_user_logged_in() ) return; 
       ob_start();
       woocommerce_login_form( array( 'redirect' => 'https://custom.url' ) );
       return ob_get_clean();
    }

    In the snippet above you should replace the link after ‘redirect’ with a link to my account or where you want it to take users after login.

    After adding this snippet, you can use the short code [wc_login_form_bbloomer] for the login.


    I haven’t tested it but I think it should work.


    Let me know if I can help you with anything else,

    Have a great day,

    Stefan


  •   Douglas replied privately
  •  2,365
    WebWizards replied

    Hi Douglas,

    The issue with that notice can get complex:

    1) It's dependant on cookies. If there is any reason your browser/website cannot set/disallows cookies (E.g. you are running the browser in incognito mode or something blocks cookies) that could be the reason. 

    In the past before version 1.4.1 there were issues where that notice would show up only half the time and we fixed it by adding this to the plugin "do_action( 'woocommerce_set_cart_cookies',  true );", but I haven't seen that issue in many months.

    2) I suppose it could be affected by caching, if you have any caching plugins like WP Rocket, Lite Speed Cache, even Jetpack, etc, you can try to disable those temporarily for testing.

    3) I tried accessing your link but all I get is: https://prnt.sc/u2n2nd

    4) if possible with your setup, you could add a product to cart first, and then try to register the user, just to see if that makes a difference (using the cart sets cookies)



  •   Douglas replied privately
  •   WebWizards replied privately
  •   Douglas replied privately
  •   WebWizards replied privately
  •   WebWizards replied privately
  •   Douglas replied privately
  •   WebWizards replied privately
  •   Douglas replied privately
  •   Douglas replied privately
  •   WebWizards replied privately