Changing My Account block links

I need to remove some of the links that appear in the “My Account” block, including the dropdown in the top right.



I was able to remove some on the bottom block, but I need to remove more specifically “Profile details” and “My points” from both sections.



I tried editing the my_account.tpl in “templates/blocks…”, but doesn’t do anything, even after clearing cache.



If that’s not possible or if it’s easier to do, how do you change what fields appear in the “Profile details” update page? I don’t want customers to be able to edit their email address, billing, and shipping address. We take care of that for the customer.





Using v 4.0.3.



Thanks.

[quote name='fishtail' timestamp='1387066205' post='173518']

I need to remove some of the links that appear in the “My Account” block, including the dropdown in the top right.



I was able to remove some on the bottom block, but I need to remove more specifically “Profile details” and “My points” from both sections.



I tried editing the my_account.tpl in “templates/blocks…”, but doesn't do anything, even after clearing cache.



If that's not possible or if it's easier to do, how do you change what fields appear in the “Profile details” update page? I don't want customers to be able to edit their email address, billing, and shipping address. We take care of that for the customer.





Using v 4.0.3.



Thanks.

[/quote]

Hi fishtial

If you disable the rewards points add on it should get rid of the link in the accounts menu.



Alan

[quote name='Takestock' timestamp='1387118621' post='173539']

Hi fishtial

If you disable the rewards points add on it should get rid of the link in the accounts menu.



Alan

[/quote]



Thanks Alan. The “points” link is now gone. Any way to hide the “Profile Details” page, or at least disable the customers to be able to change their addresses?

Use HTML Comment tags around the desired anchor tags you wish to hide.



To remove from My Account Links (Footer)



Edit: blocks/static_templates/my_account_links.tpl






To remove from My Account (Header)



Edit: blocks/my_account.tpl








Clear Cache via admin.php?ctpl&cc

HI Fishtail

As per above by requincreative, to find the line of code go to design/ template editor/ templates/ blocks / my_account.tpl



Line 21 This is good for a quick fix but may get overwritten on next upgrade, The best way to do this is to use mychanges add on

do a hook of the lines of code that you want to change and then make your changes there.

Hook is from line 10 to 33



{hook name=“profiles:my_account_menu”}

{if $auth.user_id}

{if $user_info.firstname || $user_info.lastname}

  • {$user_info.firstname} {$user_info.lastname}


  • {else}

    {if $settings.General.use_email_as_login == 'Y'}

  • {$user_info.email}


  • {else}

  • {$user_info.user_login}


  • {/if}

    {/if}



  • {(“downloads”)}


  • {elseif $user_data.firstname || $user_data.lastname}

  • {$user_data.firstname} {$user_data.lastname}


  • {elseif $settings.General.use_email_as_login == 'Y' && $user_data.email}

  • {$user_data.email}


  • {elseif $settings.General.use_email_as_login != 'Y' && $user_data.user_login}

  • {$user_data.user_login}


  • {/if}

  • {(“orders”)}


  • {assign var=“compared_products” value=“”|fn_get_comparison_products}

  • {__(“view_compare_list”)}{if $compared_products} ({$compared_products|count}){/if}


  • {/hook}



    Loads of threads about hooks I am only learning myself.



    To remove the bottom my profile link,

    While in template editor / the dropdown beside the save changes button has a link, Onsite template editing.

    you can go to the bottom account menu and delete the link there



    Alan

    Thanks Alan and requincreative. I tried using the comment tags and it worked great. I haven't tried the hooks yet, because, well they scare me. I really don't understand how to use them properly and I don't want to mess up my “work-in-progress site”.



    Another thing I was trying to accomplish instead of hiding the “Profile details” page entirely is to just “gray out” or disable the input fields (such as “email” for example).



    I tried adding “disabled=disabled” in the input tag of this file for email:



    “design/themes/basic/templates/views/profiles/components/profile_fields.tpl”



    but nothing is affected on the site even if I clear the cache. I also tried to simply delete the input tag completely, but still no changes. Do I have the wrong file for this?



    Thanks.



    P.S. Do you guys know of any thread that teaches how to use the My_Changes add-on fully? I only found KB articles for css changes.

    HI Fishtail

    If anything you have more chance of messing up your site by altering the original files. There are lots of posts which detail out using hooks. But none that I can find that give all the info.

    But in simple terms, If you look at the .tpl files you will see a starting hook tag {hook name=“profiles:my_account_menu”} and then code and then a closing hook tag {/hook}

    What this means is that you can change this code, place something after the code or overwrite it completely from an external file using the my changes addon



    You do not actually change the code directly within the .tpl you are diverting to your own file with the changes completed there.

    But this is done automatically by the hook code, you do not have to alter the original file.



    Here is a link to a tread that helped me a lot.

    Setting price to Zero and showing custom message 4.03 - Multi-Vendor Edition - CS-Cart Community Forums



    In your case you would copy the code



    {hook name=“profiles:my_account_menu”}

    {if $auth.user_id}

    {if $user_info.firstname || $user_info.lastname}

  • {$user_info.firstname} {$user_info.lastname}

  • {else}
    {if $settings.General.use_email_as_login == 'Y'}
  • {$user_info.email}

  • {else}
  • {$user_info.user_login}

  • {/if}
    {/if}

  • {__("downloads")}

  • {elseif $user_data.firstname || $user_data.lastname}
  • {$user_data.firstname} {$user_data.lastname}

  • {elseif $settings.General.use_email_as_login == 'Y' && $user_data.email}
  • {$user_data.email}

  • {elseif $settings.General.use_email_as_login != 'Y' && $user_data.user_login}
  • {$user_data.user_login}

  • {/if}
  • {__("orders")}

  • {assign var="compared_products" value=""|fn_get_comparison_products}
  • {__("view_compare_list")}{if $compared_products} ({$compared_products|count}){/if}

  • {/hook}

    put it in a new file called my_account_menu.override.tpl and place it in a folder /design/themes/[b]your template/[/b]templates/addons/my_changes/hooks/profiles

    make your changes to the new file
    [b][/b]

    Save and clear the cache.

    This is assuming you have setup the my changes addon.

    On the other point I tried adding "disabled=disabled" in the input tag of this file for email:

    No sure on this but try using True or False instead of disabled

    Alan

    Have you looked at the developer documentation for hooks?

    Hello. Using cscart v 4.2.4.



    For the life of me! I can't make this work!



    I created the folder



    /design/themes/responsive/templates/addons/my_changes (should this exist already?)

    /design/themes/responsive/templates/addons/my_changes/hooks/profiles/



    and created inside of that the file:



    my_account_menu.override.tpl



    copy/pasted the hook from my_account.tpl altered and saved. cleared cache, no changes.



    Am I doing something wrong?

    Struggling with the same problem in v4.2.2:

    I want to remove the link to the userlog of Reward Points (not the menu item, only the link). This is not part of the my_account template but added by some layout hook in the reward_points addon. Where can I find it there (without disabling the addon)?

    I just spotted a hot trace in the files of /design/backend/templates/addons/reward_points/hooks/profiles/. Well hidden...

    Not hidden at all. That is where a profile hook for an addon would go.