87 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub 088d337ef5 fix: address WordPress.org plugin review (rename + prefixing + headers) (#1019)
* fix: address WordPress.org plugin review feedback

- Prefix the session transaction queue transient with the plugin's
  graphql_woocommerce_ namespace instead of the generic "woo_" word, to
  avoid collisions (Plugin Directory: prefix data storage).
- Declare the WooCommerce dependency via the "Requires Plugins: woocommerce"
  plugin header.
- Bump README.txt "Tested up to" to 7.0.
- Ship composer.json in the distributed plugin (drop it, and composer.lock,
  from composer archive excludes) so the build is reproducible/reviewable.

* chore: rename plugin to "GraphQL for eCommerce" for trademark compliance

The WordPress.org plugin review flagged the display name/slug for beginning
with the "WPGraphQL" trademark (and the "WooGraphQL" portmanteau of the
WooCommerce mark), which can imply official affiliation.

- Display name (plugin header + readme title) -> "GraphQL for eCommerce".
- Slug/text domain -> "graphql-for-ecommerce" (header, all i18n string
  literals, and the PHPCS WordPress.WP.I18n text_domain config).
- Update user-facing notices/errors that named the old plugin.

"WooGraphQL" remains the project's informal nickname (repo, docs, community),
just not in the WordPress.org directory's official name/slug. Internal file
names and GitHub URLs are unchanged.

* fix: keep test-only dev deps out of the committed composer.json

The committed manifest mirrors develop (lint/stan dev deps only); CI adds the
test suite deps at runtime via `composer installTestEnv`. A previous commit
captured the installTestEnv-modified composer.json, desyncing it from
composer.lock and breaking `composer install` in CI.

* chore: regenerate composer.lock (refresh dev dependencies)

Regenerate the lock from the manifest so it is in sync (fixes the CI
`composer install` failure) and refresh dependencies in the process —
firebase/php-jwt v7.0.4 -> v7.1.0 plus 11 others, with vendor-prefixed
re-strauss'd to match. Full wpunit suite passes against the updated deps
(305 tests, 835 assertions).

* chore: rename text domain in createdVia/attribution strings from #1018

#1018 (createdVia + order attribution) merged into develop after the rename
commit was authored, so its new i18n strings still used the old
'wp-graphql-woocommerce' text domain. Update them to 'graphql-for-ecommerce'
to match the rename.
2026-06-30 10:16:21 -04:00
Geoff TaylorandGitHub 858887fa78 devops: Variable product performance optimization (#1006)
* devops: Variable product performance optimization and tests

- Memoize get_variation_prices() in the Product model to avoid
  redundant lookups across multiple pricing fields (price, regularPrice,
  salePrice, and their RAW variants)
- Remove redundant post__in filter from variations connection resolver;
  post_parent already constrains the query, and the post__in triggered
  an extra get_children() call per product
- Add createVariableProductCatalog() helper to GraphQLE2E for creating
  variable products with many variations in tests
- Add VariableProductPerformanceTest (wpunit) measuring DB query count
  and duration for 15 variable products with 18 variations each
- Add VariableProductPerformanceCest (functional) verifying 6 rapid
  queries do not return 429 errors

Addresses #897

* fix: Skip timing assertion when xdebug is active and clean up debug code
2026-03-31 09:17:44 -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
Geoff TaylorandGitHub b6576d4125 feat: Product and product attribute mutations (#851)
* devops: Product and product attribute mutation tests generated

* feat: Product Mutations implemented and tested

* chore: Linter and PHPStan compliance met

* fix: resolve test failures in product and variation mutation tests

- Removed duplicate requires for payment-method classes (rebase artifact)
- Wrapped bare `attributes` queries in `... on SimpleProduct` inline
  fragments (attributes field is on ProductWithAttributes interface,
  not the base Product type)
- Fixed attribute label expectations to match factory output (lowercase)
- Fixed relay ID prefix from 'product'/'product_variation' to 'post'
  to match WPGraphQL's actual encoding
- Cache WP_Post before force-deletion and re-cache after so the Product
  model's type resolver can still determine the GraphQL type in the
  response
- Added wp_cache_flush() before asserting product deletion to avoid
  false positives from the re-cached post

* chore: fix PHPCS lint errors in mutation files

* fix: resolve CI test failures for attribute and variation mutations

- Fixed ProductVariation type registration in schema filters so the
  variation mutation output field resolves correctly
- Renamed attribute slug from 'pattern' to 'fabric' in
  ProductAttributeMutationsTest to avoid collision with the pattern
  attribute created by ProductAttributeQueriesTest
- Fixed PHPStan errors for redundant is_wp_error checks
- Updated IntrospectionQueryTest
2026-03-20 13:31:13 -04:00
Geoff TaylorandGitHub ef53404fc3 fix: product variation duplicate fields removed (#957)
* fix: product variation duplicate fields removed

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* chore: Linter compliances met

* devops: CI compliances met

* devops: unneeded access function removed

* devops: unneeded access function removed

* devops: unneeded access function removed
2026-01-16 12:28:23 -05: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
Geoff TaylorandGitHub b718b87d2e fix: Better support for private and password protected products implemented (#925) 2025-02-27 10:22:36 -05:00
Geoff TaylorandGitHub 6b581743d7 "isSession" field added to the "UpdateCustomerInput" type (#924) 2025-02-27 10:22:17 -05:00
Geoff TaylorandGitHub 594bc29d6b fix: General improvements and bugfixes (#899) 2024-10-29 11:54:06 -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 d9d968ac91 fix: product connection resolution refactored to better work with the ProductQuery class (#880)
* fix: product connection resolution refactored to better work with the ProductQuery class

* chore: Linter and PHPStan compliance met

* devops: New product connection tests implemented and passing

* fix: products connection pricing filters fixed

* devops: CartTransactionQueueCest skipped until failing PHP version removed from CI matrix
2024-08-06 18:07:37 -04:00
Geoff TaylorandGitHub 895b040953 chore: version numbers and changelog updated (#858) 2024-05-21 00:57:56 -04:00
Geoff TaylorandGitHub f686e743b0 feat: Queries and mutations for shipping zones, tax classes, and tax rates. (#856)
* fix: General bugfixes and improvements

* devops: New mutations and types tested and compliance with Linter and PHPStan

* chore: hooks added to the mutation resolvers

* feat: permission checks added

* chore: Linter and compliance met

* chore: Linter and compliance met
2024-05-17 00:03:10 -04:00
Geoffrey K TaylorandGitHub 134dc5eaf7 feat: "found" field added to the Products Connection types (#804) 2023-09-15 23:31:24 -04:00
Geoffrey K TaylorandGitHub c526a5b527 feat: ProductWithAttributes and ProductVariation interfaces added (#803)
* feat: ProductWithAttributes and ProductVariation interfaces added

* chore: Unused files removed
2023-09-15 21:03:55 -04:00
Geoffrey K TaylorandGitHub 87d7a7b1a9 fix: ProductVariation type made to inherit the Product interface. (#788)
* devops: WP theme during e2e locked to TwentyTwentyOne

* fix: "Product Connection Resolver" restored

* chore: Linter/PHPStan compliance met

* devops: CustomerProceedsToCheckoutCept updated.

* chore: Linter compliance met
2023-08-22 17:14:39 -04:00
f583628199 chore: implement WPGraphQL Coding Standards (#769)
* chore: avoid magic constants [PHPCS]

* chore: change ruleset to wp-graphql-cs and lint

* devops: HPOS added back to CI with the release of WC 3.9

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-07-19 17:11:25 -04:00
Dovid LevineandGitHub 58fbce7c57 fix: clean up unnecessary variables and ternaries (#766) 2023-07-19 16:10:23 -04:00
Dovid LevineandGitHub 4ed9cb94da chore: use fully-qualified class names for PHPDoc types (#767)
* fix!: update deps to required versions

* chore: use fqcn for PHPDoc types

* chore: cleanup use statements
2023-07-19 16:01:50 -04:00
Dovid LevineandGitHub fa8e3005e5 fix: remove trailing commas from function calls (#768)
* fix!: update deps to required versions

* fix: trailing commas not allowed in PHP 7.2
2023-07-19 15:10:22 -04:00
57800b46f3 feat: HPOS support added. (#748)
* feat: HPOS support added.

* fix: Refund connections and connection permission fixed

* chore: Linter compliance met.

* devops: CI script updated.

* devops: CI script updated.

* fix: Syntax error fixed.

* devops: CI script updated.

* devops: CI script updated.

* devops: CI script updated.

* chore: PHPStan fixes started.

* chore: linter compliance met.

* chore: fix scanning and type-hinting for non-stubbed classes

* dev: refactor Order model around WC_Abstract_Order

* chore: update dev deps

* devops: PHPStan and Linter compliance met.

* devops: HPOS test temporarily suppressed.

---------

Co-authored-by: David Levine <david@axepress.dev>
2023-06-21 13:21:29 -04:00
4ef46acd15 chore: setup PHPStan (#746)
* chore: setup PHPStan

* chore: General code cleanup for PHPStan

* chore: PHPStan to level 2

* chore: PHPStan to level 2

* fix: Syntax error fixed.

* devops: PHPStan level 2 reached.

* devops: PHPStan level 3 passed

* devops: PHPStan level 4 passed

* chore: fix bad typehints from jwt-auth [phpstan]

* chore: simplify conditional logic in WC_Terms::register_connections()

* chore: add stubs for WP type properties.

* fix: check for valid WC_Order_Item before caching order.

* chore: lint

* devops: PHPStan level 6 passed.

* chore: Linter compliance met.

* chore: simplify logic and check for valid term.

* fix: ensure valid types (partial)

* chore: [phpcs] allow inline type annotations

* devops: PHPStan level 8 reached.

* devops: More stability fixes.

* fix: general bugfixes and improvements

* devops: Code Quality GA script added.

* devops: Linter compliance met & 2 "phpstan-ignore" statements set.

* devops: PHPStan config and CI script fixed.

* fix: "cartItem" query resolution refactored

* devops: GA scripts updated.

* chore: Simple copy changes

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-06-13 16:17:02 -04:00
Geoffrey K TaylorandGitHub ba13b2ec0a feat: Authorizing URLs implemented and tested. (#745)
* feat: Authorizing URLs implemented and tested.

* feat: More woographql_*_nonce functions implemented.

* chore: linting changes made.

* chore: linting changes made.

* fix: woographql_*_ functions tested.

* chore: WPCS compliance met.

* devops: lint-code script updated to PHP v8.0

* chore: WPCS compliance met

* devops: TransferSessionHandlerTest & QLSessionHandlerTest updated

* devops: codeclimate.yml added.

* chore: Linter compliance met

* devops: Harmonizing WordPress doc written and Settings doc updated.

* chore: Typo fixed in docs.

* fix: General bugfixes and improvements related to Auth URLs

* devops: More docs.

* chore: Linter compliance met

* chore: small change made to docs.
2023-05-22 13:43:10 -04:00
Geoffrey K TaylorandGitHub 1f191039c1 feat: woographql_viewable_order_types hook added (#741)
* feat: woographql_viewable_order_types hook added

* chore: WPCS compliance met
2023-04-21 04:50:26 -04:00
Geoffrey K TaylorandGitHub c068671d93 feat: WooGraphQL settings tab added. (#726)
* feat: WooGraphQL settings tab added.

* chore: WPCS compliance met

* bugfix: Order Item Node ID implemented.

* chore: Deprecated "AppContext::getLoader" calls replaced.

* chore: WPCS compliance met.

* fix: DownloadableItem "id" field implemented
2023-04-04 12:02:25 -04:00
6532e0a4f7 Adds taxes to variation prices. (#717)
Co-authored-by: Andres A <andres@Andress-MacBook-Pro.local>
2023-03-21 15:32:06 -04:00
7343ab2174 Fix wrong arg in sale place wc_get_price_to_display and remove wc_get_price_to_display from raw price. (#716)
Co-authored-by: Andres A <andres@Andress-MacBook-Pro.local>
2023-03-17 14:52:15 -04:00
bde5fc5bbd Adds tax calculation to regular and sale prices. (#714)
* Adds tax calculation to regular and sale prices.

* fixup! Adds tax calculation to regular and sale prices.

* Fix phpunit deprecated method.

* fixup! Fix phpunit deprecated method.

* fixup! fixup! Fix phpunit deprecated method.

* Fix missing param in function.

* Fix linting.

---------

Co-authored-by: Andres A <andres@Andress-MBP.home>
2023-03-10 13:46:39 -05:00
Geoffrey K TaylorandGitHub 82e5e72ff9 fix: Product "price" field now supports the "taxes included" display … (#703)
* fix: Product "price" field now supports the "taxes included" display setting.

* chore: WPCS compliance met.
2023-02-01 17:53:20 -05:00
Geoffrey K TaylorandGitHub 0a54ce9edc feat: Auth no longer needed for the raw order totals (#700) 2023-02-01 14:01:56 -05:00
ba14f1cfd9 fix: product variation raw price not visible for public users (#671)
* fix: product variation raw price not visible for public users

* fixup! fix: product variation raw price not visible for public users

* fixup! fixup! fix: product variation raw price not visible for public users

* chore: WPCS compliance met

Co-authored-by: Andres A <andres@Andress-MacBook-Pro.local>
Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2022-12-07 17:26:55 -05:00
Geoffrey K TaylorandGitHub 0b4c3e0aa8 fix: is_post_private overrode in WC_Post model abstract class (#651)
* fix: is_post_private overrode in WC_Post model abstract class

* chore: WPCS compliance met.
2022-08-29 13:29:14 -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 aa55a3b768 fix: updateReview input requirements fixed (#570)
* fix: updateReview input requirements fixed

* chore: coding standards met
2021-10-22 18:12:37 -04:00
Deepak MittalandGitHub b0fb2a2e28 Fix raw pricing returning null (#544)
$prices['price'] doesn't exist as $prices variable has already been overwritten inside the switch case. This causes pricing to return null for all pricing fields (regular, sale, price) which are formatted as RAW.
2021-09-08 02:02:25 -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
Joel 27de711a30 Added refund date field 2021-03-06 04:44:41 +01:00
Geoff Taylor 888ac9696d autoloader files rebuilt 2021-02-26 19:21:39 -05:00
Geoff Taylor 1e809bbf20 ci workflow updated. 2021-01-27 00:27:47 -05:00
Geoff Taylor 9677867fb7 Variable product pricing ranges fixed. 2021-01-26 17:03:44 -05:00
Geoff Taylor aacb6bf2bf Workflow badges updated. 2021-01-22 11:37:18 -05:00
Geoff Taylor cee407973f product model field filters implemented 2020-10-22 16:01:35 -04:00
Geoff Taylor 75d0e89ac9 "Order::is_private()" access level altered to match "Post::is_private()" class. 2020-10-20 14:02:38 -04:00
Geoff Taylor b7a14f95a1 Session Handler upgraded. 2020-10-01 01:45:26 -04:00
Geoff Taylor 80b87eb019 Large refactor of Post models 2020-09-22 08:17:01 -04:00
Geoff TaylorandGeoff Taylor 331bfe52eb Crud_CPT renamed to WC_Post 2020-09-21 14:49:32 -04:00
Geoff Taylor 449d3b1674 "typeId" fields replaced by "databaseId". 2020-09-16 16:32:14 -04:00
Geoff Taylor 589cede136 Support for some node interfaces added to the product and order models. 2020-09-07 16:42:59 -04:00
Geoffrey K TaylorandGitHub f2a6a3d486 Merge pull request #332 from kidunot89/bugfix/price-format-permission-removed
Field caps removed from product raw price and description fields.
2020-09-07 14:10:46 -04:00