Home › Forums › WoodMart support forum › Bug with Login on Category pages
Bug with Login on Category pages
- This topic has 12 replies, 2 voices, and was last updated 1 year, 6 months ago by Luke Nielsen.
-
AuthorPosts
-
September 8, 2022 at 10:19 am #402226
ThoraParticipantHello,
we recognized a bug on category pages.
Normally, when logging in via the slide-in sidebar that is shown when clicking “Login / Register” in the header, the same page is shown after login. That works fine e.g. for homepage, regular pages and single product pages.
But when logging in on product category pages, you are redirected to the shop homepage.
E.g. you can see it on the official demo (but it is also happening on the current theme version):
https://woodmart.xtemos.com/product-category/accessories/Of course, I don’t know your correct login credentials. But when trying a wrong login, I’m redirected to https://woodmart.xtemos.com/shop/ with the login error message on top of the products.
This seems to happen for all category pages, e.g.:
– On a portfolio category page I’m redirected to /portfolio/
– On a blog category page I’m rediected to /blog/September 8, 2022 at 3:00 pm #402309
Luke NielsenKeymasterHello,
Unfortunately, at this time, we are not able to fix that.
Again, we apologize for the inconvenience this may have caused you. Please let us know if there are any further questions or concerns you may have. We are always happy to assist.
Kind Regards
September 8, 2022 at 4:04 pm #402332
ThoraParticipantHello,
is there an ETA for the fix?
Because we aren’t using the shop homepage, there is a redirect from /shop/ to the homepage via “Redirection” plugin.
The serious consequence:
The login information can apparently not be transmitted or processed correctly.
Therefore, only a simple forwarding to the homepage occurs – without login or an error message in case of an incorrect login.September 8, 2022 at 4:55 pm #402347
Luke NielsenKeymasterHello,
I don’t know what the “ETA” means but I can suggest a redirect to the “My Account” page with the help of the below code, paste it to the
functions.php
file in your child theme.add_filter( 'woodmart_my_account_side_login_form_redirect', function () { return get_option( 'woocommerce_myaccount_page_id' ); });
Kind Regards
December 5, 2022 at 1:14 pm #426259
ThoraParticipantHello,
with ETA I meant the Estimated Time of Arrival for the fix.
I don’t understand why it is not possible to implement the desired behavior on all pages, as it is already possible on the home page and product pages:
I can login via Side Login, but am not redirected to another site.Behaviour with the Snippet above:
- Login only possible on Homepage and account page.
- All other WordPress pages, WooCommerce categories and also on product pages:
There’s a browser warning at the login form, that login data is transfered unencrypted.
After clicking „Login“, I’m redirected to http://0.0.0.21/
Thank you in advance.
December 6, 2022 at 4:40 pm #426728
Luke NielsenKeymasterHello,
Could you please describe in more detail what you are trying to achieve now with the redirect? It will help me to dig deeper and find a more personalized solutions.
Looking forward to hearing back from you!
Kind Regards
December 8, 2022 at 6:13 pm #427424
ThoraParticipantHello,
I described it in detail in my first posting, where you answered:
Unfortunately, at this time, we are not able to fix that.
I don’t understand why it’s so difficult to make login behave the same on category pages as on other pages.
And now I recognized, when changing header login link from “sidebar” to “dropdown”, it works!
But we favor the sidebar solution, because dropdown option doesn’t work on mobile.December 8, 2022 at 6:57 pm #427435
ThoraParticipantIs there anything against the following change in the file
/inc/integrations/woocommerce/template-tags.php
in the section „Sidebar login form“?
According to my random tests, everything seems to work.From:
$redirect_url = apply_filters( 'woodmart_my_account_side_login_form_redirect', get_permalink( $page_id ) );
to:
$redirect_url = intval($wp_query->queried_object->ID);
(source)Can you please check and confirm?
Thank you in advance.December 9, 2022 at 3:50 pm #427680
Luke NielsenKeymasterHello,
If that code really works for you, then please remove all changes in the parent theme and paste the below code in the
functions.php
file in your child theme.add_filter( 'woodmart_my_account_side_login_form_redirect', 'wd_custom_login_form_redirect' ); function wd_custom_login_form_redirect( $url ) { global $wp_query; return intval($wp_query->queried_object->ID); }
Kind Regards
December 12, 2022 at 4:08 pm #428197
ThoraParticipantHello,
I have now first adopted the change I mentioned as a workaround. It would be nice to get this fixed in an update.
Is there any need for the original code? I can’t see any benefit with that.Because the PHP snippet you mentioned for functions.php does not work correctly, so only a login on category pages is possible.
On all other tested pages (homepage, regular pages, posts as WooCommerce products) I get a warning message in the login form that the data is transmitted unencrypted. A login is not possible via this, there is a redirection to different IPs like 0.2.58.215 or 0.2.33.227.
December 13, 2022 at 11:43 am #428398
Luke NielsenKeymasterHello,
In this case, if your own changes work better, use them instead of ours.
Thanks for your time and have a great day.
Kind Regards
May 17, 2023 at 10:30 am #467584
ThoraParticipantHello,
it would be nice to get a theme fix or at least an update secure code snippet.
I tried your PHP snippet again with current theme version 7.2.4, but the error I mentioned above still occurs.May 17, 2023 at 2:33 pm #467679
Luke NielsenKeymasterHello,
After careful consideration and evaluation of your request, we regret to inform you that we are unable to create the specific functionality you have described. Let me explain the reasons behind our decision.
Technical Limitations: Our current technology stack or infrastructure may not support the specific functionality you are requesting. Despite our best efforts, implementing it would require significant changes to the underlying system, which may have unforeseen consequences and negatively impact the overall performance and stability of the product.
Resource Constraints: Developing and maintaining new features and functionalities require a substantial amount of time, effort, and resources. At present, we have other priority tasks and commitments that demand our immediate attention. This prevents us from dedicating the necessary resources to fulfill your request without compromising our existing obligations.
Despite our inability to fulfill your request for the specific functionality, we would be more than happy to discuss alternative solutions or workarounds that might address your requirements to some extent. Our team is dedicated to finding ways to meet our customers’ needs within the scope of our capabilities.
We understand that this may be disappointing news, but we genuinely appreciate your understanding of our limitations. We value your feedback and encourage you to continue sharing your ideas and suggestions, as they help us improve our products and services. If you have any further questions or if there’s anything else we can assist you with, please don’t hesitate to reach out to us.
Thank you for your understanding and support.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register