Use immutable WC order ID for KOMOJU sessions - #81
Open
FTLam11 wants to merge 8 commits into
Open
Conversation
WC_Order::get_order_number by default uses the order ID, but seems that it can be changed. * https://wp-kama.com/plugin/woocommerce/function/WC_Data::get_id
FTLam11
force-pushed
the
use-wc-immutable-order-id-for-komoju-session
branch
from
December 6, 2022 03:39
4a80fba to
26452b3
Compare
NPX ignores our pinned cypress version, so we should be running: npm run cypress:open
Installing woocommerce 4.0.1 is janky, cypress tests were not passing because the woocommerce installation failed to complete because of: woocommerce/woocommerce#27707 Will manually re-test the plugin later
Bumped woocommerce to get pass the PHP warning, seems the UI changed so this commit updates the installation and checkout steps. Maybe the default woocommerce theme changed?
build Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2
FTLam11
commented
Dec 7, 2022
| cd tests | ||
| npm install | ||
| npx cypress run | ||
| npm run cypress:run |
Contributor
Author
There was a problem hiding this comment.
NPX ignores our pinned version of cypress, I found it was installing cypress version 11. Using the NPM script will use our pinned version.
FTLam11
marked this pull request as ready for review
December 7, 2022 02:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Fixes #80
This PR changes the woocommerce order ID to use the database ID instead of an editable display ID. WC_Order::get_order_number by default uses the order ID, but seems that it can be changed.
I had minor issues activating woocommerce, related to a PHP warning. The version we are using (4.0.1) is quite behind the latest (7.1). We are using the latest wordpress image so maybe some compatability error. I'd get a blank screen with the PHP warning, go back to the wordpress dashboard and see the woocommerce plugin activated. Between updating the cypress test setup and seeing if we could bump woocommerce to get past that warning, I decided to try bumping woocommerce. Sadly some of the woocommerce UI settings changed, so some of the test setup was updated to reflect that.
Refs:
How to test
woocommerce_order_idmatches the one on the woocommerce orders dashboard:KOMOJU:

WooCommerce order details:

Note: I looked around the woocommerce order details and dashboard settings, but couldn't find a way to change the order display ID. Maybe this is supported in a newer woocommerce version?