35 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub e3cf944386 fix: resolve product variation type when the node is a base Post model (#1020)
* fix: resolve product variation type when the node is a base Post model

A cart item's variation node can be loaded through the generic post loader (e.g. under Polylang, which doesn't manage the product_variation post-type), arriving as a base \WPGraphQL\Model\Post that has no get_type(). resolve_product_variation_type() then fatals. Fall back to resolving the variation's product type from its ID via wc_get_product() when get_type() isn't callable.

* chore: remove stray graphql_debug() from ProductWithPricing price resolver

* test: disable Customer Note email so order-note tests aren't polluted by the WC email-sent note

* test: cover product-variation type fallback when the node loads as a base Post model
2026-06-30 10:03:48 -04:00
Geoff TaylorandGitHub 460b101b47 fix: HPOS order mutation data loss, COT cursor pagination, email tests, checkout auth (#1003)
* devops: WC email template tests, COT cursor HPOS fix, checkout account auth

WC Email Template Tests:
- Add WooCommerceEmailTemplatesTest verifying WC email templates are used
  for registerCustomer, checkout with account creation, and password reset
- Use MockPHPMailer to capture emails and verify HTML content type
- Disable deferred transactional emails during tests via GRAPHQL_TESTING flag

COT Cursor HPOS Fix:
- Fix COT_Cursor::compare_with to resolve orderby aliases and legacy meta
  keys (_order_total, _date_completed, etc.) to COT column names
- Add resolve_orderby_alias() mapping short aliases and meta keys to columns
- Add DB_Hooks::clean_query_vars to translate post_* and meta_key orderby
  to COT-compatible equivalents via woocommerce_order_query_args filter

Checkout Account Authentication:
- Add authenticate field to CreateAccountInput type
- Gate wc_set_customer_auth_cookie() behind authenticate flag in checkout
  mutation so account creation doesn't auto-authenticate by default

Closes #882

* devops: codeception.dist.yml updated

* fix: Functional test cleanup and CI coverage condition

Test fixes:
- Enable authorizing URL fields in ProtectedRouterCest and
  DownloadableItemAuthCest via setWooGraphQLSetting
- Add stale data cleanup (sessions, users, products, orders) to
  GraphQLE2E _setupStore/getCatalog/setupStoreAndUsers
- Fix CartTransactionQueueCest and CartQueriesTest for test isolation

CI:
- Only run coverage job when at least one upstream job succeeds

* chore: Linter compliances met

* fix: HPOS order mutation data loss and CI coverage condition

Refactor order create/update mutations to set all props on a single
WC_Order instance before saving, mirroring the WC REST API pattern.
Previously, separate add_order_meta() and add_items() calls each loaded
their own order instance and saved independently, causing HPOS data loss
for payment method, addresses, and other fields.

Also fix CI coverage job to only run when all upstream jobs succeed,
and correct test assertions for RAW format line item totals.

Closes #591

* chore: Linter compliances met

* chore: Remove dead code from Order_Mutation after prepare_order refactor

Removes add_items() and update_address() which are no longer called
after the prepare_order() consolidation.

* chore: Remove dead code add_order_meta and update_item_meta_data
2026-03-30 21:42:00 -04:00
ef26bb2479 Adds support for Cart tax_lines (#940)
* Adds support for tax_lines

* devops: cleanup cart tax lines code style and add unit tests

* feat: add tax-aware cost, subtotal, and taxTotal fields to ShippingRate (#802)

* feat: add format arg to ShippingRate cost/subtotal/taxTotal fields, update test for RAW format

* devops: CartQueriesTest updated

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2026-03-26 20:09:53 -04:00
Geoff TaylorandGitHub 07dfdf9348 feat: New fees input fields add to cart query and checkout mutation (#929)
* feat: New fees input fields add to `cart` query and `checkout` mutation

* chore: Linter compliance met

* devops: CartQueriesTest tests updated
2026-03-18 16:59:08 -04:00
962410d265 fix: add model classes to type configs to better support query analyzer ID tracking (#874)
* - remove several fields that are already registered by core when the post type is mapped to the schema

* devops: Tests updated and coupon "salt" restored

* chore: Linter & PHPStan compliance met

* chore: Linter & PHPStan compliance met

* devops: "self" replaced with "static" in cli tests

* chore: fix cleanup after rebasing

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2024-08-06 18:54:18 -04:00
0867d430ef (Query) Format currency in cart type (#619)
* Format cart item price

* Fix price return type

* chore: CartQueriesTest updated with new price fields formatting

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2022-08-29 13:24:50 -04:00
Geoffrey K TaylorandGitHub 9073793e86 chore: WPGraphQL v1.9.x connection resolver support added and autoloader removed. (#647)
* chore: WPGraphQL v1.9x + WP Bedrock support added.

* chore: lint compliance met.

* chore: composer/installers added back to allow-plugins
2022-08-26 14:53:36 -04:00
Geoffrey K TaylorandGitHub 6dbdcb5ae8 fix: Product Attribute naming conventions changed (#603)
* fix: Product Attribute naming conventions changed

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: Dockerfile updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: dev dependencies updated

* devops: Dockerfile updated

* chore: Docker composer configurations updated

* chore: Coding standards met.
2022-02-04 15:00:44 -05:00
Geoffrey K TaylorandGitHub f59872ae89 Coupon mutations added. (#510)
* Coupon mutations implemented and tested
* Vendor files no longer versioned and package workflow implemented
2021-07-05 13:51:52 -04:00
Geoff Taylor 9e31f47e51 Cart item connection pagination refactored. 2021-06-12 22:06:44 -04:00
Geoff Taylor c264114daa "Product=>reviews" resolver re-implemented 2021-03-17 19:10:06 -04:00
Geoff Taylor 888ac9696d autoloader files rebuilt 2021-02-26 19:21:39 -05:00
Geoff Taylor a51cb59fa3 Cart* test refactored heavily to extend the WPGraphQLTestCase 2021-02-26 10:53:31 -05:00
Geoff Taylor 993df4b175 "Cart" and "ProductVariation" factories implemented. 2021-02-26 10:25:34 -05:00
Geoff Taylor 68803bd093 Coding standards met. 2021-01-27 01:11:59 -05:00
Geoff TaylorandGeoff Taylor f47bee2b5f Docker/Codeception configuration heavily refactored.. 2021-01-22 11:34:09 -05:00
Geoff Taylor b3c649da67 CartItem connections implemented and tested 2020-11-24 00:28:20 -05:00
Geoff Taylor de137b4311 "totalTaxes" added to "CartQueriesTest::testCartQuery" test. 2020-11-23 14:46:41 -05:00
Geoff Taylor 86a7ef1bdf final cleanups in code. 2020-10-13 15:01:44 -04:00
Geoffrey K TaylorandGitHub e708346e65 Merge branch 'release/v0.6.0' into feature/some-node-interfaces-support 2020-10-03 01:46:46 -04:00
Geoff Taylor c8ce2dbe70 Support for WooCommerce v4.5+ added. 2020-10-02 12:37:30 -04:00
Geoff Taylor 449d3b1674 "typeId" fields replaced by "databaseId". 2020-09-16 16:32:14 -04:00
Geoff Taylor c6b8321d81 some tests updated. 2020-06-12 16:50:21 -04:00
Geoff Taylor 60ef3cde3b WPGraphQL v0.8.x support added 2020-03-24 20:55:13 -04:00
Geoff Taylor 8485fff74b CartQueriesTest updated. 2020-01-11 22:10:49 -05:00
Geoff Taylor a80dc9d59a Pagination implemented on cart connection 2020-01-11 19:43:08 -05:00
Geoff Taylor 369fb7aa22 testing updated. 2019-11-13 18:53:31 -05:00
Geoff Taylor 971f4eaf0f ""ProductUnion" type implemented. 2019-10-17 21:39:38 -04:00
Geoff Taylor 2bbe110013 php5.6 test compatibility fixed. 2019-07-25 18:04:59 -04:00
Geoff Taylor f3c23a27f3 docker script added for e2e testing support 2019-07-17 20:02:41 -04:00
Geoff Taylor 97af6e170f tests debugging and code cleanup. 2019-07-09 13:01:19 -04:00
Geoff Taylor a33aab24df "CartFee" type and queries implemented and tested 2019-05-07 17:59:35 -04:00
Geoff Taylor c7d5464945 cart-item connection sorting patched 2019-04-24 15:05:42 -04:00
Geoff Taylor 48f01107e0 CartQueriesTest implemented 2019-04-24 13:08:29 -04:00
Geoff Taylor 129cf3abf0 Cart and CartItem type implemented 2019-04-18 23:22:00 -04:00