47 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub 6fb7b226fc feat: WC Settings API, compatibility refactor, HPOS fix (#1002)
* feat: WC Settings API, compatibility refactor, HPOS fix, CI improvements

WC Settings GraphQL API:
- Add WCSetting interface with common fields and type-safe resolveType
- Add concrete types: WCStringSetting, WCArraySetting, WCRelativeDateSetting,
  WCImageWidthSetting with typed value/default fields
- Add WCSettingGroup type with nested settings field
- Add wcSettingGroups and wcSettings root query fields (admin only)
- Add updateWCSetting and updateWCSettings mutations
- Dynamic WCSettingTypeEnum collected from registered WC settings
- Filters: graphql_woocommerce_setting_type_map, graphql_woocommerce_setting_types
- Register WC admin settings for GraphQL requests via Compatibility class

Compatibility refactor:
- Consolidate ACF, JWT Auth, and QL Search filters into Compatibility class
- Remove class-acf-schema-filters.php, class-jwt-auth-schema-filters.php, functions.php

HPOS compatibility fix:
- Replace hardcoded directory name check with dirname(__DIR__) === WP_PLUGIN_DIR
- Works with any plugin folder name while still skipping nested vendor installs

CI improvements:
- Remove STRIPE_API_PUBLISHABLE_KEY restriction from coverage job
- Add HPOS to coverage matrix entries
- Sort type registry and includes alphabetically

Other fixes:
- Fix Settings_Mutation::validate_setting_checkbox_field to be static
- Update ShippingZone settings field type to WCStringSetting

Closes #864, closes #969

* refactor: Rename and split core classes, add order cursor pagination tests

Class renames:
- WooCommerce_Filters → WooCommerce (class-woocommerce.php), setup() → init()
- Core_Schema_Filters → Post_Types (class-post-types.php)

Class split:
- Extract taxonomy registration from Core_Schema_Filters into Taxonomies (class-taxonomies.php)

Access functions:
- Add wc_graphql_resolve_product_type() for interface resolveType callbacks
- Add wc_graphql_is_session_handler_disabled()
- Add wc_graphql_enabled_authorizing_url_fields()
- Add wc_graphql_get_authorizing_url_nonce_param_name()
- Replace direct class references with global functions in type-registry,
  compatibility, protected-router, and all product interface files

Stripe gateway compatibility:
- Move woographql_stripe_gateway_args from WooCommerce to Compatibility class
- Rename to woocommerce_gateway_stripe_args

Tests:
- Add OrderCursorPaginationTest (6 tests) covering COT cursor-based
  pagination: forward/backward, date ordering ASC/DESC, cursor integrity

* fix: Use proper expectedField/expectedNode assertions in cursor pagination tests

Replace empty assertQuerySuccessful([]) calls and manual lodashGet
assertions with expectedField, expectedNode, and not()->expectedNode()
for proper GraphQL response validation.
2026-03-27 16:32:30 -04:00
Geoff TaylorandGitHub dd54df3ffe fix: add calculate_totals() after coupon removal in removeCoupons mutation (#991)
WooCommerce's remove_coupon() does not call calculate_totals() — it only
sets a refresh_totals flag for the next request. This means cart totals
returned in the removeCoupons mutation response may be stale. Add an
explicit calculate_totals() call after the coupon removal loop.
2026-03-24 00:17:12 -04:00
Geoff TaylorandGitHub dc4b558779 fix: coupon error handling in fillCart and applyCoupon mutations (#984)
* fix: coupon error handling in fillCart and applyCoupon mutations

- Fix validate_coupon() post ID check to only trigger for numeric codes,
  allowing invalid string codes to fall through to WooCommerce's is_valid()
  which returns consistent error messages regardless of casing
- Add fillCart coupon error tests: minimum spend validation and invalid
  coupon code errors are correctly reported in cartErrors
- Add applyCoupon casing test: error messages are consistent across
  lowercase, uppercase, and mixed case invalid coupon codes

* chore: Linter compliances met
2026-03-23 21:48:34 -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
Geoff TaylorandGitHub f61b55f8df fix: Add direct or/and syntax support to ProductTaxonomyInput and fix test issues (#948)
* fix: Add direct or/and syntax support to ProductTaxonomyInput and fix test issues

* fix: Add OrderNote visibility filters for queries and mutations
2025-10-11 16:29:36 -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
Geoff TaylorandGitHub 2543f33475 fix: Bug in Session_Transaction_Manager::pop_transaction_id() fixed (#852)
* fix: bug in Session_Transaction_Manager::pop_transaction_id fixed

* chore: Linter and PHPStan compliance met

* devops: tests updated

* devops: WPBrowser upgraded to v4.x.x

* devops: Some unit testing configurations updated

* devops: WPBrowser updated and tests passing

* chore: PHPStan and linter compliance met

* devops: WP_CORE_DIR fixed

* devops: More docker config changes

* devops: CartMutationsTest updated

* devops: CI env vars fixed

* devops: More CI fixes

* devops: More CI fixes

* devops: More CI fixes

* devop: Docker env removed

* devops: Codeception configs updated

* devops: configurations tweaked heavily
2024-05-21 00:48:16 -04:00
Geoff TaylorandGitHub 8ba35cd50f Fix: WPGraphQL v1.24.x support implemented (#850)
* fix: WPGraphQL v1.24.x support added + WC 3.6 support

* chore: Linter and PHPStan compliance met

* devops: CI config updated

* devops: docker config updated.

* devops: Docker configs updated.
2024-05-07 16:50:42 -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 a3dfa800f5 feat: applied coupon description field added (#572) 2021-10-22 22:47:25 -04:00
Geoffrey K TaylorandGitHub cb970f36ed CartItem Product edge field "simpleAttributes" implemented and tested. (#521) 2021-07-05 18:18:52 -04: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 8215901e93 Order connections refactored. 2021-06-03 21:37:09 -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 1e38166668 CartMutationsTest updated. 2021-02-26 10:24:52 -05:00
Geoff Taylor 6c633bec51 CartError interface implemented and tested. 2021-02-24 12:54:29 -05:00
Geoff Taylor 73d6418b9d "fillCart" mutation implemented and tested. 2021-02-24 09:17:12 -05:00
Geoff Taylor aa780cf2e7 "AddCartItems" mutation implemented and tested. 2021-02-22 21:17:39 -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 c88cf81568 "extensions" field stripped from "graphql()" response during tests. 2020-11-20 10:29:10 -05:00
Geoff Taylor 86a7ef1bdf final cleanups in code. 2020-10-13 15:01:44 -04:00
Geoff Taylor c8ce2dbe70 Support for WooCommerce v4.5+ added. 2020-10-02 12:37:30 -04:00
Geoff Taylor 69299419ff New error handling method introduced in the "addToCart" mutation 2020-06-26 17:26:18 -04:00
Geoff Taylor c6b8321d81 some tests updated. 2020-06-12 16:50:21 -04:00
Geoff Taylor f89adcc827 CartMutationsTest updated 2020-03-27 13:36:53 -04:00
Geoff Taylor b905af9fae CartMutationsTest updated. 2020-01-12 01:59:11 -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 6e1b0f160c "updateItemQuantity" mutation refactored to "updateItemQuantities" mutation. 2019-07-11 15:25:18 -04:00
Geoff Taylor 97af6e170f tests debugging and code cleanup. 2019-07-09 13:01:19 -04:00
Geoff Taylor 606832aa5e Formatting functionality implemented for Product and ProductVariation types. CartMutationsTest updated. 2019-06-03 13:48:29 -04:00
Geoff Taylor 75d0d4a085 edit_shop_order cap check implemented in Add_Fee::mutate_and_payload() and tested. 2019-05-11 00:55:32 -04:00
Geoff Taylor 9e53422db3 removeCoupon changed to removeCoupons. 2019-05-11 00:40:48 -04:00
Geoff Taylor 641b962a09 restoreCartItem changed to restoreCartItems. CartMutationTests updated. 2019-05-11 00:26:50 -04:00
Geoff Taylor 012c478812 removeItemFromCart changed to removeItemsFromCart. CartMutationTests updated. 2019-05-10 23:47:28 -04:00
Geoff Taylor 8c06dae5b4 "updateItemQuantity" implemented and tested. 2019-05-10 22:03:50 -04:00
Geoff Taylor 9ce7253302 "addFee" mutation implemented and tested 2019-05-07 19:05:55 -04:00
Geoff Taylor c11d9f4cb2 "removeCoupon" mutation implemented and tested. 2019-05-06 15:35:49 -04:00
Geoff Taylor b62ec7eeee "applyCoupon" implemented and tested. 2019-05-06 13:59:11 -04:00
Geoff Taylor 71b55b1577 "emptyCart" mutation implemented and tested. 2019-05-06 11:52:25 -04:00
Geoff Taylor 9d60a946d0 "restoreCartItem" mutation implemented. Typos fixes in other "cart" mutation classes. 2019-05-03 22:00:16 -04:00
Geoff Taylor 94eb0265dc "removeItemFromCart" mutation implemented 2019-05-03 18:58:36 -04:00
Geoff Taylor 228a48325d "addToCart" mutation implemented w/ test. 2019-05-03 17:36:08 -04:00