This topic has 13 replies, 2 voices, and was last updated 7 years, 11 months ago ago by Eva Kemp
Hello i will try to make my question as clear as possible. PLEASE read carefully and reply as soon as possible because this is an urgent matter and we cant go live because of this.
In woocommerce settings we want the “Your Account” page to be /my-account.
BUT the login page we want it to be a different page because we are using a plugin for login.
Currently the theme is connecting both “Your Account” and Login link to /my-account.
When user is not logged and presses Sign In it directs them to /My-Account to sign in/sign up and then if they want to see their woocommerce account they click on “Your Account”
We want to keep the “Your Account” directing them to /my-account as we set it up on woocommerce.
But the Sign In link we want them to direct them to /register.
Can you help? We don’t want big customization, we only need to direct the sign in link to a different page.
Thanks
PLEASE REPLY URGENTLY.
Hello,
“Sign In” and “My Account” links redirect to one woocommerce page, but you want to redirect them to different pages.
We don’t provide such customization.
As this is Woocommerce configuration you may contact their support or search for some of extensions they provide.
Regards,
Eva Kemp.
Can you show me a way of disabling the sign in link that is currently active and replacing it with a different one? I cant think of any easier option. Disable sign in but use a new link at it’s place. That way we can achieve what we want. Please help
PLEASE see this reply that you gave me in my other post ( before you closed it ). Can you please explain to me what this code does and how to put it in the child theme ?
Hello,
Please edit the file wp-content/themes/legenda/framework/theme-functions.php in line 1300, edit the code
<?php if(class_exists('Woocommerce')): ?><li class="login-link"><a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"><?php _e( 'Sign In', ETHEME_DOMAIN ); ?></a></li><?php endif; ?>
Replace the string <?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?> with your url of the page you need.
So it will be like this:
<?php if(class_exists('Woocommerce')): ?><li class="login-link"><a href="http://domain.com/some_page"><?php _e( 'Sign In', ETHEME_DOMAIN ); ?></a></li><?php endif; ?>
Best regards,
Jack Richardson.
Hello,
In the previous topic you were told how to add code in child theme:
To add the code to child theme you need copy whole function code and add it to functions.php file in the child theme:
if(!function_exists('etheme_top_links')) {
function etheme_top_links() {
?>
<ul class="links">
<?php if ( is_user_logged_in() ) : ?>
<?php if(class_exists('Woocommerce')): ?> <li class="my-account-link"><a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"><?php _e( 'Your Account', ETHEME_DOMAIN ); ?></a>
<div class="submenu-dropdown">
<?php if ( has_nav_menu( 'account-menu' ) ) : ?>
<?php wp_nav_menu(array(
'theme_location' => 'account-menu',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'depth' => 4,
'fallback_cb' => false
)); ?>
<?php else: ?>
<h4 class="a-center install-menu-info">Set your account menu in <em>Apperance > Menus</em></h4>
<?php endif; ?>
</div>
</li><?php endif; ?>
<li class="logout-link"><a href="<?php echo wp_logout_url(home_url()); ?>"><?php _e( 'Logout', ETHEME_DOMAIN ); ?></a></li>
<?php else : ?>
<?php
$reg_id = etheme_tpl2id('et-registration.php');
$reg_url = get_permalink($reg_id);
?>
<?php if(class_exists('Woocommerce')): ?><li class="login-link"><a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"><?php _e( 'Sign In', ETHEME_DOMAIN ); ?></a></li><?php endif; ?>
<?php if(!empty($reg_id)): ?><li class="register-link"><a href="<?php echo $reg_url; ?>"><?php _e( 'Register', ETHEME_DOMAIN ); ?></a></li><?php endif; ?>
<?php endif; ?>
</ul>
<?php
}
}
and edit only this part:
<?php if(class_exists('Woocommerce')): ?><li class="login-link"><a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"><?php _e( 'Sign In', ETHEME_DOMAIN ); ?></a></li><?php endif; ?>
This code <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>">
gives the link of My Account page, you can replace it with your url, just replace <?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>
with your page link.
If you have difficulties editing the code we suggest you to hire a freelancer who will make all customizations you need.
Regards,
Eva Kemp.
So this code edits the Sign In button ? Or the my account button too ?
Where is the function.php file in the ftp? The one i found has only 3lines of code in it!
fixed it. thanks
Hello,
As you can see there is title “Sign In” in the code:
<?php if(class_exists('Woocommerce')): ?><li class="login-link"><a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>"><?php _e( 'Sign In', ETHEME_DOMAIN ); ?></a></li><?php endif; ?>
so it edits Sign In link.
Have you created child theme?
Create it and create functions.php file inside the child theme folder.
Again if you have difficulties would be better if you hire a developer.
Regards,
Eva Kemp.
I have created a child theme and i added the code we discussed from editor, is that correct?
Hello,
Yes, it’s correct.
Regards,
Eva Kemp.
Thanks, this means if i update, woocommerce, the theme or wordpress it won’t get lost?
Hello,
If the changes are made in child theme you won’t lose them.
Regards,
Eva Kemp.
Tagged: links, login, my account, persuasive, themes, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up