diff --git a/plugins/woocommerce-blocks/.github/workflows/check-doc-links.yml b/plugins/woocommerce-blocks/.github/workflows/check-doc-links.yml index 805a85be97b..058b2fb3747 100644 --- a/plugins/woocommerce-blocks/.github/workflows/check-doc-links.yml +++ b/plugins/woocommerce-blocks/.github/workflows/check-doc-links.yml @@ -11,18 +11,23 @@ concurrency: permissions: {} jobs: - markdown-link-check: - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v3 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'no' - config-file: '.github/workflows/check-doc-links-config.json' - folder-path: './docs' - file-path: './README.md' - max-depth: 3 - base-branch: 'trunk' + markdown_link_check: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: 'npm' + + - name: Install markdown-link-check + run: npm install -g markdown-link-check + + - name: Run markdown-link-check + run: | + find ./docs -path ./docs/internal-developers/testing/releases -prune -o -name "*.md" -print0 | xargs -0 -n1 markdown-link-check -c .github/workflows/check-doc-links-config.json + diff --git a/plugins/woocommerce-blocks/bin/hook-docs/data/actions.json b/plugins/woocommerce-blocks/bin/hook-docs/data/actions.json index b317628eb7f..9c6c1650a80 100644 --- a/plugins/woocommerce-blocks/bin/hook-docs/data/actions.json +++ b/plugins/woocommerce-blocks/bin/hook-docs/data/actions.json @@ -603,46 +603,6 @@ }, "args": 3 }, - { - "name": "woocommerce_rest_checkout_process_payment_with_context", - "file": "StoreApi/Routes/V1/Checkout.php", - "type": "action_reference", - "doc": { - "description": "Process payment with context.", - "long_description": "", - "tags": [ - { - "name": "hook", - "content": "woocommerce_rest_checkout_process_payment_with_context" - }, - { - "name": "throws", - "content": "If there is an error taking payment, an \\Exception object can be thrown with an error message.", - "types": [ - "\\Exception" - ] - }, - { - "name": "param", - "content": "Holds context for the payment, including order ID and payment method.", - "types": [ - "\\Automattic\\WooCommerce\\StoreApi\\Payments\\PaymentContext" - ], - "variable": "$context" - }, - { - "name": "param", - "content": "Result object for the transaction.", - "types": [ - "\\Automattic\\WooCommerce\\StoreApi\\Payments\\PaymentResult" - ], - "variable": "$payment_result" - } - ], - "long_description_html": "" - }, - "args": 1 - }, { "name": "woocommerce_shop_loop", "file": "BlockTypes/ClassicTemplate.php", @@ -813,6 +773,40 @@ }, "args": 2 }, + { + "name": "woocommerce_store_api_checkout_order_processed", + "file": "StoreApi/Routes/V1/CheckoutOrder.php", + "type": "action", + "doc": { + "description": "Fires before an order is processed by the Checkout Block/Store API.", + "long_description": "This hook informs extensions that $order has completed processing and is ready for payment.\n This is similar to existing core hook woocommerce_checkout_order_processed. We're using a new action: - To keep the interface focused (only pass $order, not passing request data). - This also explicitly indicates these orders are from checkout block/StoreAPI.", + "tags": [ + { + "name": "since", + "content": "7.2.0" + }, + { + "name": "see", + "content": "", + "refers": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238" + }, + { + "name": "example", + "content": "docs/examples/checkout-order-processed.md" + }, + { + "name": "param", + "content": "Order object.", + "types": [ + "\\WC_Order" + ], + "variable": "$order" + } + ], + "long_description_html": "

This hook informs extensions that $order has completed processing and is ready for payment.

This is similar to existing core hook woocommerce_checkout_order_processed. We're using a new action:

" + }, + "args": 1 + }, { "name": "woocommerce_store_api_checkout_order_processed", "file": "StoreApi/Routes/V1/Checkout.php", @@ -849,7 +843,7 @@ }, { "name": "woocommerce_store_api_checkout_update_customer_from_request", - "file": "StoreApi/Routes/V1/Checkout.php", + "file": "StoreApi/Routes/V1/CheckoutOrder.php", "type": "action", "doc": { "description": "Fires when the Checkout Block/Store API updates a customer from the API request data.", @@ -881,24 +875,24 @@ "args": 2 }, { - "name": "woocommerce_store_api_checkout_update_order_from_request", + "name": "woocommerce_store_api_checkout_update_customer_from_request", "file": "StoreApi/Routes/V1/Checkout.php", "type": "action", "doc": { - "description": "Fires when the Checkout Block/Store API updates an order's from the API request data.", - "long_description": "This hook gives extensions the chance to update orders based on the data in the request. This can be used in conjunction with the ExtendSchema class to post custom data and then process it.", + "description": "Fires when the Checkout Block/Store API updates a customer from the API request data.", + "long_description": "", "tags": [ { "name": "since", - "content": "7.2.0" + "content": "8.2.0" }, { "name": "param", - "content": "Order object.", + "content": "Customer object.", "types": [ - "\\WC_Order" + "\\WC_Customer" ], - "variable": "$order" + "variable": "$customer" }, { "name": "param", @@ -909,7 +903,7 @@ "variable": "$request" } ], - "long_description_html": "

This hook gives extensions the chance to update orders based on the data in the request. This can be used in conjunction with the ExtendSchema class to post custom data and then process it.

" + "long_description_html": "" }, "args": 2 }, diff --git a/plugins/woocommerce-blocks/bin/hook-docs/data/filters.json b/plugins/woocommerce-blocks/bin/hook-docs/data/filters.json index b9edf39f0a8..e8a110dd56c 100644 --- a/plugins/woocommerce-blocks/bin/hook-docs/data/filters.json +++ b/plugins/woocommerce-blocks/bin/hook-docs/data/filters.json @@ -120,6 +120,30 @@ }, "args": 1 }, + { + "name": "loop_shop_per_page", + "file": "BlockTypes/ProductQuery.php", + "type": "filter", + "doc": { + "description": "", + "long_description": "", + "tags": [], + "long_description_html": "" + }, + "args": 1 + }, + { + "name": "loop_shop_per_page", + "file": "BlockTypes/ProductCollection.php", + "type": "filter", + "doc": { + "description": "", + "long_description": "", + "tags": [], + "long_description_html": "" + }, + "args": 1 + }, { "name": "wc_session_expiration", "file": "StoreApi/Routes/V1/AbstractCartRoute.php", @@ -249,6 +273,39 @@ }, "args": 4 }, + { + "name": "woocommerce_add_to_cart_quantity", + "file": "BlockTypes/ProductButton.php", + "type": "filter", + "doc": { + "description": "Filters the change the quantity to add to cart.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "10.9.0" + }, + { + "name": "param", + "content": "The default quantity.", + "types": [ + "\\Automattic\\WooCommerce\\Blocks\\BlockTypes\\number" + ], + "variable": "$default_quantity" + }, + { + "name": "param", + "content": "The product id.", + "types": [ + "\\Automattic\\WooCommerce\\Blocks\\BlockTypes\\number" + ], + "variable": "$product_id" + } + ], + "long_description_html": "" + }, + "args": 2 + }, { "name": "woocommerce_add_to_cart_sold_individually_quantity", "file": "StoreApi/Utilities/CartController.php", @@ -734,6 +791,47 @@ }, "args": 1 }, + { + "name": "woocommerce_cart_item_permalink", + "file": "StoreApi/Schemas/V1/CartItemSchema.php", + "type": "filter", + "doc": { + "description": "Filter the product permalink.", + "long_description": "This is a hook taken from the legacy cart/mini-cart templates that allows the permalink to be changed for a product. This is specific to the cart endpoint.", + "tags": [ + { + "name": "since", + "content": "9.9.0" + }, + { + "name": "param", + "content": "Product permalink.", + "types": [ + "string" + ], + "variable": "$product_permalink" + }, + { + "name": "param", + "content": "Cart item array.", + "types": [ + "array" + ], + "variable": "$cart_item" + }, + { + "name": "param", + "content": "Cart item key.", + "types": [ + "string" + ], + "variable": "$cart_item_key" + } + ], + "long_description_html": "

This is a hook taken from the legacy cart/mini-cart templates that allows the permalink to be changed for a product. This is specific to the cart endpoint.

" + }, + "args": 3 + }, { "name": "woocommerce_disable_compatibility_layer", "file": "Templates/AbstractTemplateCompatibility.php", @@ -933,6 +1031,88 @@ }, "args": 1 }, + { + "name": "woocommerce_pay_order_product_has_enough_stock", + "file": "StoreApi/Utilities/OrderController.php", + "type": "filter", + "doc": { + "description": "Filters whether or not the product has enough stock.", + "long_description": "", + "tags": [ + { + "name": "param", + "content": "True if has enough stock.", + "types": [ + "boolean" + ], + "variable": "" + }, + { + "name": "param", + "content": "Product.", + "types": [ + "\\WC_Product" + ], + "variable": "$product" + }, + { + "name": "param", + "content": "Order.", + "types": [ + "\\WC_Order" + ], + "variable": "$order" + }, + { + "name": "since", + "content": "9.8.0-dev" + } + ], + "long_description_html": "" + }, + "args": 3 + }, + { + "name": "woocommerce_pay_order_product_in_stock", + "file": "StoreApi/Utilities/OrderController.php", + "type": "filter", + "doc": { + "description": "Filters whether or not the product is in stock for this pay for order.", + "long_description": "", + "tags": [ + { + "name": "param", + "content": "True if in stock.", + "types": [ + "boolean" + ], + "variable": "" + }, + { + "name": "param", + "content": "Product.", + "types": [ + "\\WC_Product" + ], + "variable": "$product" + }, + { + "name": "param", + "content": "Order.", + "types": [ + "\\WC_Order" + ], + "variable": "$order" + }, + { + "name": "since", + "content": "9.8.0-dev" + } + ], + "long_description_html": "" + }, + "args": 3 + }, { "name": "woocommerce_registration_errors", "file": "StoreApi/Routes/V1/Checkout.php", @@ -1102,6 +1282,39 @@ }, "args": 1 }, + { + "name": "woocommerce_single_product_image_thumbnail_html", + "file": "BlockTypes/ProductGalleryThumbnails.php", + "type": "filter", + "doc": { + "description": "Filter the HTML markup for a single product image thumbnail in the gallery.", + "long_description": "", + "tags": [ + { + "name": "param", + "content": "The HTML markup for the thumbnail.", + "types": [ + "string" + ], + "variable": "$thumbnail_html" + }, + { + "name": "param", + "content": "The attachment ID of the thumbnail.", + "types": [ + "int" + ], + "variable": "$attachment_id" + }, + { + "name": "since", + "content": "7.9.0" + } + ], + "long_description_html": "" + }, + "args": 2 + }, { "name": "woocommerce_store_api_add_to_cart_data", "file": "StoreApi/Routes/V1/CartAddItem.php", @@ -1286,66 +1499,6 @@ "long_description_html": "" }, "args": 1 - }, - { - "name": "woocommerce_variation_option_name", - "file": "StoreApi/Schemas/V1/CartItemSchema.php", - "type": "filter", - "doc": { - "description": "Filters the variation option name.", - "long_description": "Filters the variation option name for custom option slugs.", - "tags": [ - { - "name": "since", - "content": "2.5.0" - }, - { - "name": "internal", - "content": "Matches filter name in WooCommerce core." - }, - { - "name": "param", - "content": "The name to display.", - "types": [ - "string" - ], - "variable": "$value" - }, - { - "name": "param", - "content": "Unused because this is not a variation taxonomy.", - "types": [ - "null" - ], - "variable": "$unused" - }, - { - "name": "param", - "content": "Taxonomy or product attribute name.", - "types": [ - "string" - ], - "variable": "$taxonomy" - }, - { - "name": "param", - "content": "Product data.", - "types": [ - "\\WC_Product" - ], - "variable": "$product" - }, - { - "name": "return", - "content": "", - "types": [ - "string" - ] - } - ], - "long_description_html": "

Filters the variation option name for custom option slugs.

" - }, - "args": 4 } ] } \ No newline at end of file diff --git a/plugins/woocommerce-blocks/bin/hook-docs/utilities/generate-toc.js b/plugins/woocommerce-blocks/bin/hook-docs/utilities/generate-toc.js index 6ec1e80aec5..ae96ff12a85 100644 --- a/plugins/woocommerce-blocks/bin/hook-docs/utilities/generate-toc.js +++ b/plugins/woocommerce-blocks/bin/hook-docs/utilities/generate-toc.js @@ -12,11 +12,14 @@ const generateToc = ( hooks ) => { const heading = isDeprecated ? `~~${ hookName }~~` : `${ hookName }`; - let anchor = heading .trim() .toLowerCase() + .replace( /\(\)/g, '' ) + .replace( /\{\$(.*?)->(.*?)}/g, '$1-$2' ) + .replace( /\{\$(.*?)}/g, '$1' ) .replace( /[^\w\- ]+/g, ' ' ) + .trim() .replace( /\s+/g, '-' ) .replace( /\-+$/, '' ); if ( usedHeaders.indexOf( anchor ) !== -1 ) { @@ -28,7 +31,6 @@ const generateToc = ( hooks ) => { anchor = anchor + '-' + i; } usedHeaders.push( anchor ); - return `[${ hook.name }](#${ anchor })`; } ), }, diff --git a/plugins/woocommerce-blocks/docs/README.md b/plugins/woocommerce-blocks/docs/README.md index 3b18fdb9600..ea940e2e8ef 100644 --- a/plugins/woocommerce-blocks/docs/README.md +++ b/plugins/woocommerce-blocks/docs/README.md @@ -152,3 +152,4 @@ The following tutorials from [developer.woocommerce.com](https://developer.wooco 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/README.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/README.md b/plugins/woocommerce-blocks/docs/contributors/README.md index 54615cf240b..a43293e5131 100644 --- a/plugins/woocommerce-blocks/docs/contributors/README.md +++ b/plugins/woocommerce-blocks/docs/contributors/README.md @@ -36,6 +36,8 @@ Our [JavaScript Build System](javascript-build-system.md) guide offers a detaile Last but not least, to get an insight into how CSS is built, refer to the [CSS Build System](css-build-system.md) guide. A firm grasp of this will ensure your CSS files meet the standards and quality expected. + + --- [We're hiring!](https://woocommerce.com/careers/) Come work with us! @@ -43,3 +45,4 @@ Last but not least, to get an insight into how CSS is built, refer to the [CSS B 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/README.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/block-assets.md b/plugins/woocommerce-blocks/docs/contributors/block-assets.md index 63f2a916cc3..d60663d4db0 100644 --- a/plugins/woocommerce-blocks/docs/contributors/block-assets.md +++ b/plugins/woocommerce-blocks/docs/contributors/block-assets.md @@ -95,6 +95,7 @@ wc.wcSettings.getSetting( 'key' ); [We're hiring!](https://woocommerce.com/careers/) Come work with us! -🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/documentation-guidelines.md) +🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/block-assets.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/coding-guidelines.md b/plugins/woocommerce-blocks/docs/contributors/coding-guidelines.md index 70a095e6a24..099fbacfdad 100644 --- a/plugins/woocommerce-blocks/docs/contributors/coding-guidelines.md +++ b/plugins/woocommerce-blocks/docs/contributors/coding-guidelines.md @@ -179,6 +179,7 @@ Notice in the worst case scenario we would have increased selector specificity b [We're hiring!](https://woocommerce.com/careers/) Come work with us! -🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/documentation-guidelines.md) +🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/coding-guidelines.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/components.md b/plugins/woocommerce-blocks/docs/contributors/components.md index cb17a0281c8..71081ad3673 100644 --- a/plugins/woocommerce-blocks/docs/contributors/components.md +++ b/plugins/woocommerce-blocks/docs/contributors/components.md @@ -46,6 +46,7 @@ If you're stuck, copy source of an existing story to get started. [We're hiring!](https://woocommerce.com/careers/) Come work with us! -🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/documentation-guidelines.md) +🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/components.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/css-build-system.md b/plugins/woocommerce-blocks/docs/contributors/css-build-system.md index 0402b368542..6ef51402101 100644 --- a/plugins/woocommerce-blocks/docs/contributors/css-build-system.md +++ b/plugins/woocommerce-blocks/docs/contributors/css-build-system.md @@ -31,6 +31,7 @@ Webpack config is split between several files, some relevant ones for the CSS bu [We're hiring!](https://woocommerce.com/careers/) Come work with us! -🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/documentation-guidelines.md) +🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/css-build-system.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/documentation-guidelines.md b/plugins/woocommerce-blocks/docs/contributors/documentation-guidelines.md index 445d3ef1408..eb515d535e2 100644 --- a/plugins/woocommerce-blocks/docs/contributors/documentation-guidelines.md +++ b/plugins/woocommerce-blocks/docs/contributors/documentation-guidelines.md @@ -168,3 +168,4 @@ When referencing other documentations, the corresponding document should be link 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/documentation-guidelines.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/e2e-guidelines.md b/plugins/woocommerce-blocks/docs/contributors/e2e-guidelines.md index 1bcc1e46c48..e7c26644120 100644 --- a/plugins/woocommerce-blocks/docs/contributors/e2e-guidelines.md +++ b/plugins/woocommerce-blocks/docs/contributors/e2e-guidelines.md @@ -62,6 +62,7 @@ By using these packages, you can make your code more modular and easier to maint [We're hiring!](https://woocommerce.com/careers/) Come work with us! -🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/documentation-guidelines.md) +🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/e2e-guidelines.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/folder-structure.md b/plugins/woocommerce-blocks/docs/contributors/folder-structure.md index 9ead474b67e..9e4edc88885 100644 --- a/plugins/woocommerce-blocks/docs/contributors/folder-structure.md +++ b/plugins/woocommerce-blocks/docs/contributors/folder-structure.md @@ -197,3 +197,4 @@ This file is inspired by the great work of @JustinyAhin and @gziolo in + diff --git a/plugins/woocommerce-blocks/docs/contributors/getting-started.md b/plugins/woocommerce-blocks/docs/contributors/getting-started.md index 32b009f5b8b..8c21f8f1042 100644 --- a/plugins/woocommerce-blocks/docs/contributors/getting-started.md +++ b/plugins/woocommerce-blocks/docs/contributors/getting-started.md @@ -151,3 +151,4 @@ To find out more about how to run automated JavaScript tests, check out the docu 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/getting-started.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/javascript-build-system.md b/plugins/woocommerce-blocks/docs/contributors/javascript-build-system.md index 53ca09223f5..f1bd44bbc2c 100644 --- a/plugins/woocommerce-blocks/docs/contributors/javascript-build-system.md +++ b/plugins/woocommerce-blocks/docs/contributors/javascript-build-system.md @@ -84,3 +84,4 @@ Webpack config is split between several files: 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/javascript-build-system.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/javascript-testing.md b/plugins/woocommerce-blocks/docs/contributors/javascript-testing.md index 98dc2d65ba3..0268c7684d8 100644 --- a/plugins/woocommerce-blocks/docs/contributors/javascript-testing.md +++ b/plugins/woocommerce-blocks/docs/contributors/javascript-testing.md @@ -118,3 +118,4 @@ When preparing for a new version of WordPress, it's a good practice to search fo 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/javascript-testing.md) + diff --git a/plugins/woocommerce-blocks/docs/contributors/storybook-and-components.md b/plugins/woocommerce-blocks/docs/contributors/storybook-and-components.md index ad7fe3f78a2..823de03da5d 100644 --- a/plugins/woocommerce-blocks/docs/contributors/storybook-and-components.md +++ b/plugins/woocommerce-blocks/docs/contributors/storybook-and-components.md @@ -53,3 +53,4 @@ If you're stuck, copy source of an existing story to get started. 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/contributors/storybook-and-components.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/README.md b/plugins/woocommerce-blocks/docs/designers/theming/README.md index 9ce791b5a18..ac14bf5a114 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/README.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/README.md @@ -89,3 +89,4 @@ WooCommerce Blocks avoids using legacy unprefixed classes as much as possible. H 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/README.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/cart-and-checkout.md b/plugins/woocommerce-blocks/docs/designers/theming/cart-and-checkout.md index 04dc7d9cf0b..2e12ca7d70d 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/cart-and-checkout.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/cart-and-checkout.md @@ -87,3 +87,4 @@ By default, it uses a combination of black and white borders and shadows so it h 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/cart-and-checkout.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-280.md b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-280.md index e6201393be4..75ae51248ea 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-280.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-280.md @@ -97,3 +97,4 @@ For example, given that `wc-block-error` changed to `wc-block-components-error` 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/class-names-update-280.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-330.md b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-330.md index cabd5d21319..53d452411b5 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-330.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-330.md @@ -26,3 +26,4 @@ In [WooCommerce Blocks 3.3.0](https://developer.woocommerce.com/2020/09/02/wooco 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/class-names-update-330.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-340.md b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-340.md index ef5e4cc5f20..e4b56b87df8 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-340.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-340.md @@ -17,3 +17,4 @@ In [WooCommerce Blocks 3.4.0](https://developer.woocommerce.com/2020/09/15/wooco 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/class-names-update-340.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-460.md b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-460.md index a4530ebafd2..5862a1a47d0 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-460.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/class-names-update-460.md @@ -20,3 +20,4 @@ In [WooCommerce Blocks 4.6.0](https://developer.woocommerce.com/2021/03/02/wooco 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/class-names-update-460.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/filter-blocks.md b/plugins/woocommerce-blocks/docs/designers/theming/filter-blocks.md index 75665eef188..14cfd3ec80d 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/filter-blocks.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/filter-blocks.md @@ -37,3 +37,4 @@ Notice the code snippet above uses a CSS custom property, so the default color m 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/filter-blocks.md) + diff --git a/plugins/woocommerce-blocks/docs/designers/theming/product-grid-270.md b/plugins/woocommerce-blocks/docs/designers/theming/product-grid-270.md index 076d251297e..688004c134d 100644 --- a/plugins/woocommerce-blocks/docs/designers/theming/product-grid-270.md +++ b/plugins/woocommerce-blocks/docs/designers/theming/product-grid-270.md @@ -52,3 +52,4 @@ _All Products_ block was updated so prices follow the same layout as the other p 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/designers/theming/product-grid-270.md) + diff --git a/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-api.md b/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-api.md index ea8afbd495d..58b9e93b14b 100644 --- a/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-api.md +++ b/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-api.md @@ -17,7 +17,7 @@ - [Examples](#examples) - [Passing a value from the client through to server side payment processing](#passing-a-value-from-the-client-through-to-server-side-payment-processing) -This document gives an overview of some of the major architectural components/APIs for the checkout block. If you haven't already, you may also want to read about the [Checkout Flow and Events](../../extensibility/checkout-flow-and-events.md). +This document gives an overview of some of the major architectural components/APIs for the checkout block. If you haven't already, you may also want to read about the [Checkout Flow and Events](checkout-flow-and-events.md). ## Data Stores diff --git a/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md b/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md index 77a0bb7e96a..bb00a7bed69 100644 --- a/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md +++ b/plugins/woocommerce-blocks/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md @@ -9,7 +9,7 @@ - [`ShippingProvider` Exposed Statuses](#shippingprovider-exposed-statuses) - [Payment Method Data Store Status](#payment-method-data-store-status) - [Emitting Events](#emitting-events) - - [`onCheckoutValidation`](#onCheckoutValidation) + - [`onCheckoutValidation`](#oncheckoutvalidation) - [`onPaymentProcessing`](#onpaymentprocessing) - [Success](#success) - [Fail](#fail) @@ -52,7 +52,7 @@ The following statuses exist in the Checkout. #### Checkout Data Store Status -There are various statuses that are exposed on the Checkout data store via selectors. All the selectors are detailed below and in the [Checkout API docs](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/block-client-apis/checkout/checkout-api.md). +There are various statuses that are exposed on the Checkout data store via selectors. All the selectors are detailed below and in the [Checkout API docs](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/internal-developers/block-client-apis/checkout/checkout-api.md). You can use them in your component like so diff --git a/plugins/woocommerce-blocks/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md b/plugins/woocommerce-blocks/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md index be627273db2..e2febc8d81e 100644 --- a/plugins/woocommerce-blocks/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md +++ b/plugins/woocommerce-blocks/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md @@ -7,7 +7,6 @@ - [Experimental flag](#experimental-flag) - [Features behind flags](#features-behind-flags) - [Feature plugin flag](#feature-plugin-flag-1) - - [Experimental plugin flag](#experimental-plugin-flag) - [Processes and commands that use a flag](#processes-and-commands-that-use-a-flag) - [Usages of `__experimental` prefix](#usages-of-__experimental-prefix) - [PHP filters and actions](#php-filters-and-actions) diff --git a/plugins/woocommerce-blocks/docs/internal-developers/testing/cart-checkout/data-stores.md b/plugins/woocommerce-blocks/docs/internal-developers/testing/cart-checkout/data-stores.md index e8686e5ad6e..f100b7f5e50 100644 --- a/plugins/woocommerce-blocks/docs/internal-developers/testing/cart-checkout/data-stores.md +++ b/plugins/woocommerce-blocks/docs/internal-developers/testing/cart-checkout/data-stores.md @@ -46,7 +46,7 @@ Go to: [https://github.com/woocommerce/woocommerce-gateway-stripe/blob/8ffd22aff ### Interaction with unusable payment methods -- Install and activate [WooCommerce Bookings](https://github.com/woocommerce/woocommerce-bookings). Add a bookable product, ensure to add a cost to it on the edit product page, then: +- Install and activate [WooCommerce Bookings](https://woocommerce.com/products/woocommerce-bookings/). Add a bookable product, ensure to add a cost to it on the edit product page, then: - Add a _normal_ (i.e. Beanie, Hoodie etc.) product to the cart and ensure you can check out successfully. - Then add a bookable product, ensure you can check out successfully. diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/README.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/README.md index dd285d196b7..aa4aa2ba092 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/README.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/README.md @@ -56,3 +56,4 @@ In addition to the reference material below, [please see the `block-checkout` pa 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/README.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md index fe72e5e53e0..9fec5051140 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md @@ -367,3 +367,4 @@ The error will also be shown in your console. 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/available-filters.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md index 76048d71edf..d172643c5f8 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md @@ -101,3 +101,4 @@ Checkout: 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/dom-events.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/dom-events.md index 7245d6f179e..d4310b72d62 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/dom-events.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/dom-events.md @@ -50,3 +50,4 @@ _Example usage in WC Blocks:_ Cart and Mini-Cart blocks (via the `useStoreCart() 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/dom-events.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md index 0b4cb420f63..7aba8f5d4ac 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md @@ -145,3 +145,4 @@ The `checkPaymentMethodsCanPay()` [function](https://github.com/woocommerce/wooc 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/how-checkout-processes-an-order.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/integration-interface.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/integration-interface.md index 915c6d1205c..2ad690389c4 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/integration-interface.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/integration-interface.md @@ -213,3 +213,4 @@ The value returned here is a plain old JavaScript object, keyed by the keys of t 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/integration-interface.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/slot-fills.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/slot-fills.md index e6dd133ba3c..10a0525b071 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/slot-fills.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/slot-fills.md @@ -72,3 +72,4 @@ For this to work, your script must be enqueued after Cart and Checkout. You can 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-block/slot-fills.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md index 666b762f320..bcadd370160 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md @@ -4,6 +4,8 @@ To see the Checkout Flow and Events please consult the following document: [Checkout Flow and Events](../../../../docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md) + + --- [We're hiring!](https://woocommerce.com/careers/) Come work with us! @@ -11,3 +13,4 @@ To see the Checkout Flow and Events please consult the following document: 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md index e0041826a38..ceba6960536 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md @@ -174,3 +174,4 @@ If you've added your payment method correctly with the correct `supports` values 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md index 53ac3235165..fdff219c994 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md @@ -265,3 +265,4 @@ As an example, you can see how the Stripe extension adds it's integration in thi 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/README.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/README.md index 50ace2aa889..17849c1c915 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/README.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/README.md @@ -16,3 +16,4 @@ 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/README.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/cart.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/cart.md index f15e6915227..29ba2289408 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/cart.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/cart.md @@ -410,3 +410,4 @@ const isShippingRateBeingSelected = store.isShippingRateBeingSelected(); 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/cart.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/checkout.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/checkout.md index ac05a5e5d6a..c94a0de8d31 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/checkout.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/checkout.md @@ -167,3 +167,4 @@ This is true when the total is being re-calculated for the order. There are nume 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/checkout.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/payment.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/payment.md index be2313a5ccb..a3201b49561 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/payment.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/payment.md @@ -13,7 +13,7 @@ - [getSavedPaymentMethods](#getsavedpaymentmethods) - [getActiveSavedPaymentMethods](#getactivesavedpaymentmethods) - [getShouldSavePaymentMethod](#getshouldsavepaymentmethod) - - [getCurrentStatus](#getcurrentstatus) + - [getCurrentStatus](#deprecated-getcurrentstatus) - [paymentMethodsInitialized](#paymentmethodsinitialized) - [expressPaymentMethodsInitialized](#expresspaymentmethodsinitialized) @@ -478,3 +478,4 @@ const expressPaymentMethodsInitialized = 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/payment.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/validation.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/validation.md index 50dda790a3d..531b134f350 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/validation.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/data-store/validation.md @@ -206,3 +206,4 @@ showAllValidationErrors(); 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/data-store/validation.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md index 8811bedbd18..8143c7a1925 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md @@ -6,46 +6,46 @@ ## Table of Contents -- [deprecated_function_run](#deprecated_function_run) -- [woocommerce_add_to_cart](#woocommerce_add_to_cart) -- [woocommerce_after_main_content](#woocommerce_after_main_content) -- [woocommerce_after_shop_loop](#woocommerce_after_shop_loop) -- [woocommerce_applied_coupon](#woocommerce_applied_coupon) -- [woocommerce_archive_description](#woocommerce_archive_description) -- [woocommerce_before_main_content](#woocommerce_before_main_content) -- [woocommerce_before_shop_loop](#woocommerce_before_shop_loop) -- [woocommerce_blocks_cart_enqueue_data](#woocommerce_blocks_cart_enqueue_data) -- [woocommerce_blocks_checkout_enqueue_data](#woocommerce_blocks_checkout_enqueue_data) -- [woocommerce_blocks_enqueue_cart_block_scripts_after](#woocommerce_blocks_enqueue_cart_block_scripts_after) -- [woocommerce_blocks_enqueue_cart_block_scripts_before](#woocommerce_blocks_enqueue_cart_block_scripts_before) -- [woocommerce_blocks_enqueue_checkout_block_scripts_after](#woocommerce_blocks_enqueue_checkout_block_scripts_after) -- [woocommerce_blocks_enqueue_checkout_block_scripts_before](#woocommerce_blocks_enqueue_checkout_block_scripts_before) -- [woocommerce_blocks_loaded](#woocommerce_blocks_loaded) -- [woocommerce*blocks*{$this->registry_identifier}\_registration](#woocommerce_blocks_-this--registry_identifier-_registration) -- [woocommerce_check_cart_items](#-woocommerce_check_cart_items) -- [woocommerce_created_customer](#woocommerce_created_customer) -- [woocommerce_no_products_found](#woocommerce_no_products_found) -- [woocommerce_register_post](#woocommerce_register_post) -- [woocommerce_rest_checkout_process_payment_with_context](#woocommerce_rest_checkout_process_payment_with_context) -- [woocommerce_shop_loop](#woocommerce_shop_loop) -- [woocommerce_store_api_cart_errors](#woocommerce_store_api_cart_errors) -- [woocommerce_store_api_cart_select_shipping_rate](#woocommerce_store_api_cart_select_shipping_rate) -- [woocommerce_store_api_cart_update_customer_from_request](#woocommerce_store_api_cart_update_customer_from_request) -- [woocommerce_store_api_cart_update_order_from_request](#woocommerce_store_api_cart_update_order_from_request) -- [woocommerce_store_api_checkout_order_processed](#woocommerce_store_api_checkout_order_processed) -- [woocommerce_store_api_checkout_update_customer_from_request](#woocommerce_store_api_checkout_update_customer_from_request) -- [woocommerce_store_api_checkout_update_order_from_request](#woocommerce_store_api_checkout_update_order_from_request) -- [woocommerce_store_api_checkout_update_order_meta](#woocommerce_store_api_checkout_update_order_meta) -- [woocommerce_store_api_rate_limit_exceeded](#woocommerce_store_api_rate_limit_exceeded) -- [woocommerce_store_api_validate_add_to_cart](#woocommerce_store_api_validate_add_to_cart) -- [woocommerce_store_api_validate_cart_item](#woocommerce_store_api_validate_cart_item) -- [woocommerce\_{$product->get_type()}\_add_to_cart](#woocommerce_-product--get_type-_add_to_cart) -- [{$hook}](#-hook) + + - [deprecated_function_run](#deprecated_function_run) + - [woocommerce_add_to_cart](#woocommerce_add_to_cart) + - [woocommerce_after_main_content](#woocommerce_after_main_content) + - [woocommerce_after_shop_loop](#woocommerce_after_shop_loop) + - [woocommerce_applied_coupon](#woocommerce_applied_coupon) + - [woocommerce_archive_description](#woocommerce_archive_description) + - [woocommerce_before_main_content](#woocommerce_before_main_content) + - [woocommerce_before_shop_loop](#woocommerce_before_shop_loop) + - [woocommerce_blocks_cart_enqueue_data](#woocommerce_blocks_cart_enqueue_data) + - [woocommerce_blocks_checkout_enqueue_data](#woocommerce_blocks_checkout_enqueue_data) + - [woocommerce_blocks_enqueue_cart_block_scripts_after](#woocommerce_blocks_enqueue_cart_block_scripts_after) + - [woocommerce_blocks_enqueue_cart_block_scripts_before](#woocommerce_blocks_enqueue_cart_block_scripts_before) + - [woocommerce_blocks_enqueue_checkout_block_scripts_after](#woocommerce_blocks_enqueue_checkout_block_scripts_after) + - [woocommerce_blocks_enqueue_checkout_block_scripts_before](#woocommerce_blocks_enqueue_checkout_block_scripts_before) + - [woocommerce_blocks_loaded](#woocommerce_blocks_loaded) + - [woocommerce_blocks_{$this->registry_identifier}_registration](#woocommerce_blocks_this-registry_identifier_registration) + - [woocommerce_check_cart_items](#woocommerce_check_cart_items) + - [woocommerce_created_customer](#woocommerce_created_customer) + - [woocommerce_no_products_found](#woocommerce_no_products_found) + - [woocommerce_register_post](#woocommerce_register_post) + - [woocommerce_shop_loop](#woocommerce_shop_loop) + - [woocommerce_store_api_cart_errors](#woocommerce_store_api_cart_errors) + - [woocommerce_store_api_cart_select_shipping_rate](#woocommerce_store_api_cart_select_shipping_rate) + - [woocommerce_store_api_cart_update_customer_from_request](#woocommerce_store_api_cart_update_customer_from_request) + - [woocommerce_store_api_cart_update_order_from_request](#woocommerce_store_api_cart_update_order_from_request) + - [woocommerce_store_api_checkout_order_processed](#woocommerce_store_api_checkout_order_processed) + - [woocommerce_store_api_checkout_update_customer_from_request](#woocommerce_store_api_checkout_update_customer_from_request) + - [woocommerce_store_api_checkout_update_order_meta](#woocommerce_store_api_checkout_update_order_meta) + - [woocommerce_store_api_rate_limit_exceeded](#woocommerce_store_api_rate_limit_exceeded) + - [woocommerce_store_api_validate_add_to_cart](#woocommerce_store_api_validate_add_to_cart) + - [woocommerce_store_api_validate_cart_item](#woocommerce_store_api_validate_cart_item) + - [woocommerce_{$product->get_type()}_add_to_cart](#woocommerce_product-get_type_add_to_cart) + - [{$hook}](#hook) --- ## deprecated_function_run + Fires when a deprecated function is called. ```php @@ -54,18 +54,21 @@ do_action( 'deprecated_function_run' ) ### Source -- [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php) + + - [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php) --- ## woocommerce_add_to_cart + Fires when an item is added to the cart. ```php do_action( 'woocommerce_add_to_cart', string $cart_id, integer $product_id, integer $request_quantity, integer $variation_id, array $variation, array $cart_item_data ) ``` + **Note: Matches action name in WooCommerce core.** ### Description @@ -74,23 +77,25 @@ do_action( 'woocommerce_add_to_cart', string $cart_id, integer $product_id, inte ### Parameters -| Argument | Type | Description | -| ----------------- | ------- | ---------------------------------------------- | -| $cart_id | string | ID of the item in the cart. | -| $product_id | integer | ID of the product added to the cart. | -| $request_quantity | integer | Quantity of the item added to the cart. | -| $variation_id | integer | Variation ID of the product added to the cart. | -| $variation | array | Array of variation data. | -| $cart_item_data | array | Array of other cart item data. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $cart_id | string | ID of the item in the cart. | +| $product_id | integer | ID of the product added to the cart. | +| $request_quantity | integer | Quantity of the item added to the cart. | +| $variation_id | integer | Variation ID of the product added to the cart. | +| $variation | array | Array of variation data. | +| $cart_item_data | array | Array of other cart item data. | ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_after_main_content + Hook: woocommerce_after_main_content ```php @@ -103,17 +108,20 @@ do_action( 'woocommerce_after_main_content' ) ### See -- woocommerce_output_content_wrapper_end() - Outputs closing DIV for the content (priority 10) + + - woocommerce_output_content_wrapper_end() - Outputs closing DIV for the content (priority 10) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_after_shop_loop + Hook: woocommerce_after_shop_loop. ```php @@ -122,38 +130,44 @@ do_action( 'woocommerce_after_shop_loop' ) ### See -- woocommerce_pagination() - Renders pagination (priority 10) + + - woocommerce_pagination() - Renders pagination (priority 10) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_applied_coupon + Fires after a coupon has been applied to the cart. ```php do_action( 'woocommerce_applied_coupon', string $coupon_code ) ``` + **Note: Matches action name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| ------------ | ------ | --------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $coupon_code | string | The coupon code that was applied. | ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_archive_description + Hook: woocommerce_archive_description. ```php @@ -162,17 +176,20 @@ do_action( 'woocommerce_archive_description' ) ### See -- woocommerce_taxonomy_archive_description() - Renders the taxonomy archive description (priority 10) -- woocommerce_product_archive_description() - Renders the product archive description (priority 10) + + - woocommerce_taxonomy_archive_description() - Renders the taxonomy archive description (priority 10) + - woocommerce_product_archive_description() - Renders the product archive description (priority 10) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_before_main_content + Hook: woocommerce_before_main_content ```php @@ -185,19 +202,22 @@ do_action( 'woocommerce_before_main_content' ) ### See -- woocommerce_output_content_wrapper() - Outputs opening DIV for the content (priority 10) -- woocommerce_breadcrumb() - Outputs breadcrumb trail to the current product (priority 20) -- WC_Structured_Data::generate_website_data() - Outputs schema markup (priority 30) + + - woocommerce_output_content_wrapper() - Outputs opening DIV for the content (priority 10) + - woocommerce_breadcrumb() - Outputs breadcrumb trail to the current product (priority 20) + - WC_Structured_Data::generate_website_data() - Outputs schema markup (priority 30) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_before_shop_loop + Hook: woocommerce_before_shop_loop. ```php @@ -206,18 +226,21 @@ do_action( 'woocommerce_before_shop_loop' ) ### See -- woocommerce_output_all_notices() - Render error notices (priority 10) -- woocommerce_result_count() - Show number of results found (priority 20) -- woocommerce_catalog_ordering() - Show form to control sort order (priority 30) + + - woocommerce_output_all_notices() - Render error notices (priority 10) + - woocommerce_result_count() - Show number of results found (priority 20) + - woocommerce_catalog_ordering() - Show form to control sort order (priority 30) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_blocks_cart_enqueue_data + Fires after cart block data is registered. ```php @@ -226,13 +249,15 @@ do_action( 'woocommerce_blocks_cart_enqueue_data' ) ### Source -- [BlockTypes/MiniCart.php](../../../../src/BlockTypes/MiniCart.php) -- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) + + - [BlockTypes/MiniCart.php](../../../../src/BlockTypes/MiniCart.php) + - [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) --- ## woocommerce_blocks_checkout_enqueue_data + Fires after checkout block data is registered. ```php @@ -241,12 +266,14 @@ do_action( 'woocommerce_blocks_checkout_enqueue_data' ) ### Source -- [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) + + - [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) --- ## woocommerce_blocks_enqueue_cart_block_scripts_after + Fires after cart block scripts are enqueued. ```php @@ -255,12 +282,14 @@ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' ) ### Source -- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) + + - [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) --- ## woocommerce_blocks_enqueue_cart_block_scripts_before + Fires before cart block scripts are enqueued. ```php @@ -269,12 +298,14 @@ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' ) ### Source -- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) + + - [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) --- ## woocommerce_blocks_enqueue_checkout_block_scripts_after + Fires after checkout block scripts are enqueued. ```php @@ -283,12 +314,14 @@ do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_after' ) ### Source -- [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) + + - [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) --- ## woocommerce_blocks_enqueue_checkout_block_scripts_before + Fires before checkout block scripts are enqueued. ```php @@ -297,12 +330,14 @@ do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_before' ) ### Source -- [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) + + - [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) --- ## woocommerce_blocks_loaded + Fires when the woocommerce blocks are loaded and ready to use. ```php @@ -315,11 +350,13 @@ do_action( 'woocommerce_blocks_loaded' ) ### Source -- [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php) + + - [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php) --- -## woocommerce*blocks*{$this->registry_identifier}\_registration +## woocommerce_blocks_{$this->registry_identifier}_registration + Fires when the IntegrationRegistry is initialized. @@ -333,26 +370,30 @@ do_action( 'woocommerce_blocks_{$this->registry_identifier}_registration', \Auto ### Parameters -| Argument | Type | Description | -| -------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| $this | \Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry | Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $this | \Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry | Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method. | ### Source -- [Integrations/IntegrationRegistry.php](../../../../src/Integrations/IntegrationRegistry.php) + + - [Integrations/IntegrationRegistry.php](../../../../src/Integrations/IntegrationRegistry.php) --- ## ~~woocommerce_check_cart_items~~ + Fires when cart items are being validated. ```php do_action( 'woocommerce_check_cart_items' ) ``` + **Deprecated: This hook is deprecated and will be removed** + **Note: Matches action name in WooCommerce core.** ### Description @@ -361,18 +402,21 @@ do_action( 'woocommerce_check_cart_items' ) ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_created_customer + Fires after a customer account has been registered. ```php do_action( 'woocommerce_created_customer', integer $customer_id, array $new_customer_data, string $password_generated ) ``` + **Note: Matches filter name in WooCommerce core.** ### Description @@ -381,20 +425,22 @@ do_action( 'woocommerce_created_customer', integer $customer_id, array $new_cust ### Parameters -| Argument | Type | Description | -| ------------------- | ------- | --------------------------------------- | -| $customer_id | integer | New customer (user) ID. | -| $new_customer_data | array | Array of customer (user) data. | -| $password_generated | string | The generated password for the account. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $customer_id | integer | New customer (user) ID. | +| $new_customer_data | array | Array of customer (user) data. | +| $password_generated | string | The generated password for the account. | ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- ## woocommerce_no_products_found + Hook: woocommerce_no_products_found. ```php @@ -403,22 +449,26 @@ do_action( 'woocommerce_no_products_found' ) ### See -- wc_no_products_found() - Default no products found content (priority 10) + + - wc_no_products_found() - Default no products found content (priority 10) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_register_post + Fires before a customer account is registered. ```php do_action( 'woocommerce_register_post', string $username, string $user_email, \WP_Error $errors ) ``` + **Note: Matches filter name in WooCommerce core.** ### Description @@ -427,45 +477,22 @@ do_action( 'woocommerce_register_post', string $username, string $user_email, \W ### Parameters -| Argument | Type | Description | -| ----------- | --------- | ----------------------- | -| $username | string | Customer username. | -| $user_email | string | Customer email address. | -| $errors | \WP_Error | Error object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $username | string | Customer username. | +| $user_email | string | Customer email address. | +| $errors | \WP_Error | Error object. | ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) ---- - -## woocommerce_rest_checkout_process_payment_with_context - -Process payment with context. - -```php -do_action_ref_array( 'woocommerce_rest_checkout_process_payment_with_context', [ \Automattic\WooCommerce\StoreApi\Payments\PaymentContext $context, \Automattic\WooCommerce\StoreApi\Payments\PaymentResult $payment_result ] ) -``` - -### Parameters - -| Argument | Type | Description | -| --------------- | -------------------------------------------------------- | --------------------------------------------------------------------- | -| $context | \Automattic\WooCommerce\StoreApi\Payments\PaymentContext | Holds context for the payment, including order ID and payment method. | -| $payment_result | \Automattic\WooCommerce\StoreApi\Payments\PaymentResult | Result object for the transaction. | - -### Exceptions - -`\Exception` If there is an error taking payment, an \Exception object can be thrown with an error message. - -### Source - -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- ## woocommerce_shop_loop + Hook: woocommerce_shop_loop. ```php @@ -474,12 +501,14 @@ do_action( 'woocommerce_shop_loop' ) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- ## woocommerce_store_api_cart_errors + Fires an action to validate the cart. ```php @@ -492,10 +521,10 @@ do_action( 'woocommerce_store_api_cart_errors', \WP_Error $errors, \WC_Cart $car ### Parameters -| Argument | Type | Description | -| -------- | --------- | ---------------- | -| $errors | \WP_Error | WP_Error object. | -| $cart | \WC_Cart | Cart object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $errors | \WP_Error | WP_Error object. | +| $cart | \WC_Cart | Cart object. | ### Example @@ -514,14 +543,17 @@ function my_function_callback( $errors, $cart ) { add_action( 'woocommerce_store_api_cart_errors', 'my_function_callback', 10 ); ``` + ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_store_api_cart_select_shipping_rate + Fires an action after a shipping method has been chosen for package(s) via the Store API. ```php @@ -534,20 +566,22 @@ do_action( 'woocommerce_store_api_cart_select_shipping_rate', string|null $packa ### Parameters -| Argument | Type | Description | -| ----------- | ---------------- | -------------------------------------------------------------------------------------- | -| $package_id | string, null | The sanitized ID of the package being updated. Null if all packages are being updated. | -| $rate_id | string | The sanitized chosen rate ID for the package. | -| $request | \WP_REST_Request | Full details about the request. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $package_id | string, null | The sanitized ID of the package being updated. Null if all packages are being updated. | +| $rate_id | string | The sanitized chosen rate ID for the package. | +| $request | \WP_REST_Request | Full details about the request. | ### Source -- [StoreApi/Routes/V1/CartSelectShippingRate.php](../../../../src/StoreApi/Routes/V1/CartSelectShippingRate.php) + + - [StoreApi/Routes/V1/CartSelectShippingRate.php](../../../../src/StoreApi/Routes/V1/CartSelectShippingRate.php) --- ## woocommerce_store_api_cart_update_customer_from_request + Fires when the Checkout Block/Store API updates a customer from the API request data. ```php @@ -556,19 +590,21 @@ do_action( 'woocommerce_store_api_cart_update_customer_from_request', \WC_Custom ### Parameters -| Argument | Type | Description | -| --------- | ---------------- | ------------------------------- | -| $customer | \WC_Customer | Customer object. | -| $request | \WP_REST_Request | Full details about the request. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $customer | \WC_Customer | Customer object. | +| $request | \WP_REST_Request | Full details about the request. | ### Source -- [StoreApi/Routes/V1/CartUpdateCustomer.php](../../../../src/StoreApi/Routes/V1/CartUpdateCustomer.php) + + - [StoreApi/Routes/V1/CartUpdateCustomer.php](../../../../src/StoreApi/Routes/V1/CartUpdateCustomer.php) --- ## woocommerce_store_api_cart_update_order_from_request + Fires when the order is synced with cart data from a cart route. ```php @@ -577,20 +613,22 @@ do_action( 'woocommerce_store_api_cart_update_order_from_request', \WC_Order $dr ### Parameters -| Argument | Type | Description | -| ------------ | ---------------- | ------------------------------- | -| $draft_order | \WC_Order | Order object. | -| $customer | \WC_Customer | Customer object. | -| $request | \WP_REST_Request | Full details about the request. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $draft_order | \WC_Order | Order object. | +| $customer | \WC_Customer | Customer object. | +| $request | \WP_REST_Request | Full details about the request. | ### Source -- [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) + + - [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) --- ## woocommerce_store_api_checkout_order_processed + Fires before an order is processed by the Checkout Block/Store API. ```php @@ -603,9 +641,9 @@ do_action( 'woocommerce_store_api_checkout_order_processed', \WC_Order $order ) ### Parameters -| Argument | Type | Description | -| -------- | --------- | ------------- | -| $order | \WC_Order | Order object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $order | \WC_Order | Order object. | ### Example @@ -621,18 +659,23 @@ function my_function_callback( $order ) { add_action( 'woocommerce_blocks_checkout_order_processed', 'my_function_callback', 10 ); ``` + ### See -- https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238 + + - https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238 ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + + - [StoreApi/Routes/V1/CheckoutOrder.php](../../../../src/StoreApi/Routes/V1/CheckoutOrder.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- ## woocommerce_store_api_checkout_update_customer_from_request + Fires when the Checkout Block/Store API updates a customer from the API request data. ```php @@ -641,44 +684,22 @@ do_action( 'woocommerce_store_api_checkout_update_customer_from_request', \WC_Cu ### Parameters -| Argument | Type | Description | -| --------- | ---------------- | ------------------------------- | -| $customer | \WC_Customer | Customer object. | -| $request | \WP_REST_Request | Full details about the request. | - -### Source - -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) - ---- - -## woocommerce_store_api_checkout_update_order_from_request - -Fires when the Checkout Block/Store API updates an order's from the API request data. - -```php -do_action( 'woocommerce_store_api_checkout_update_order_from_request', \WC_Order $order, \WP_REST_Request $request ) -``` - -### Description - -

This hook gives extensions the chance to update orders based on the data in the request. This can be used in conjunction with the ExtendSchema class to post custom data and then process it.

- -### Parameters - -| Argument | Type | Description | -| -------- | ---------------- | ------------------------------- | -| $order | \WC_Order | Order object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $customer | \WC_Customer | Customer object. | | $request | \WP_REST_Request | Full details about the request. | ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + + - [StoreApi/Routes/V1/CheckoutOrder.php](../../../../src/StoreApi/Routes/V1/CheckoutOrder.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- ## woocommerce_store_api_checkout_update_order_meta + Fires when the Checkout Block/Store API updates an order's meta data. ```php @@ -691,22 +712,25 @@ do_action( 'woocommerce_store_api_checkout_update_order_meta', \WC_Order $order ### Parameters -| Argument | Type | Description | -| -------- | --------- | ------------- | -| $order | \WC_Order | Order object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $order | \WC_Order | Order object. | ### See -- https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686 + + - https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686 ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- ## woocommerce_store_api_rate_limit_exceeded + Fires when the rate limit is exceeded. ```php @@ -715,18 +739,20 @@ do_action( 'woocommerce_store_api_rate_limit_exceeded', string $ip_address ) ### Parameters -| Argument | Type | Description | -| ----------- | ------ | ------------------------------ | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $ip_address | string | The IP address of the request. | ### Source -- [StoreApi/Authentication.php](../../../../src/StoreApi/Authentication.php) + + - [StoreApi/Authentication.php](../../../../src/StoreApi/Authentication.php) --- ## woocommerce_store_api_validate_add_to_cart + Fires during validation when adding an item to the cart via the Store API. ```php @@ -739,19 +765,21 @@ do_action( 'woocommerce_store_api_validate_add_to_cart', \WC_Product $product, a ### Parameters -| Argument | Type | Description | -| -------- | ----------- | ---------------------------------------------------------------------------- | -| $product | \WC_Product | Product object being added to the cart. | -| $request | array | Add to cart request params including id, quantity, and variation attributes. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $product | \WC_Product | Product object being added to the cart. | +| $request | array | Add to cart request params including id, quantity, and variation attributes. | ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_store_api_validate_cart_item + Fire action to validate add to cart. Functions hooking into this should throw an \Exception to prevent add to cart from occurring. ```php @@ -760,18 +788,20 @@ do_action( 'woocommerce_store_api_validate_cart_item', \WC_Product $product, arr ### Parameters -| Argument | Type | Description | -| ---------- | ----------- | --------------------------------------- | -| $product | \WC_Product | Product object being added to the cart. | -| $cart_item | array | Cart item array. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $product | \WC_Product | Product object being added to the cart. | +| $cart_item | array | Cart item array. | ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- -## woocommerce\_{$product->get_type()}\_add_to_cart +## woocommerce_{$product->get_type()}_add_to_cart + Trigger the single product add to cart action for each product type. @@ -781,12 +811,14 @@ do_action( 'woocommerce_{$product->get_type()}_add_to_cart' ) ### Source -- [BlockTypes/AddToCartForm.php](../../../../src/BlockTypes/AddToCartForm.php) + + - [BlockTypes/AddToCartForm.php](../../../../src/BlockTypes/AddToCartForm.php) --- ## {$hook} + Action to render the content of a hook. ```php @@ -795,10 +827,10 @@ do_action( '{$hook}' ) ### Source -- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) + + - [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) --- - --- @@ -808,3 +840,4 @@ do_action( '{$hook}' ) 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/hooks/actions.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md index b446dff5f9d..2ac864847ab 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md @@ -6,45 +6,52 @@ ## Table of Contents -- [\_\_experimental_woocommerce_blocks_add_data_attributes_to_block](#__experimental_woocommerce_blocks_add_data_attributes_to_block) -- [\_\_experimental_woocommerce_blocks_add_data_attributes_to_namespace](#__experimental_woocommerce_blocks_add_data_attributes_to_namespace) -- [\_\_experimental_woocommerce_blocks_payment_gateway_features_list](#__experimental_woocommerce_blocks_payment_gateway_features_list) -- [deprecated_function_trigger_error](#deprecated_function_trigger_error) -- [wc_session_expiration](#wc_session_expiration) -- [woocommerce_add_cart_item](#woocommerce_add_cart_item) -- [woocommerce_add_cart_item_data](#woocommerce_add_cart_item_data) -- [woocommerce_add_to_cart_sold_individually_quantity](#woocommerce_add_to_cart_sold_individually_quantity) -- [woocommerce_add_to_cart_validation](#-woocommerce_add_to_cart_validation) -- [woocommerce_adjust_non_base_location_prices](#woocommerce_adjust_non_base_location_prices) -- [woocommerce_apply_base_tax_for_local_pickup](#woocommerce_apply_base_tax_for_local_pickup) -- [woocommerce_apply_individual_use_coupon](#woocommerce_apply_individual_use_coupon) -- [woocommerce_apply_with_individual_use_coupon](#woocommerce_apply_with_individual_use_coupon) -- [woocommerce_blocks_hook_compatibility_additional_data](#woocommerce_blocks_hook_compatibility_additional_data) -- [woocommerce_blocks_product_grid_is_cacheable](#woocommerce_blocks_product_grid_is_cacheable) -- [woocommerce_blocks_product_grid_item_html](#woocommerce_blocks_product_grid_item_html) -- [woocommerce_blocks_register_script_dependencies](#woocommerce_blocks_register_script_dependencies) -- [woocommerce_cart_contents_changed](#woocommerce_cart_contents_changed) -- [woocommerce_disable_compatibility_layer](#woocommerce_disable_compatibility_layer) -- [woocommerce_ga_disable_tracking](#woocommerce_ga_disable_tracking) -- [woocommerce_get_item_data](#woocommerce_get_item_data) -- [woocommerce_loop_add_to_cart_args](#woocommerce_loop_add_to_cart_args) -- [woocommerce_loop_add_to_cart_link](#woocommerce_loop_add_to_cart_link) -- [woocommerce_new_customer_data](#woocommerce_new_customer_data) -- [woocommerce_registration_errors](#woocommerce_registration_errors) -- [woocommerce_shared_settings](#-woocommerce_shared_settings) -- [woocommerce_shipping_package_name](#woocommerce_shipping_package_name) -- [woocommerce*shipping*{$this->id}\_is_available](#woocommerce_shipping_-this--id-_is_available) -- [woocommerce_show_page_title](#woocommerce_show_page_title) -- [woocommerce_store_api_add_to_cart_data](#woocommerce_store_api_add_to_cart_data) -- [woocommerce_store_api_disable_nonce_check](#woocommerce_store_api_disable_nonce_check) -- [woocommerce_store_api_product_quantity_limit](#woocommerce_store_api_product_quantity_limit) -- [woocommerce*store_api_product_quantity*{$value_type}](#woocommerce_store_api_product_quantity_-value_type) -- [woocommerce_store_api_rate_limit_options](#woocommerce_store_api_rate_limit_options) -- [woocommerce_variation_option_name](#woocommerce_variation_option_name) + + - [__experimental_woocommerce_blocks_add_data_attributes_to_block](#__experimental_woocommerce_blocks_add_data_attributes_to_block) + - [__experimental_woocommerce_blocks_add_data_attributes_to_namespace](#__experimental_woocommerce_blocks_add_data_attributes_to_namespace) + - [__experimental_woocommerce_blocks_payment_gateway_features_list](#__experimental_woocommerce_blocks_payment_gateway_features_list) + - [deprecated_function_trigger_error](#deprecated_function_trigger_error) + - [loop_shop_per_page](#loop_shop_per_page) + - [wc_session_expiration](#wc_session_expiration) + - [woocommerce_add_cart_item](#woocommerce_add_cart_item) + - [woocommerce_add_cart_item_data](#woocommerce_add_cart_item_data) + - [woocommerce_add_to_cart_quantity](#woocommerce_add_to_cart_quantity) + - [woocommerce_add_to_cart_sold_individually_quantity](#woocommerce_add_to_cart_sold_individually_quantity) + - [woocommerce_add_to_cart_validation](#woocommerce_add_to_cart_validation) + - [woocommerce_adjust_non_base_location_prices](#woocommerce_adjust_non_base_location_prices) + - [woocommerce_apply_base_tax_for_local_pickup](#woocommerce_apply_base_tax_for_local_pickup) + - [woocommerce_apply_individual_use_coupon](#woocommerce_apply_individual_use_coupon) + - [woocommerce_apply_with_individual_use_coupon](#woocommerce_apply_with_individual_use_coupon) + - [woocommerce_blocks_hook_compatibility_additional_data](#woocommerce_blocks_hook_compatibility_additional_data) + - [woocommerce_blocks_product_grid_is_cacheable](#woocommerce_blocks_product_grid_is_cacheable) + - [woocommerce_blocks_product_grid_item_html](#woocommerce_blocks_product_grid_item_html) + - [woocommerce_blocks_register_script_dependencies](#woocommerce_blocks_register_script_dependencies) + - [woocommerce_cart_contents_changed](#woocommerce_cart_contents_changed) + - [woocommerce_cart_item_permalink](#woocommerce_cart_item_permalink) + - [woocommerce_disable_compatibility_layer](#woocommerce_disable_compatibility_layer) + - [woocommerce_ga_disable_tracking](#woocommerce_ga_disable_tracking) + - [woocommerce_get_item_data](#woocommerce_get_item_data) + - [woocommerce_loop_add_to_cart_args](#woocommerce_loop_add_to_cart_args) + - [woocommerce_loop_add_to_cart_link](#woocommerce_loop_add_to_cart_link) + - [woocommerce_new_customer_data](#woocommerce_new_customer_data) + - [woocommerce_pay_order_product_has_enough_stock](#woocommerce_pay_order_product_has_enough_stock) + - [woocommerce_pay_order_product_in_stock](#woocommerce_pay_order_product_in_stock) + - [woocommerce_registration_errors](#woocommerce_registration_errors) + - [woocommerce_shared_settings](#woocommerce_shared_settings) + - [woocommerce_shipping_package_name](#woocommerce_shipping_package_name) + - [woocommerce_shipping_{$this->id}_is_available](#woocommerce_shipping_this-id_is_available) + - [woocommerce_show_page_title](#woocommerce_show_page_title) + - [woocommerce_single_product_image_thumbnail_html](#woocommerce_single_product_image_thumbnail_html) + - [woocommerce_store_api_add_to_cart_data](#woocommerce_store_api_add_to_cart_data) + - [woocommerce_store_api_disable_nonce_check](#woocommerce_store_api_disable_nonce_check) + - [woocommerce_store_api_product_quantity_limit](#woocommerce_store_api_product_quantity_limit) + - [woocommerce_store_api_product_quantity_{$value_type}](#woocommerce_store_api_product_quantity_value_type) + - [woocommerce_store_api_rate_limit_options](#woocommerce_store_api_rate_limit_options) --- -## \_\_experimental_woocommerce_blocks_add_data_attributes_to_block +## __experimental_woocommerce_blocks_add_data_attributes_to_block + Filters the list of allowed Block Names @@ -58,17 +65,19 @@ apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_block', ### Parameters -| Argument | Type | Description | -| ------------------- | ----- | ------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $allowed_namespaces | array | List of namespaces. | ### Source -- [BlockTypesController.php](../../../../src/BlockTypesController.php) + + - [BlockTypesController.php](../../../../src/BlockTypesController.php) --- -## \_\_experimental_woocommerce_blocks_add_data_attributes_to_namespace +## __experimental_woocommerce_blocks_add_data_attributes_to_namespace + Filters the list of allowed block namespaces. @@ -82,17 +91,19 @@ apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_namespa ### Parameters -| Argument | Type | Description | -| ------------------- | ----- | ------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $allowed_namespaces | array | List of namespaces. | ### Source -- [BlockTypesController.php](../../../../src/BlockTypesController.php) + + - [BlockTypesController.php](../../../../src/BlockTypesController.php) --- -## \_\_experimental_woocommerce_blocks_payment_gateway_features_list +## __experimental_woocommerce_blocks_payment_gateway_features_list + Filter to control what features are available for each payment gateway. @@ -102,13 +113,14 @@ apply_filters( '__experimental_woocommerce_blocks_payment_gateway_features_list' ### Parameters -| Argument | Type | Description | -| --------- | ------ | --------------------------- | -| $features | array | List of supported features. | -| $name | string | Gateway name. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $features | array | List of supported features. | +| $name | string | Gateway name. | ### Returns + `array` Updated list of supported features. ### Example @@ -128,14 +140,17 @@ function my_function_callback( $features, $gateway ) { add_filter( '__experimental_woocommerce_blocks_payment_gateway_features_list', 'my_function_callback', 10, 2 ); ``` + ### Source -- [Payments/Integrations/PayPal.php](../../../../src/Payments/Integrations/PayPal.php) + + - [Payments/Integrations/PayPal.php](../../../../src/Payments/Integrations/PayPal.php) --- ## deprecated_function_trigger_error + Filters whether to trigger an error for deprecated functions. (Same as WP core) ```php @@ -144,18 +159,37 @@ apply_filters( 'deprecated_function_trigger_error', bool $trigger ) ### Parameters -| Argument | Type | Description | -| -------- | ---- | -------------------------------------------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $trigger | bool | Whether to trigger the error for deprecated functions. Default true. | ### Source -- [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php) + + - [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php) + +--- + +## loop_shop_per_page + + + + +```php +apply_filters( 'loop_shop_per_page' ) +``` + +### Source + + + - [BlockTypes/ProductQuery.php](../../../../src/BlockTypes/ProductQuery.php) + - [BlockTypes/ProductCollection.php](../../../../src/BlockTypes/ProductCollection.php) --- ## wc_session_expiration + Filters the session expiration. ```php @@ -164,110 +198,148 @@ apply_filters( 'wc_session_expiration', int $expiration ) ### Parameters -| Argument | Type | Description | -| ----------- | ---- | ---------------------- | -| $expiration | int | Expiration in seconds. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $expiration | int | Expiration in seconds. | ### Source -- [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) + + - [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) --- ## woocommerce_add_cart_item + Filters the item being added to the cart. ```php apply_filters( 'woocommerce_add_cart_item', array $cart_item_data, string $cart_id ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| --------------- | ------ | ------------------------------------------------ | -| $cart_item_data | array | Array of cart item data being added to the cart. | -| $cart_id | string | Id of the item in the cart. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $cart_item_data | array | Array of cart item data being added to the cart. | +| $cart_id | string | Id of the item in the cart. | ### Returns + `array` Updated cart item data. ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_add_cart_item_data + Filter cart item data for add to cart requests. ```php apply_filters( 'woocommerce_add_cart_item_data', array $cart_item_data, integer $product_id, integer $variation_id, integer $quantity ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| --------------- | ------- | ---------------------------------------------- | -| $cart_item_data | array | Array of other cart item data. | -| $product_id | integer | ID of the product added to the cart. | -| $variation_id | integer | Variation ID of the product added to the cart. | -| $quantity | integer | Quantity of the item added to the cart. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $cart_item_data | array | Array of other cart item data. | +| $product_id | integer | ID of the product added to the cart. | +| $variation_id | integer | Variation ID of the product added to the cart. | +| $quantity | integer | Quantity of the item added to the cart. | ### Returns -`array` + +`array` ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + +--- + +## woocommerce_add_to_cart_quantity + + +Filters the change the quantity to add to cart. + +```php +apply_filters( 'woocommerce_add_to_cart_quantity', \Automattic\WooCommerce\Blocks\BlockTypes\number $default_quantity, \Automattic\WooCommerce\Blocks\BlockTypes\number $product_id ) +``` + +### Parameters + +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $default_quantity | \Automattic\WooCommerce\Blocks\BlockTypes\number | The default quantity. | +| $product_id | \Automattic\WooCommerce\Blocks\BlockTypes\number | The product id. | + +### Source + + + - [BlockTypes/ProductButton.php](../../../../src/BlockTypes/ProductButton.php) --- ## woocommerce_add_to_cart_sold_individually_quantity + Filter sold individually quantity for add to cart requests. ```php apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', integer $sold_individually_quantity, integer $quantity, integer $product_id, integer $variation_id, array $cart_item_data ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| --------------------------- | ------- | ---------------------------------------------- | -| $sold_individually_quantity | integer | Defaults to 1. | -| $quantity | integer | Quantity of the item added to the cart. | -| $product_id | integer | ID of the product added to the cart. | -| $variation_id | integer | Variation ID of the product added to the cart. | -| $cart_item_data | array | Array of other cart item data. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $sold_individually_quantity | integer | Defaults to 1. | +| $quantity | integer | Quantity of the item added to the cart. | +| $product_id | integer | ID of the product added to the cart. | +| $variation_id | integer | Variation ID of the product added to the cart. | +| $cart_item_data | array | Array of other cart item data. | ### Returns -`integer` + +`integer` ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## ~~woocommerce_add_to_cart_validation~~ + Filters if an item being added to the cart passed validation checks. ```php apply_filters( 'woocommerce_add_to_cart_validation', boolean $passed_validation, integer $product_id, integer $quantity, integer $variation_id, array $variation ) ``` + **Deprecated: This hook is deprecated and will be removed** ### Description @@ -276,32 +348,36 @@ apply_filters( 'woocommerce_add_to_cart_validation', boolean $passed_validation, ### Parameters -| Argument | Type | Description | -| ------------------ | ------- | ------------------------------------- | -| $passed_validation | boolean | True if the item passed validation. | -| $product_id | integer | Product ID being validated. | -| $quantity | integer | Quantity added to the cart. | -| $variation_id | integer | Variation ID being added to the cart. | -| $variation | array | Variation data. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $passed_validation | boolean | True if the item passed validation. | +| $product_id | integer | Product ID being validated. | +| $quantity | integer | Quantity added to the cart. | +| $variation_id | integer | Variation ID being added to the cart. | +| $variation | array | Variation data. | ### Returns -`boolean` + +`boolean` ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_adjust_non_base_location_prices + Filters if taxes should be removed from locations outside the store base location. ```php apply_filters( 'woocommerce_adjust_non_base_location_prices', boolean $adjust_non_base_location_prices ) ``` + **Note: Matches filter name in WooCommerce core.** ### Description @@ -310,91 +386,106 @@ apply_filters( 'woocommerce_adjust_non_base_location_prices', boolean $adjust_no ### Parameters -| Argument | Type | Description | -| -------------------------------- | ------- | ---------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $adjust_non_base_location_prices | boolean | True by default. | ### Returns -`boolean` + +`boolean` ### Source -- [StoreApi/Utilities/ProductQuery.php](../../../../src/StoreApi/Utilities/ProductQuery.php) + + - [StoreApi/Utilities/ProductQuery.php](../../../../src/StoreApi/Utilities/ProductQuery.php) --- ## woocommerce_apply_base_tax_for_local_pickup + + + ```php apply_filters( 'woocommerce_apply_base_tax_for_local_pickup' ) ``` ### Source -- [Shipping/ShippingController.php](../../../../src/Shipping/ShippingController.php) + + - [Shipping/ShippingController.php](../../../../src/Shipping/ShippingController.php) --- ## woocommerce_apply_individual_use_coupon + Filter coupons to remove when applying an individual use coupon. ```php apply_filters( 'woocommerce_apply_individual_use_coupon', array $coupons, \WC_Coupon $coupon, array $applied_coupons ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| ---------------- | ---------- | ----------------------------------------------------- | -| $coupons | array | Array of coupons to remove from the cart. | -| $coupon | \WC_Coupon | Coupon object applied to the cart. | -| $applied_coupons | array | Array of applied coupons already applied to the cart. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $coupons | array | Array of coupons to remove from the cart. | +| $coupon | \WC_Coupon | Coupon object applied to the cart. | +| $applied_coupons | array | Array of applied coupons already applied to the cart. | ### Returns -`array` + +`array` ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_apply_with_individual_use_coupon + Filters if a coupon can be applied alongside other individual use coupons. ```php apply_filters( 'woocommerce_apply_with_individual_use_coupon', boolean $apply_with_individual_use_coupon, \WC_Coupon $coupon, \WC_Coupon $individual_use_coupon, array $applied_coupons ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| --------------------------------- | ---------- | ----------------------------------------------------- | -| $apply_with_individual_use_coupon | boolean | Defaults to false. | -| $coupon | \WC_Coupon | Coupon object applied to the cart. | -| $individual_use_coupon | \WC_Coupon | Individual use coupon already applied to the cart. | -| $applied_coupons | array | Array of applied coupons already applied to the cart. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $apply_with_individual_use_coupon | boolean | Defaults to false. | +| $coupon | \WC_Coupon | Coupon object applied to the cart. | +| $individual_use_coupon | \WC_Coupon | Individual use coupon already applied to the cart. | +| $applied_coupons | array | Array of applied coupons already applied to the cart. | ### Returns -`boolean` + +`boolean` ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- ## woocommerce_blocks_hook_compatibility_additional_data + When extensions implement their equivalent blocks of the template hook functions, they can use this filter to register their old hooked data here, so in the blockified template, the old hooked functions can be removed in favor of the new blocks while keeping the old hooked functions working in classic templates. ```php @@ -407,18 +498,20 @@ apply_filters( 'woocommerce_blocks_hook_compatibility_additional_data', array $d ### Parameters -| Argument | Type | Description | -| -------- | ----- | ---------------------------------------- | -| $data | array | Additional hooked data. Default to empty | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $data | array | Additional hooked data. Default to empty | ### Source -- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) + + - [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) --- ## woocommerce_blocks_product_grid_is_cacheable + Filters whether or not the product grid is cacheable. ```php @@ -427,23 +520,26 @@ apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', boolean $is_cache ### Parameters -| Argument | Type | Description | -| ------------- | ------- | ---------------------------------------------------------- | -| $is_cacheable | boolean | The list of script dependencies. | -| $query_args | array | Query args for the products query passed to BlocksWpQuery. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $is_cacheable | boolean | The list of script dependencies. | +| $query_args | array | Query args for the products query passed to BlocksWpQuery. | ### Returns + `array` True to enable cache, false to disable cache. ### Source -- [BlockTypes/AbstractProductGrid.php](../../../../src/BlockTypes/AbstractProductGrid.php) + + - [BlockTypes/AbstractProductGrid.php](../../../../src/BlockTypes/AbstractProductGrid.php) --- ## woocommerce_blocks_product_grid_item_html + Filters the HTML for products in the grid. ```php @@ -452,24 +548,27 @@ apply_filters( 'woocommerce_blocks_product_grid_item_html', string $html, array ### Parameters -| Argument | Type | Description | -| -------- | ----------- | ------------------------------------ | -| $html | string | Product grid item HTML. | -| $data | array | Product data passed to the template. | -| $product | \WC_Product | Product object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $html | string | Product grid item HTML. | +| $data | array | Product data passed to the template. | +| $product | \WC_Product | Product object. | ### Returns + `string` Updated product grid item HTML. ### Source -- [BlockTypes/AbstractProductGrid.php](../../../../src/BlockTypes/AbstractProductGrid.php) + + - [BlockTypes/AbstractProductGrid.php](../../../../src/BlockTypes/AbstractProductGrid.php) --- ## woocommerce_blocks_register_script_dependencies + Filters the list of script dependencies. ```php @@ -478,49 +577,84 @@ apply_filters( 'woocommerce_blocks_register_script_dependencies', array $depende ### Parameters -| Argument | Type | Description | -| ------------- | ------ | -------------------------------- | -| $dependencies | array | The list of script dependencies. | -| $handle | string | The script's handle. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $dependencies | array | The list of script dependencies. | +| $handle | string | The script's handle. | ### Returns -`array` + +`array` ### Source -- [Assets/Api.php](../../../../src/Assets/Api.php) + + - [Assets/Api.php](../../../../src/Assets/Api.php) --- ## woocommerce_cart_contents_changed + Filters the entire cart contents when the cart changes. ```php apply_filters( 'woocommerce_cart_contents_changed', array $cart_contents ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| -------------- | ----- | ------------------------ | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $cart_contents | array | Array of all cart items. | ### Returns + `array` Updated array of all cart items. ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + +--- + +## woocommerce_cart_item_permalink + + +Filter the product permalink. + +```php +apply_filters( 'woocommerce_cart_item_permalink', string $product_permalink, array $cart_item, string $cart_item_key ) +``` + +### Description + +

This is a hook taken from the legacy cart/mini-cart templates that allows the permalink to be changed for a product. This is specific to the cart endpoint.

+ +### Parameters + +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $product_permalink | string | Product permalink. | +| $cart_item | array | Cart item array. | +| $cart_item_key | string | Cart item key. | + +### Source + + + - [StoreApi/Schemas/V1/CartItemSchema.php](../../../../src/StoreApi/Schemas/V1/CartItemSchema.php) --- ## woocommerce_disable_compatibility_layer + Filter to disable the compatibility layer for the blockified templates. ```php @@ -533,47 +667,53 @@ apply_filters( 'woocommerce_disable_compatibility_layer', \Automattic\WooCommerc ### Parameters -| Argument | Type | Description | -| -------- | ------------------------------------------------- | ----------- | -| 1 | \Automattic\WooCommerce\Blocks\Templates\boolean. | | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| 1 | \Automattic\WooCommerce\Blocks\Templates\boolean. | | ### Source -- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) -- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) + + - [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) + - [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php) --- ## woocommerce_ga_disable_tracking + Filter to disable Google Analytics tracking. ```php apply_filters( 'woocommerce_ga_disable_tracking', boolean $disable_tracking ) ``` + **Note: Matches filter name in GA extension.** ### Parameters -| Argument | Type | Description | -| ----------------- | ------- | ----------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $disable_tracking | boolean | If true, tracking will be disabled. | ### Source -- [Domain/Services/GoogleAnalytics.php](../../../../src/Domain/Services/GoogleAnalytics.php) + + - [Domain/Services/GoogleAnalytics.php](../../../../src/Domain/Services/GoogleAnalytics.php) --- ## woocommerce_get_item_data + Filters cart item data. ```php apply_filters( 'woocommerce_get_item_data', array $item_data, array $cart_item ) ``` + **Note: Matches filter name in WooCommerce core.** ### Description @@ -582,23 +722,26 @@ apply_filters( 'woocommerce_get_item_data', array $item_data, array $cart_item ) ### Parameters -| Argument | Type | Description | -| ---------- | ----- | --------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $item_data | array | Cart item data. Empty by default. | -| $cart_item | array | Cart item array. | +| $cart_item | array | Cart item array. | ### Returns -`array` + +`array` ### Source -- [StoreApi/Schemas/V1/CartItemSchema.php](../../../../src/StoreApi/Schemas/V1/CartItemSchema.php) + + - [StoreApi/Schemas/V1/CartItemSchema.php](../../../../src/StoreApi/Schemas/V1/CartItemSchema.php) --- ## woocommerce_loop_add_to_cart_args + Allow filtering of the add to cart button arguments. ```php @@ -607,12 +750,14 @@ apply_filters( 'woocommerce_loop_add_to_cart_args' ) ### Source -- [BlockTypes/ProductButton.php](../../../../src/BlockTypes/ProductButton.php) + + - [BlockTypes/ProductButton.php](../../../../src/BlockTypes/ProductButton.php) --- ## woocommerce_loop_add_to_cart_link + Filters the add to cart button class. ```php @@ -621,18 +766,20 @@ apply_filters( 'woocommerce_loop_add_to_cart_link', string $class ) ### Parameters -| Argument | Type | Description | -| -------- | ------ | ----------- | -| $class | string | The class. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $class | string | The class. | ### Source -- [BlockTypes/ProductButton.php](../../../../src/BlockTypes/ProductButton.php) + + - [BlockTypes/ProductButton.php](../../../../src/BlockTypes/ProductButton.php) --- ## woocommerce_new_customer_data + Filters customer data before a customer account is registered. ```php @@ -645,28 +792,80 @@ apply_filters( 'woocommerce_new_customer_data', array $customer_data ) ### Parameters -| Argument | Type | Description | -| -------------- | ----- | --------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $customer_data | array | An array of customer (user) data. | ### Returns -`array` + +`array` ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + +--- + +## woocommerce_pay_order_product_has_enough_stock + + +Filters whether or not the product has enough stock. + +```php +apply_filters( 'woocommerce_pay_order_product_has_enough_stock', boolean $argument0, \WC_Product $product, \WC_Order $order ) +``` + +### Parameters + +| Argument | Type | Description | +| -------- | ---- | ----------- | +| 1 | boolean | True if has enough stock. | +| $product | \WC_Product | Product. | +| $order | \WC_Order | Order. | + +### Source + + + - [StoreApi/Utilities/OrderController.php](../../../../src/StoreApi/Utilities/OrderController.php) + +--- + +## woocommerce_pay_order_product_in_stock + + +Filters whether or not the product is in stock for this pay for order. + +```php +apply_filters( 'woocommerce_pay_order_product_in_stock', boolean $argument0, \WC_Product $product, \WC_Order $order ) +``` + +### Parameters + +| Argument | Type | Description | +| -------- | ---- | ----------- | +| 1 | boolean | True if in stock. | +| $product | \WC_Product | Product. | +| $order | \WC_Order | Order. | + +### Source + + + - [StoreApi/Utilities/OrderController.php](../../../../src/StoreApi/Utilities/OrderController.php) --- ## woocommerce_registration_errors + Filters registration errors before a customer account is registered. ```php apply_filters( 'woocommerce_registration_errors', \WP_Error $errors, string $username, string $user_email ) ``` + **Note: Matches filter name in WooCommerce core.** ### Description @@ -675,30 +874,34 @@ apply_filters( 'woocommerce_registration_errors', \WP_Error $errors, string $use ### Parameters -| Argument | Type | Description | -| ----------- | --------- | ----------------------- | -| $errors | \WP_Error | Error object. | -| $username | string | Customer username. | -| $user_email | string | Customer email address. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $errors | \WP_Error | Error object. | +| $username | string | Customer username. | +| $user_email | string | Customer email address. | ### Returns -`\WP_Error` + +`\WP_Error` ### Source -- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) + + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- ## ~~woocommerce_shared_settings~~ + Filters the array of shared settings. ```php apply_filters( 'woocommerce_shared_settings', array $data ) ``` + **Deprecated: This hook is deprecated and will be removed** ### Description @@ -707,49 +910,58 @@ apply_filters( 'woocommerce_shared_settings', array $data ) ### Parameters -| Argument | Type | Description | -| -------- | ----- | -------------- | -| $data | array | Settings data. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $data | array | Settings data. | ### Returns -`array` + +`array` ### Source -- [Assets/AssetDataRegistry.php](../../../../src/Assets/AssetDataRegistry.php) + + - [Assets/AssetDataRegistry.php](../../../../src/Assets/AssetDataRegistry.php) --- ## woocommerce_shipping_package_name + Filters the shipping package name. ```php apply_filters( 'woocommerce_shipping_package_name', string $shipping_package_name, string $package_id, array $package ) ``` + **Note: Matches filter name in WooCommerce core.** ### Parameters -| Argument | Type | Description | -| ---------------------- | ------ | ---------------------------------- | -| $shipping_package_name | string | Shipping package name. | -| $package_id | string | Shipping package ID. | -| $package | array | Shipping package from WooCommerce. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $shipping_package_name | string | Shipping package name. | +| $package_id | string | Shipping package ID. | +| $package | array | Shipping package from WooCommerce. | ### Returns + `string` Shipping package name. ### Source -- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) + + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- -## woocommerce*shipping*{$this->id}\_is_available +## woocommerce_shipping_{$this->id}_is_available + + + ```php apply_filters( 'woocommerce_shipping_{$this->id}_is_available' ) @@ -757,12 +969,14 @@ apply_filters( 'woocommerce_shipping_{$this->id}_is_available' ) ### Source -- [Shipping/PickupLocation.php](../../../../src/Shipping/PickupLocation.php) + + - [Shipping/PickupLocation.php](../../../../src/Shipping/PickupLocation.php) --- ## woocommerce_show_page_title + Hook: woocommerce_show_page_title ```php @@ -775,12 +989,37 @@ apply_filters( 'woocommerce_show_page_title' ) ### Source -- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) + +--- + +## woocommerce_single_product_image_thumbnail_html + + +Filter the HTML markup for a single product image thumbnail in the gallery. + +```php +apply_filters( 'woocommerce_single_product_image_thumbnail_html', string $thumbnail_html, int $attachment_id ) +``` + +### Parameters + +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $thumbnail_html | string | The HTML markup for the thumbnail. | +| $attachment_id | int | The attachment ID of the thumbnail. | + +### Source + + + - [BlockTypes/ProductGalleryThumbnails.php](../../../../src/BlockTypes/ProductGalleryThumbnails.php) --- ## woocommerce_store_api_add_to_cart_data + Filters cart item data sent via the API before it is passed to the cart controller. ```php @@ -793,22 +1032,25 @@ apply_filters( 'woocommerce_store_api_add_to_cart_data', array $customer_data ) ### Parameters -| Argument | Type | Description | -| -------------- | ----- | --------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $customer_data | array | An array of customer (user) data. | ### Returns -`array` + +`array` ### Source -- [StoreApi/Routes/V1/CartAddItem.php](../../../../src/StoreApi/Routes/V1/CartAddItem.php) + + - [StoreApi/Routes/V1/CartAddItem.php](../../../../src/StoreApi/Routes/V1/CartAddItem.php) --- ## woocommerce_store_api_disable_nonce_check + Filters the Store API nonce check. ```php @@ -821,22 +1063,25 @@ apply_filters( 'woocommerce_store_api_disable_nonce_check', boolean $disable_non ### Parameters -| Argument | Type | Description | -| -------------------- | ------- | --------------------------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $disable_nonce_check | boolean | If true, nonce checks will be disabled. | ### Returns -`boolean` + +`boolean` ### Source -- [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) + + - [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) --- ## woocommerce_store_api_product_quantity_limit + Filters the quantity limit for a product being added to the cart via the Store API. ```php @@ -849,22 +1094,25 @@ apply_filters( 'woocommerce_store_api_product_quantity_limit', integer $quantity ### Parameters -| Argument | Type | Description | -| --------------- | ----------- | --------------------------------------------------------------- | -| $quantity_limit | integer | Quantity limit which defaults to 9999 unless sold individually. | -| $product | \WC_Product | Product instance. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $quantity_limit | integer | Quantity limit which defaults to 9999 unless sold individually. | +| $product | \WC_Product | Product instance. | ### Returns -`integer` + +`integer` ### Source -- [StoreApi/Utilities/QuantityLimits.php](../../../../src/StoreApi/Utilities/QuantityLimits.php) + + - [StoreApi/Utilities/QuantityLimits.php](../../../../src/StoreApi/Utilities/QuantityLimits.php) --- -## woocommerce*store_api_product_quantity*{$value_type} +## woocommerce_store_api_product_quantity_{$value_type} + Filters the quantity minimum for a cart item in Store API. This allows extensions to control the minimum qty of items already within the cart. @@ -878,24 +1126,27 @@ apply_filters( 'woocommerce_store_api_product_quantity_{$value_type}', mixed $va ### Parameters -| Argument | Type | Description | -| ---------- | ----------- | --------------------------------------------------------- | -| $value | mixed | The value being filtered. | -| $product | \WC_Product | The product object. | +| Argument | Type | Description | +| -------- | ---- | ----------- | +| $value | mixed | The value being filtered. | +| $product | \WC_Product | The product object. | | $cart_item | array, null | The cart item if the product exists in the cart, or null. | ### Returns -`mixed` + +`mixed` ### Source -- [StoreApi/Utilities/QuantityLimits.php](../../../../src/StoreApi/Utilities/QuantityLimits.php) + + - [StoreApi/Utilities/QuantityLimits.php](../../../../src/StoreApi/Utilities/QuantityLimits.php) --- ## woocommerce_store_api_rate_limit_options + Filters options for Rate Limits. ```php @@ -904,53 +1155,21 @@ apply_filters( 'woocommerce_store_api_rate_limit_options', array $rate_limit_opt ### Parameters -| Argument | Type | Description | -| ------------------- | ----- | ----------------------- | +| Argument | Type | Description | +| -------- | ---- | ----------- | | $rate_limit_options | array | Array of option values. | ### Returns -`array` + +`array` ### Source -- [StoreApi/Utilities/RateLimits.php](../../../../src/StoreApi/Utilities/RateLimits.php) + + - [StoreApi/Utilities/RateLimits.php](../../../../src/StoreApi/Utilities/RateLimits.php) --- - -## woocommerce_variation_option_name - -Filters the variation option name. - -```php -apply_filters( 'woocommerce_variation_option_name', string $value, null $unused, string $taxonomy, \WC_Product $product ) -``` - -**Note: Matches filter name in WooCommerce core.** - -### Description - -

Filters the variation option name for custom option slugs.

- -### Parameters - -| Argument | Type | Description | -| --------- | ----------- | ------------------------------------------------ | -| $value | string | The name to display. | -| $unused | null | Unused because this is not a variation taxonomy. | -| $taxonomy | string | Taxonomy or product attribute name. | -| $product | \WC_Product | Product data. | - -### Returns - -`string` - -### Source - -- [StoreApi/Schemas/V1/CartItemSchema.php](../../../../src/StoreApi/Schemas/V1/CartItemSchema.php) - ---- - --- @@ -960,3 +1179,4 @@ apply_filters( 'woocommerce_variation_option_name', string $value, null $unused, 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/hooks/filters.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/available-endpoints-to-extend.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/available-endpoints-to-extend.md index a4cc473f14f..c41ed73fb1d 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/available-endpoints-to-extend.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/available-endpoints-to-extend.md @@ -80,3 +80,4 @@ The main products endpoint is extensible via ExtendSchema. The data is available 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/rest-api/available-endpoints-to-extend.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-add-data.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-add-data.md index 69ce0b5ea65..ef9abeb3577 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-add-data.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-add-data.md @@ -337,3 +337,4 @@ You may wish to use our pre-existing Formatters to ensure your data is passed th 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/rest-api/extend-rest-api-add-data.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-formatters.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-formatters.md index ab6c9075382..4f95abb85b8 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-formatters.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-formatters.md @@ -142,3 +142,4 @@ alert('bad script!') This “coffee” is very strong. 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/rest-api/extend-rest-api-formatters.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-new-endpoint.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-new-endpoint.md index 16ed49f5818..b715a1dda9f 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-new-endpoint.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-new-endpoint.md @@ -49,3 +49,4 @@ Extending a new endpoint is usually half the work, you will need to receive this 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/rest-api/extend-rest-api-new-endpoint.md) + diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md index b62d59cb13b..b2944d6e012 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md @@ -192,3 +192,4 @@ Now that this is registered, when the button is pressed, the `cart/extensions` e 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md) + diff --git a/plugins/woocommerce-blocks/packages/checkout/README.md b/plugins/woocommerce-blocks/packages/checkout/README.md index 499529bfb46..e2ccb2596af 100644 --- a/plugins/woocommerce-blocks/packages/checkout/README.md +++ b/plugins/woocommerce-blocks/packages/checkout/README.md @@ -62,3 +62,4 @@ This package contains the following directories. Navigate to a directory for mor 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./packages/checkout/README.md) + diff --git a/plugins/woocommerce-blocks/packages/checkout/blocks-registry/README.md b/plugins/woocommerce-blocks/packages/checkout/blocks-registry/README.md index 81c6f92da84..e93911ba639 100644 --- a/plugins/woocommerce-blocks/packages/checkout/blocks-registry/README.md +++ b/plugins/woocommerce-blocks/packages/checkout/blocks-registry/README.md @@ -212,3 +212,4 @@ const isValid = hasInnerBlocks( 'woocommerce/checkout-totals-block' ); // true 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./packages/checkout/blocks-registry/README.md) + diff --git a/plugins/woocommerce-blocks/packages/checkout/components/README.md b/plugins/woocommerce-blocks/packages/checkout/components/README.md index f66beaf0a03..305ebeb1946 100644 --- a/plugins/woocommerce-blocks/packages/checkout/components/README.md +++ b/plugins/woocommerce-blocks/packages/checkout/components/README.md @@ -29,3 +29,4 @@ These components are here so they can be consumed by extensions. 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./packages/checkout/components/README.md) + diff --git a/plugins/woocommerce-blocks/packages/checkout/filter-registry/README.md b/plugins/woocommerce-blocks/packages/checkout/filter-registry/README.md index 7359e271769..1045d9d025f 100644 --- a/plugins/woocommerce-blocks/packages/checkout/filter-registry/README.md +++ b/plugins/woocommerce-blocks/packages/checkout/filter-registry/README.md @@ -132,3 +132,4 @@ Filters are implemented throughout the Mini-Cart, Cart and Checkout Blocks, as w 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./packages/checkout/filter-registry/README.md) + diff --git a/plugins/woocommerce-blocks/packages/checkout/slot/README.md b/plugins/woocommerce-blocks/packages/checkout/slot/README.md index df513cb2e39..eeb677b95e0 100644 --- a/plugins/woocommerce-blocks/packages/checkout/slot/README.md +++ b/plugins/woocommerce-blocks/packages/checkout/slot/README.md @@ -192,3 +192,4 @@ Slot Fills are implemented throughout the Cart and Checkout Blocks, as well as s 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./packages/checkout/slot/README.md) + diff --git a/plugins/woocommerce-blocks/packages/checkout/utils/README.md b/plugins/woocommerce-blocks/packages/checkout/utils/README.md index d2693b8843b..e4735267082 100644 --- a/plugins/woocommerce-blocks/packages/checkout/utils/README.md +++ b/plugins/woocommerce-blocks/packages/checkout/utils/README.md @@ -81,3 +81,4 @@ What value must contain. If this is not found within `value`, and error will be 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./packages/checkout/utils/README.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/README.md b/plugins/woocommerce-blocks/src/StoreApi/README.md index 3e1a8196a01..dfde393f7c0 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/README.md +++ b/plugins/woocommerce-blocks/src/StoreApi/README.md @@ -172,3 +172,4 @@ If you're looking to add _new routes and endpoints_, rather than extending the S 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/README.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/cart-coupons.md b/plugins/woocommerce-blocks/src/StoreApi/docs/cart-coupons.md index 0bd3adcd004..e3a2d7d235f 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/cart-coupons.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/cart-coupons.md @@ -171,3 +171,4 @@ curl --request DELETE https://example-store.com/wp-json/wc/store/v1/cart/coupons 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/cart-coupons.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/cart-items.md b/plugins/woocommerce-blocks/src/StoreApi/docs/cart-items.md index 9fa735e39b9..c6797f8e56c 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/cart-items.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/cart-items.md @@ -369,3 +369,4 @@ curl --request DELETE https://example-store.com/wp-json/wc/store/v1/cart/items 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/cart-items.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/cart.md b/plugins/woocommerce-blocks/src/StoreApi/docs/cart.md index 8d99937ea34..f8241d9840e 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/cart.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/cart.md @@ -551,3 +551,4 @@ Returns the full [Cart Response](#cart-response) on success, or an [Error Respon 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/cart.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/checkout.md b/plugins/woocommerce-blocks/src/StoreApi/docs/checkout.md index 13781f951ce..ef09146e411 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/checkout.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/checkout.md @@ -227,3 +227,4 @@ For further information on generating a `stripe_source` please check [the Stripe 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/checkout.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/guiding-principles.md b/plugins/woocommerce-blocks/src/StoreApi/docs/guiding-principles.md index a217016f493..0ce28e33ecb 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/guiding-principles.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/guiding-principles.md @@ -140,3 +140,4 @@ The version will not increase for bug fixes unless the scope of the bug causes a 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/guiding-principles.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/nonce-tokens.md b/plugins/woocommerce-blocks/src/StoreApi/docs/nonce-tokens.md index 333fdecf180..6d0ee9c8872 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/nonce-tokens.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/nonce-tokens.md @@ -56,3 +56,4 @@ NOTE: This should only be done on development sites where security is not import 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/nonce-tokens.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/product-attribute-terms.md b/plugins/woocommerce-blocks/src/StoreApi/docs/product-attribute-terms.md index 2bae3b89e96..efb4c05552e 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/product-attribute-terms.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/product-attribute-terms.md @@ -43,3 +43,4 @@ curl "https://example-store.com/wp-json/wc/store/v1/products/attributes/1/terms" 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/product-attribute-terms.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/product-attributes.md b/plugins/woocommerce-blocks/src/StoreApi/docs/product-attributes.md index 31f3fc9596e..da6b25f629f 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/product-attributes.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/product-attributes.md @@ -78,3 +78,4 @@ curl "https://example-store.com/wp-json/wc/store/v1/products/attributes/1" 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/product-attributes.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/product-categories.md b/plugins/woocommerce-blocks/src/StoreApi/docs/product-categories.md index 3c992d1e0c6..ed1e8cb2f89 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/product-categories.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/product-categories.md @@ -95,3 +95,4 @@ curl "https://example-store.com/wp-json/wc/store/v1/products/categories/1" 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/product-categories.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/product-collection-data.md b/plugins/woocommerce-blocks/src/StoreApi/docs/product-collection-data.md index 21ca1821edc..510c2856a60 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/product-collection-data.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/product-collection-data.md @@ -73,3 +73,4 @@ curl "https://example-store.com/wp-json/wc/store/v1/products/collection-data?cal 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/product-collection-data.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/product-reviews.md b/plugins/woocommerce-blocks/src/StoreApi/docs/product-reviews.md index 4f63ecd2fba..0aab4643599 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/product-reviews.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/product-reviews.md @@ -72,3 +72,4 @@ curl "https://example-store.com/wp-json/wc/store/v1/products/collection-data?cal 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/product-reviews.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/product-tags.md b/plugins/woocommerce-blocks/src/StoreApi/docs/product-tags.md index 58875977d0c..549e3ea1b24 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/product-tags.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/product-tags.md @@ -48,3 +48,4 @@ Example response: 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/product-tags.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/products.md b/plugins/woocommerce-blocks/src/StoreApi/docs/products.md index 62f381005a3..7b1499923db 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/products.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/products.md @@ -279,3 +279,4 @@ curl "https://example-store.com/wp-json/wc/store/v1/products?type=variation" 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/products.md) + diff --git a/plugins/woocommerce-blocks/src/StoreApi/docs/rate-limiting.md b/plugins/woocommerce-blocks/src/StoreApi/docs/rate-limiting.md index b4007381f5e..6dfc50229b8 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/docs/rate-limiting.md +++ b/plugins/woocommerce-blocks/src/StoreApi/docs/rate-limiting.md @@ -84,13 +84,6 @@ add_action( ); ``` ---- - -[We're hiring!](https://woocommerce.com/careers/) Come work with us! - -🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/rate-limiting.md) - - --- @@ -100,3 +93,4 @@ add_action( 🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-blocks/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./src/StoreApi/docs/rate-limiting.md) +