Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › Option to keep user on current page after login or log out
- This topic has 3 replies, 2 voices, and was last updated 9 years, 8 months ago by veramilo.
-
AuthorPosts
-
February 27, 2015 at 9:29 pm #12284veramiloSpectator
On my checkout page, I want registered users who are not logged in to be reminded to log in before checking out, and I want them to be able to log in right on the checkout page. I also don’t want to force unregistered users to register before they can check out. Basically, I don’t want any users — registered or not — to be lead away from the checkout page before checking out unless there’s absolutely no other way around it.
I’m going to display one of these messages at the top of my checkout page/cart (I’ll use existing content protection shortcodes to control which message displays based on login status):
For anonymous users:
“If you’re already registered, please click here to log in now so you can have immediate access to your downloads. If you have not registered, please proceed with your checkout and you will receive instructions by email.” {The underlined link will go to a special login-from-cart page that opens in a separate window; there will also be a link back to the cart}
For logged in users:
“You are currently logged in as [wp_eMember_user_details user_info=”user”]. If you are not [wp_eMember_user_details user_info=”user”], please log out and then log in again with the correct credentials. {The underlined link will go to the same page described above to log out/in.}
I’m hoping a more easily customizable (and user-friendly) shortcode would eliminate the need to switch to another page at all so I’d like to propose a couple new shortcode ideas with parameters relevant to the above:
[wp_eMember_custom_login text=”click here to log in now” redirectURL=”http://www….”] {displays same popup login as the one displayed for [wp_eMember_compact_login] and perhaps another popup to verify the user is logged in}
[wp_eMember_custom_logout text=”log out” redirectURL=”http://www….”] {displays a popup for the user to accept that he wants to log out and perhaps another popup to verify he is logged out}
text= is the text to be hyperlinked. Clicking it would pop up a login box like for the compact login shortcode.
redirectURL= is a specific page to redirect to. By entering the URL of the current page, the page may refresh but the user is not directed away from it. It might be better to use redirectURL=0 to prevent redirection, but I’d still like the option of entering a URL to a different page to allow flexibility for other uses.
If a shortcode similar to this already exists, I have not been able to find it. Can you please direct me to it? I’ve already customized the [wp_eMember_compact_login_custom] shortcode for general logins so I don’t want to interfere with that, but it doesn’t address this particular issue anyway since it directs the user away from the current page after login and it can’t be embedded in a sentence.
I’m using the latest versions of eMember & WP.
Thanks!
February 28, 2015 at 11:42 pm #68811adminKeymasterI think all you need to do is make a few little changes and use use signup scenario 3. See the following documentation:
https://www.tipsandtricks-hq.com/wordpress-membership/a-typical-member-registration-flow-96
Amazon’s site uses a similar checkout flow like that. You won’t need to have too many “if” and “else” options then (less confusing for your visitors).
March 2, 2015 at 4:30 pm #68812veramiloSpectatorI was originally using Scenario 3.1 but the shop owner didn’t want to force people to register before purchasing. He wants that to happen after they’ve already checked out — in order to access their digital products.
Scenario 3 also requires login prior to purchase. I know Amazon uses that flow, but they have millions of products and recurring customers and we only have one product right now. The shop owner knows his audience and says if we make them jump through hoops to buy one product, many will abandon the purchase. But once they’ve paid, they’re more likely to do what they need to in order to get the product.
March 2, 2015 at 8:34 pm #68813veramiloSpectatorI just tested the checkout flow as if I were an anonymous buyer. After paying for the digital download, the buyer is sent an email asking them to complete their registration. This is exactly what I wanted to happen, but I didn’t see anywhere in the scenarios that this was an option…
It took a while of thinking, but I finally figured out what was going on: It’s because my “digital product” is really a membership “disguised” as a downloadable product. In other words, I’m pitching video downloads, not memberships, but the visitor is buying membership access to the download page — it just doesn’t appear that he’s buying a membership.
All I need to do now is figure out how to recompose the email so it makes sense for both free memberships and purchased downloads (which is — under the surface — a membership but I don’t want to confuse them into thinking they bought a membership rather than video downloads). I’m confident I can do it.
Thank you.
-
AuthorPosts
- You must be logged in to reply to this topic.