Closed igorbenic closed 10 months ago
Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword
link
(e.g. "Link T-123").💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.
@mauryaratan pushed fixes for:
Regarding the product status, API doesn't allow it as it returns: "Filter parameter status is not allowed."
as an error message.
This part wasn't discussed for the scope of this project. I'll see with @jrfarr to define the next phase of it so I can write a paginated query of this REST API inside WordPress and filter out draft products.
We could now show the status next to the name "Product Name (Draft)" if it's a draft (empty if published) for a better UX.
We can include the other fields as well in the next phase if needed.
Changes
1.3.0
1. Improved performance
Issues:
Solved By: Adding a Toggle to apply LS checkout on such button. By that, the LS would retrieve stores and products only when requested and the loop wasn't happening anymore.
2. Added option to pre-fill logged-in user's data on Checkout
If toggled and the user is logged in, we're adding the user's full name (First & Last name) and the email as the parameters of the
checkout
query string.{PRODUCT_URL}?checkout[email]=email&checkout[name]=Name
All Options:
3. Added option to pre-fill data from URL query string
If toggled, we'll check for the
$_GET['checkout']
parameters. If such URL has this parameters, we'll add them to the checkout URL to pre-fill data.4. Added option to define Custom Data when using LS button block
https://github.com/Make-Lemonade/lemonsqueezy-wp/assets/1537130/86fe3f1f-712d-4379-9d20-35be181f5b9d
5. Added option to define text and background colors for LS button block
Users can now pick up the text and background color for the button of the LS block.
6. Added option to enter Test API key and with that enable Test Mode
Issue: Even if I always had "test mode" enabled by default, the OAuth flow will always set me with the Production API key.
Solved by: Adding a manual way of entering an API key that allows us to set the Test API key. If such key is present in the database, we're filtering the get_option method and retrieve such key instead of the one given by OAuth flow. That way, we're making sure that everything is using the Test key.
In the video, you can notice the "Products" change a bit in the title as we move from production to test.
https://github.com/Make-Lemonade/lemonsqueezy-wp/assets/1537130/b797fc3c-89b6-41dd-869f-22c12d05ed69
7. Moved to wp-scripts
By moving to wp-scripts package, we're using the standard way of creating blocks which uses the correct dependencies and more "bulletproof" for future releases of the Block editor.
The creation of the plugin ZIP file has not changed. It now uses
plugin-zip
given bywp-scripts
. The parameterfiles
is set inpackage.json
that lists all the files that can go in the ZIP file.The ZIP is also moved to the folder
bundled
as it was withgulp
so all flows should work fine as well. When building the files usingyarn build
, we're following the same flow as before:Testing
Installation
yarn install
to install everything neededLemonSqueezy Block
?checkout[email]=EMAIL&checkout[billing_address][country]=US&checkout[billing_address][zip]=35005&checkout[tax_number]=GB123456789
checkout[custom][YOUR_DATA]=VALUE
Core Buttons Block