Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Changing My Account block links Rate Topic   - - - - -

 
  • fishtail
  • Member
  • Members
  • Join Date: 11-Jan 10
  • 123 posts

Posted 15 December 2013 - 12:10 AM #1

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.

 
  • Takestock
  • Senior Member
  • Members
  • Join Date: 08-Nov 13
  • 505 posts

Posted 15 December 2013 - 02:43 PM #2

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.

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

Alan

 
  • fishtail
  • Member
  • Members
  • Join Date: 11-Jan 10
  • 123 posts

Posted 19 December 2013 - 02:47 AM #3

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

Alan


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?

 

Posted 19 December 2013 - 03:05 AM #4

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

<!--<li><a href="{"profiles.update"|fn_url}">{__("profile_details")}</a></li>-->

To remove from My Account (Header)

Edit: blocks/my_account.tpl

<!--<li><a href="{"profiles.update"|fn_url}" rel="nofollow" class="underlined">{__("profile_details")}</a></li>-->


Clear Cache via admin.php?ctpl&cc

Jeremy
Requin Creative Group
CS-Cart License | CS-Cart Addons


 
  • Takestock
  • Senior Member
  • Members
  • Join Date: 08-Nov 13
  • 505 posts

Posted 19 December 2013 - 07:27 AM #5

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}
<li class="user-name">{$user_info.firstname} {$user_info.lastname}</li>
{else}
{if $settings.General.use_email_as_login == 'Y'}
<li class="user-name">{$user_info.email}</li>
{else}
<li class="user-name">{$user_info.user_login}</li>
{/if}
{/if}
<!--<li><a href="{"profiles.update"|fn_url}" rel="nofollow" class="underlined">{__("profile_details")}</a></li>-->
<li><a href="{"orders.downloads"|fn_url}" rel="nofollow" class="underlined">{__("downloads")}</a></li>
{elseif $user_data.firstname || $user_data.lastname}
<li class="user-name">{$user_data.firstname} {$user_data.lastname}</li>
{elseif $settings.General.use_email_as_login == 'Y' && $user_data.email}
<li class="user-name">{$user_data.email}</li>
{elseif $settings.General.use_email_as_login != 'Y' && $user_data.user_login}
<li class="user-name">{$user_data.user_login}</li>
{/if}
<li><a href="{"orders.search"|fn_url}" rel="nofollow" class="underlined">{__("orders")}</a></li>
{assign var="compared_products" value=""|fn_get_comparison_products}
<li><a href="{"product_features.compare"|fn_url}" rel="nofollow" class="underlined">{__("view_compare_list")}{if $compared_products} ({$compared_products|count}){/if}</a></li>
{/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

 
  • fishtail
  • Member
  • Members
  • Join Date: 11-Jan 10
  • 123 posts

Posted 20 December 2013 - 07:21 AM #6

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.

 
  • Takestock
  • Senior Member
  • Members
  • Join Date: 08-Nov 13
  • 505 posts

Posted 20 December 2013 - 10:27 AM #7

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.
http://forum.cs-cart...__fromsearch__1

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}
<li class="user-name">{$user_info.firstname} {$user_info.lastname}</li>
{else}
{if $settings.General.use_email_as_login == 'Y'}
<li class="user-name">{$user_info.email}</li>
{else}
<li class="user-name">{$user_info.user_login}</li>
{/if}
{/if}
<!--<li><a href="{"profiles.update"|fn_url}" rel="nofollow" class="underlined">{__("profile_details")}</a></li>-->
<li><a href="{"orders.downloads"|fn_url}" rel="nofollow" class="underlined">{__("downloads")}</a></li>
{elseif $user_data.firstname || $user_data.lastname}
<li class="user-name">{$user_data.firstname} {$user_data.lastname}</li>
{elseif $settings.General.use_email_as_login == 'Y' && $user_data.email}
<li class="user-name">{$user_data.email}</li>
{elseif $settings.General.use_email_as_login != 'Y' && $user_data.user_login}
<li class="user-name">{$user_data.user_login}</li>
{/if}
<li><a href="{"orders.search"|fn_url}" rel="nofollow" class="underlined">{__("orders")}</a></li>
{assign var="compared_products" value=""|fn_get_comparison_products}
<li><a href="{"product_features.compare"|fn_url}" rel="nofollow" class="underlined">{__("view_compare_list")}{if $compared_products} ({$compared_products|count}){/if}</a></li>
{/hook}

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

make your changes to the new file
<!--<li><a href="{"profiles.update"|fn_url}" rel="nofollow" class="underlined">{__("profile_details")}</a></li>-->

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

 
  • NairdaCart
  • Senior Member
  • Members
  • Join Date: 18-Jul 11
  • 306 posts

Posted 20 December 2013 - 11:38 AM #8

Have you looked at the developer documentation for hooks?

 
  • scooterlord
  • Advanced Member
  • Members
  • Join Date: 29-Jun 13
  • 111 posts

Posted 09 February 2015 - 11:26 AM #9

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?

 
  • simon84
  • Newbie
  • Trial users
  • Join Date: 04-Jun 17
  • 9 posts

Posted 09 December 2017 - 09:03 AM #10

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)?



 
  • simon84
  • Newbie
  • Trial users
  • Join Date: 04-Jun 17
  • 9 posts

Posted 09 December 2017 - 09:13 AM #11

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



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12156 posts

Posted 09 December 2017 - 11:06 PM #12

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


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.