Customised My_Account.tpl

Hi there,

We've customised the my_account.tpl in such a way that if the user is not logged in, the “Sign in with Google” and “Sign in with Linkedin” button appear on the store and after the user has logged in, it gets converted into the [color=#ff0000]My account [/color]dropdown where instead of My account, the username/firstname of the customer comes.



The problem which we are facing is that when a user clicks on the “Sign in with Linkedin” img or Sign in with Google, the my account dropdown comes, which appears as a bug.



We are using the hybrid_auth for using the sign in options. Also we are using Myaccount block, we have used the on-click dropdown option



Here's the code of the my_account.tpl file{only including till the capture part}



{** block-description:my_account **}
{if $auth.user_id}
{if $user_info.firstname || $user_info.lastname}
{capture name="title"}
{$user_info.firstname} {$user_info.lastname}
{/capture}
{else}
{if $settings.General.use_email_as_login == 'Y'}

{capture name="title"}
{$user_info.email}
{/capture}

{else}
{capture name="title"}
{$user_info.user_login}
{/capture}
{/if}
{/if}
{else}
{capture name="title"}
{include file="addons/hybrid_auth/hooks/index/login_buttons.pre.tpl"}
{/capture}
{/if}




Also, the content of login_buttons.pre.tpl[part of hybrid_auth] is as follows


```php

{capture name=“hybrid_auth”}

{strip}

{foreach $addons.hybrid_auth key=“option_name” item=“value”}

{if $option_name|strpos:“_status” !== false && $value == “Y”}

{$provider_id = “_status”|str_replace:“”:$option_name}



{/if}

{/foreach}

{/strip}

{/capture}

{if $smarty.capture.hybrid_auth}

{__(“hybrid_auth_social_login”)}:

{$smarty.capture.hybrid_auth nofilter}


{/if}
```

Also, I'm attaching the screenshot of the error. We tested this on [b]mv4.1.3[/b]

Suggestions would be highly appreciated.

Thanks in advance

Regards,
NaMo

sign_in.PNG

@NaMo,



Please try to add the following code for the unlogged state:



{capture name="no_content"}true{/capture}




Then open the “onclick_dropdown.tpl” and replace this code:


```php


{$content|default:" " nofilter}

```

with:

```php
{if !$smarty.capture.no_content}

{$content|default:" " nofilter}

{/if}
```

Thanks.

Hi eComLabs,

Thanks a lot for the answer. Just a quick query.

As you mentioned

“[color=#282828][font=arial, verdana, tahoma, sans-serif]Please try to add the following code for the unlogged state:[/font][/color]”


{capture name="no_content"}true{/capture}




As the unlogged state already has the following code


{capture name="title"}
{include file="addons/hybrid_auth/hooks/index/login_buttons.pre.tpl"}
{/capture}


Therefore, where should we place it. I mean above it or enclosing it.

I guess I might be wrong in identifying the unlogged state.

[quote name='NaMo' timestamp='1396619094' post='180989']

Hi eComLabs,

Thanks a lot for the answer. Just a quick query.

As you mentioned

“[color=#282828][font=arial, verdana, tahoma, sans-serif]Please try to add the following code for the unlogged state:[/font][/color]”


{capture name="no_content"}true{/capture}




As the unlogged state already has the following code


{capture name="title"}
{include file="addons/hybrid_auth/hooks/index/login_buttons.pre.tpl"}
{/capture}


Therefore, where should we place it. I mean above it or enclosing it.

I guess I might be wrong in identifying the unlogged state.

[/quote]



For example,



...
{else}
{capture name="no_content"}true{/capture}
{capture name="title"}
{include file="addons/hybrid_auth/hooks/index/login_buttons.pre.tpl"}
{/capture}
{/if}
...




Thanks.

Sure, thanks a lot. I'll try it

PM me if you face any problem

Hi , can you help me, with same exact thing, only i want for facebook login. Thanks.

[quote name='florinsurdu' timestamp='1397036154' post='181348']

Hi , can you help me, with same exact thing, only i want for facebook login. Thanks.

[/quote]

Sure, I'd be happy to help. Can you share the code you've written till yet?

I didn`t write any code yet. I need a suggention, and i will solve that after. or, if you can help me, i will thank you , a lot.