• Resolved paulpa82

    (@paulpa82)


    Is it possible to get the top bar hide\fade when the cart button is pressed.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    Thanks for reaching out to us.

    I checked the link and am not sure which top bar you are referring to. Were you using our “MailChimp Top Bar” plugin?

    Thread Starter paulpa82

    (@paulpa82)

    Sorry I reenabled it now. Should be there again.

    Also is there an ability to remember if a user has registered and hide the bar?

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    You can use the following code to set a cookie whenever someone subscribes using the “Top Bar” plugin.

    
    /**
    * Set cookie when Top Bar is used to subscribe
    */
    add_action( 'mctb_subscribed', function() {
       $expires = time() + ( 60 * 60 * 24 * 30 ); // 30 days
       setcookie( 'mctb_hide_bar', '1', $expires, '/' );
    });
    /**
    * Do not load Top Bar when cookie exists
    */
    add_filter( 'mctb_show_bar', function( $show ) {
       return $show && empty( $_COOKIE['mctb_hide_bar'] );
    });

    You will need to add the above code to the “functions.php” file located inside your active theme folder.

    Once the cookie is set, if they visit the page again, the top bar will stay hidden for 30 days.

    Thread Starter paulpa82

    (@paulpa82)

    Thanks Harish, just had to do some edits, and move away from the top bar, just couldn’t get it to fit with my theme.

    All working well now, but just need to remove the form all together on the mobile when they re-visit.

    How do I edit the above cookies to do same?

    The row-id is #mcp_subscribe

    Thanks for all your help!

    • This reply was modified 6 years, 5 months ago by paulpa82.
    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello,

    Are you still using “MailChimp Top Bar”? The code I provided was for the same.

    Thread Starter paulpa82

    (@paulpa82)

    I went back to the normal mailchiml for WordPress form not topbar.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Mailchimp and Cart’ is closed to new replies.