Skip to content
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

Use immutable WC order ID for KOMOJU sessions #81

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

FTLam11
Copy link
Contributor

@FTLam11 FTLam11 commented Dec 6, 2022

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

  1. I'd recommend running the cypress tests to do all the wordpress/woocommerce/product setup, but you can also do manually via https://github.com/degica/komoju-woocommerce/blob/master/docs/dev_setup.md
  2. Purchase a product, find the test payment on KOMOJU and see that the woocommerce_order_id matches the one on the woocommerce orders dashboard:

KOMOJU:
Screen Shot 2022-12-07 at 10 50 06

WooCommerce order details:
Screen Shot 2022-12-07 at 10 45 13

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?

@FTLam11 FTLam11 force-pushed the use-wc-immutable-order-id-for-komoju-session branch from 4a80fba to 26452b3 Compare December 6, 2022 03:39
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
@@ -17,7 +17,7 @@ jobs:
run: |
cd tests
npm install
npx cypress run
npm run cypress:run
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FTLam11 marked this pull request as ready for review December 7, 2022 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WooCommerce order IDs should be database IDs instead of display IDs
1 participant