-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding pretty permalinks for checkout #2446
base: dev
Are you sure you want to change the base?
Adding pretty permalinks for checkout #2446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works great and looks good to me. Just a couple of minor comments from my side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well on my side.
Would it be an option to reference the new URLs from the Membership Levels page as well instead of /?level=X?
Great idea! We would need to decide whether we would want to use |
I'm thinking of delaying until 3.0 or like a 2.12 release. I think we need the following to merge this:
|
Should this be a new column in the
As written, we only flush rewrite rules when the page settings page is saved or the option to generate pages is selected. Is this ok or should we only flush when the checkout page is specifically changed? Side note: We need to make sure to also flush rewrite rules when pages are generated by the setup wizard
If we are releasing in 3.0, do we still need some kind of opt-in system? What are the use cases that would not want pretty permalinks to be an option? |
It seems like we need to have things work without pretty permalinks one. This is still common on new/dev sites and not uncommon on live sites even. (As far as I know.) Further we want something like ../membership-checkout/?level=1 to redirect to ../membership-checkout/level-slug/ if "pretty permalinks are enabled", aka if the "permalink_structure" option is NOT empty. If it is empty, then we want to just load the page. We can try to figure out how core WP does "canonical redirects". Maybe there are helper functions for this or we can match when they do the redirect. Take care of other parameters like discount_code, we want to append it to the pretty URL in the redirect. Checkout forms that for some reason posted directly to .../?level=... will break in the redirect I think. OR we could ignore the redirect if the checkout form is being submitted. Q: What is the SEO impact of 30xing (301? or what does WP do for canonical redirects generally) all the checkout page URLs? |
More info. The current canonical URL of the checkout page is something like this: That doesn't include the ?level=x in it. That may be a good or bad thing in the 2.x versions of PMPro. After this update, the canonical URL will be When pretty permalinks are off in 2.x there is no canonical link tag set in the HTML. |
We've done some more thinking about this. There is too much risk that whatever we do here gets undone by the 3.1 checkout updates, since we're thinking about a more dynamic checkout page that perhaps won't be tied to a single level. I think we also want to avoid BuddyPress like "fake" pages, especially as full site editing in WP develops. If people are looking at a page, they will expect it to behave like a page and be editable like a page. Instead here if you end up on the level 1 page and edit it, you would be editing the checkout page for all levels. Also, the end affect of this is already possible by creating pages as a subpage of checkout and setting the level attribute of the block or custom post value/etc. |
I've set the milestone for 3.1. We will reevaluate then. |
All Submissions:
Changes proposed in this Pull Request:
Allows for passing url-encoded level name or level ID. When testing PR, can flush rewrite rules by saving PMPro Page settings.
For example, if your checkout page is at
yoursite.com/membership-account/membership-checkout
, you should now be able to check out for a specific level by navigating toyoursite.com/membership-account/membership-checkout/[level_id]
oryoursite.com/membership-account/membership-checkout/[level_name_encoded]
Other information:
Changelog entry