-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: add option for a button after checkout #1521
Conversation
53690bd
to
d25e537
Compare
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.
When the custom URL field is never set, the button will not be displayed. To reproduce:
- Insert the checkout button on a page, choose "Go to referrer page" option
- Observe that the button is not rendered after checkout
- Back in the editor, choose "Go to a custom URL" option and fill in a URL. Save and edit again, choosing "Go to referrer page". Save again.
- Observe the button is rendered after checkout
src/blocks/checkout-button/edit.js
Outdated
options={ [ | ||
{ label: __( 'Do not show a button', 'newspack-blocks' ), value: '' }, | ||
{ label: __( 'Go to a custom URL', 'newspack-blocks' ), value: 'custom' }, | ||
{ label: __( 'Go to the referrer page', 'newspack-blocks' ), value: 'referrer' }, |
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.
Suggestion: "previous page" might be more understandable for non-technical people.
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.
Updated in 4325f94
Do you think we should render the button linked to the current page when the URL is not filled? |
I think that without the URL set, the button should just close the modal. But the issue I'm describing is about something else: according to the testing instructions, if the URL is not filled and "Go to referrer page" is set, the button should be rendered and link to the referrer. And it's not, under conditions described in my review. |
Ah, sorry for the confusion. I was able to reproduce the issue. 4c514ae changes the block save to render the URL input if the |
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.
Left a wording suggestion.
# [2.0.0-alpha.1](v1.75.5...v2.0.0-alpha.1) (2023-10-16) ### Bug Fixes * **donate:** allow "once" in tiers-based layout ([ad7268a](ad7268a)) * **homepage-posts:** check existing "specific posts" recursively for deduplication ([#1541](#1541)) ([9755e40](9755e40)) * newspack.pub > newspack.com ([#1552](#1552)) ([343b80b](343b80b)) ### Features * add option for a button after checkout ([#1521](#1521)) ([bdfb3c2](bdfb3c2)) * **homepage-posts:** support deduplication toggling ([#1543](#1543)) ([6acc719](6acc719)) * remove AMP compatibility ([27ecf88](27ecf88)) ### BREAKING CHANGES * AMP will not be supported anymore by this plugin.
🎉 This PR is included in version 2.0.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [2.0.0](v1.75.6...v2.0.0) (2023-10-31) ### Bug Fixes * **donate:** allow "once" in tiers-based layout ([ad7268a](ad7268a)) * **homepage-posts:** check existing "specific posts" recursively for deduplication ([#1541](#1541)) ([9755e40](9755e40)) * newspack.pub > newspack.com ([#1552](#1552)) ([343b80b](343b80b)) * update WC's variation methods ([860f9fa](860f9fa)) ### Features * add option for a button after checkout ([#1521](#1521)) ([bdfb3c2](bdfb3c2)) * **homepage-posts:** support deduplication toggling ([#1543](#1543)) ([6acc719](6acc719)) * **modal checkout:** post-checkout newsletter signup ([#1561](#1561)) ([092007a](092007a)) * **modal-checkout:** implement ras overlay ([#1562](#1562)) ([8270c9b](8270c9b)) * remove AMP compatibility ([27ecf88](27ecf88)) ### BREAKING CHANGES * AMP will not be supported anymore by this plugin.
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
Implements an optional link to click after the transaction is complete on the modal checkout.
The button supports linking to the page referrer (which falls back to the current page URL if the referrer is empty) or a custom URL.
How to test the changes in this Pull Request:
Other information: