diff --git a/README.md b/README.md index 45e73401381..d02f103c159 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # WooCommerce Blocks [![Latest Tag](https://img.shields.io/github/tag/woocommerce/woocommerce-gutenberg-products-block.svg?style=flat&label=Latest%20Tag)](https://github.com/woocommerce/woocommerce-gutenberg-products-block/releases) -[![View](https://img.shields.io/badge/Project%20Components-brightgreen.svg?style=flat)](https://woocommerce.github.io/woocommerce-gutenberg-products-block) +[![View](https://img.shields.io/badge/Project%20Components-brightgreen.svg?style=flat)](https://woocommerce.github.io/woocommerce-blocks/) ![JavaScript and CSS Linting](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/JavaScript%20and%20CSS%20Linting/badge.svg?branch=trunk) ![PHP Coding Standards](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/PHP%20Coding%20Standards/badge.svg?branch=trunk) ![Automated tests](https://github.com/woocommerce/woocommerce-gutenberg-products-block/workflows/Automated%20tests/badge.svg?branch=trunk) diff --git a/assets/js/base/components/README.md b/assets/js/base/components/README.md index 23e3a6619e6..3e4c68c26eb 100644 --- a/assets/js/base/components/README.md +++ b/assets/js/base/components/README.md @@ -1,5 +1,5 @@ # WooCommerce Blocks - General Purpose Components -These are shared components used in WooCommerce blocks, and may be used in the store front end (shopper experience) as well as the editor or admin dashboard. +These are shared components used in WooCommerce blocks, and may be used in the store front end (shopper experience) as well as the editor or admin dashboard. -See [_Components & Storybook_](docs/contributors/storybook.md) doc for more information. +See [_Components & Storybook_](../../../../docs/contributors/contributing/storybook-and-components.md) doc for more information. diff --git a/assets/js/data/schema/README.md b/assets/js/data/schema/README.md index 435a533cecc..b3c46b1add7 100644 --- a/assets/js/data/schema/README.md +++ b/assets/js/data/schema/README.md @@ -2,7 +2,6 @@ ## Table of contents -- [Table of contents](#table-of-contents) - [Actions](#actions) - [`receiveRoutes( routes, namespace = '/wc/blocks' )`](#receiveroutes-routes-namespace--wcblocks-) - [Selectors](#selectors) diff --git a/assets/js/editor-components/README.md b/assets/js/editor-components/README.md index 5ccaad420ca..4fd4c3e2cd7 100644 --- a/assets/js/editor-components/README.md +++ b/assets/js/editor-components/README.md @@ -4,7 +4,7 @@ These are shared components used in WooCommerce blocks for the editor (Gutenberg Many of our blocks need rich, smart components to provide an interface for selecting or configuring blocks with WooCommerce data. Often there are multiple blocks that need such components. Components in this collection are used in multiple blocks, and may include logic for working with Woo data specifically (e.g. products, shipping methods, product categories). -See [Storybook & Components](docs/contributors/storybook.md) doc for more information. +See [Storybook & Components](../../../docs/contributors/contributing/storybook-and-components.md) doc for more information. diff --git a/bin/hook-docs/data/actions.json b/bin/hook-docs/data/actions.json index 6ec1005eb2e..5559bd05eb7 100644 --- a/bin/hook-docs/data/actions.json +++ b/bin/hook-docs/data/actions.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/johnbillion/wp-hooks-generator/0.7.0/schema.json", + "$schema": "https://raw.githubusercontent.com/wp-hooks/generator/0.9.0/schema.json", "hooks": [ { "name": "woocommerce_add_to_cart", diff --git a/bin/hook-docs/data/filters.json b/bin/hook-docs/data/filters.json index 5b7991c02de..c4cec79bd32 100644 --- a/bin/hook-docs/data/filters.json +++ b/bin/hook-docs/data/filters.json @@ -1,5 +1,5 @@ { - "$schema": "https://raw.githubusercontent.com/johnbillion/wp-hooks-generator/0.7.0/schema.json", + "$schema": "https://raw.githubusercontent.com/wp-hooks/generator/0.9.0/schema.json", "hooks": [ { "name": "__experimental_woocommerce_blocks_add_data_attributes_to_block", @@ -339,18 +339,6 @@ }, "args": 1 }, - { - "name": "woocommerce_admin_disabled", - "file": "InboxNotifications.php", - "type": "filter", - "doc": { - "description": "", - "long_description": "", - "tags": [], - "long_description_html": "" - }, - "args": 1 - }, { "name": "woocommerce_apply_individual_use_coupon", "file": "StoreApi/Utilities/CartController.php", diff --git a/bin/hook-docs/format-hook-doc/files.js b/bin/hook-docs/format-hook-doc/files.js index e7282f630c9..8a4825c2549 100644 --- a/bin/hook-docs/format-hook-doc/files.js +++ b/bin/hook-docs/format-hook-doc/files.js @@ -2,7 +2,7 @@ const files = ( sources ) => { return sources && sources.length ? { ul: sources.map( ( file ) => { - return `[${ file }](../../src/${ file })`; + return `[${ file }](../../../../src/${ file })`; } ), } : null; diff --git a/docs/README.md b/docs/README.md index c9d8cdfc9c8..bc989930382 100644 --- a/docs/README.md +++ b/docs/README.md @@ -146,7 +146,7 @@ The following tutorials from [developer.woocommerce.com](https://developer.wooco [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/readme.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/README.md) diff --git a/docs/contributors/components.md b/docs/contributors/components.md index a24e1977007..71081ad3673 100644 --- a/docs/contributors/components.md +++ b/docs/contributors/components.md @@ -2,17 +2,15 @@ This repo includes [Storybook](https://storybook.js.org) tooling so we can test and develop components in isolation. -The storybook is automatically built and published to [GitHub pages](https://woocommerce.github.io/woocommerce-gutenberg-products-block/) on every push to the main branch. See [travis.yml](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/.travis.yml) for details. - - +The storybook is automatically built and published to [GitHub pages](https://woocommerce.github.io/woocommerce-blocks/) on every push to the main branch. ## Where are our components? We have components in a few folders, for different contexts. -- [`assets/js/base/components`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/base/components) -- [`assets/js/editor-components`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/editor-components) -- [`assets/js/icons`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/icons) +- [`assets/js/base/components`](../../assets/js/base/components) +- [`assets/js/editor-components`](../../assets/js/editor-components) +- [`assets/js/icons`](../../assets/js/icons) **`assets/js/base/components`** are used in front-end code, as well as editor & admin. These components help us build consistent interfaces across the front end (shopper) experience and elsewhere. @@ -27,7 +25,7 @@ They allow us to build a consistent and powerful UI for merchants for authoring **`assets/js/icons`** is a suite of icons and SVG images that we use in our interfaces. -For more info about individual components, refer to [Storybook](https://woocommerce.github.io/woocommerce-gutenberg-products-block/) or individual readme files. +For more info about individual components, refer to [Storybook](https://woocommerce.github.io/woocommerce-blocks/) or individual readme files. ## How to run Storybook locally and test components diff --git a/docs/contributors/contributing/getting-started.md b/docs/contributors/contributing/getting-started.md index be57c1c4326..16dbfc6f08d 100644 --- a/docs/contributors/contributing/getting-started.md +++ b/docs/contributors/contributing/getting-started.md @@ -2,19 +2,19 @@ ## Table of contents -- [Cloning the Git Repository](#cloning-the-git-repository) -- [Configuring your WordPress site](#configuring-your-wordpress-site) -- [Installing dependencies](#installing-dependencies) -- [Building the plugin files](#building-the-plugin-files) - - [Legacy builds](#legacy-builds) -- [Create a plugin package in ZIP format](#create-a-plugin-package-in-zip-format) -- [Linting](#linting) -- [Running the Blocks plugin](#running-the-blocks-plugin) -- [Developer Tools (Visual Studio Code)](#developer-tools-visual-studio-code) - - [EditorConfig](#editorconfig) - - [ESLint](#eslint) - - [Prettier](#prettier) -- [Testing](#testing) +- [Cloning the Git Repository](#cloning-the-git-repository) +- [Configuring your WordPress site](#configuring-your-wordpress-site) +- [Installing dependencies](#installing-dependencies) +- [Building the plugin files](#building-the-plugin-files) + - [Legacy builds](#legacy-builds) +- [Create a plugin package in ZIP format](#create-a-plugin-package-in-zip-format) +- [Linting](#linting) +- [Running the Blocks plugin](#running-the-blocks-plugin) +- [Developer Tools (Visual Studio Code)](#developer-tools-visual-studio-code) + - [EditorConfig](#editorconfig) + - [ESLint](#eslint) + - [Prettier](#prettier) +- [Testing](#testing) Before you can begin contributing to the Blocks plugin there are several steps and tools required to setup your local development environment. @@ -52,7 +52,7 @@ To install dependencies, you will need the following tools installed on your mac - [`npm` and `node.js`](https://nodejs.org) - [`composer`](https://getcomposer.org) -See [`package.json` `engines`](../../package.json) for details of required versions. +See [`package.json` `engines`](../../../package.json) for details of required versions. Once you have `node` and `composer` setup, install the dependencies from the command line: @@ -79,7 +79,7 @@ This plugin supports two type of builds: The legacy builds are loaded in a site environment where the WordPress version doesn't meet minimum requirements for a component used in a set build. -You can read more about legacy builds in the [this doc](./assets/js/legacy/README.md). +You can read more about legacy builds in the [this doc](../../../assets/js/legacy/README.md). ## Create a plugin package in ZIP format @@ -96,9 +96,9 @@ Run `$ npm run lint` to check code against our linting rules. This script runs 3 sub-commands: `lint:php`, `lint:css`, `lint:js`. Use these to run linters across the codebase (linters check for valid syntax). -- `lint:php` runs phpcs via composer, which uses the [phpcs.xml](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/phpcs.xml) rule set. -- `lint:css` runs stylelint over all the scss code in `assets/css`, using the rules in [.stylelintrc.json.](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/.stylelintrc.json) -- `lint:js` runs eslint over all the JavaScript, using the rules in [.eslintrc.js.](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/.eslintrc.js) +- `lint:php` runs phpcs via composer, which uses the [phpcs.xml](../../../phpcs.xml) rule set. +- `lint:css` runs stylelint over all the scss code in `assets/css`, using the rules in [.stylelintrc.json.](../../../.stylelintrc.json) +- `lint:js` runs eslint over all the JavaScript, using the rules in [.eslintrc.js.](../../../.eslintrc.js) Note; linters are also ran before commits via Git. If there are any violations, you will not be able to commit your changes until they are fixed, unless you add the `--no-verify` flag to your commit command. @@ -148,7 +148,7 @@ You’ll find a handful of scripts in `package.json` that performs the automated - JS tests: `npm run test` - Run `npm run wp-env` command to setup the development environment in Docker. -To find out more about how to run automated JavaScript tests, check out the documentation on [JavaScript Testing](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/contributors/javascript-testing.md). +To find out more about how to run automated JavaScript tests, check out the documentation on [JavaScript Testing](../../contributors/contributing/javascript-testing.md). diff --git a/docs/contributors/contributing/storybook-and-components.md b/docs/contributors/contributing/storybook-and-components.md index ba272102724..6bb83184ca0 100644 --- a/docs/contributors/contributing/storybook-and-components.md +++ b/docs/contributors/contributing/storybook-and-components.md @@ -6,15 +6,15 @@ - [How to run Storybook locally and test components](#how-to-run-storybook-locally-and-test-components) - [How to add a story for a component](#how-to-add-a-story-for-a-component) -This repo includes [Storybook](https://storybook.js.org) tooling so we can test and develop components in isolation. The storybook is automatically built and published to [GitHub pages](https://woocommerce.github.io/woocommerce-gutenberg-products-block/) on every push to the main branch. See [travis.yml](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/.travis.yml) for details. +This repo includes [Storybook](https://storybook.js.org) tooling so we can test and develop components in isolation. The storybook is automatically built and published to [GitHub pages](https://woocommerce.github.io/woocommerce-blocks/) on every push to the main branch. ## Where are our components? We have components in a few folders, for different contexts. -- [`assets/js/base/components`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/base/components) -- [`assets/js/editor-components`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/editor-components) -- [`assets/js/icons`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/assets/js/icons) +- [`assets/js/base/components`](../../../assets/js/base/components) +- [`assets/js/editor-components`](../../../assets/js/editor-components) +- [`assets/js/icons`](../../../assets/js/icons) **`assets/js/base/components`** are used in front-end code, as well as editor & admin. These components help us build consistent interfaces across the front end (shopper) experience and elsewhere. @@ -29,7 +29,7 @@ They allow us to build a consistent and powerful UI for merchants for authoring **`assets/js/icons`** is a suite of icons and SVG images that we use in our interfaces. -For more info about individual components, refer to [Storybook](https://woocommerce.github.io/woocommerce-gutenberg-products-block/) or individual readme files. +For more info about individual components, refer to [Storybook](https://woocommerce.github.io/woocommerce-blocks/) or individual readme files. ## How to run Storybook locally and test components diff --git a/docs/designers/theming/README.md b/docs/designers/theming/README.md index a24fec9e910..7cdd93e6f32 100644 --- a/docs/designers/theming/README.md +++ b/docs/designers/theming/README.md @@ -6,7 +6,7 @@ This page includes all documentation regarding WooCommerce Blocks and themes. ### Block and component class names -WooCommerce Blocks follows BEM for class names, as [stated in our coding guidelines](../contributors/coding-guidelines.md). All classes start with one of these two prefixes: +WooCommerce Blocks follows BEM for class names, as [stated in our coding guidelines](../../contributors/contributing/coding-guidelines.md). All classes start with one of these two prefixes: - `.wc-block-`: class names specific to a single block. - `.wc-block-components-`: class names specific to a component. The component might be reused by different blocks. diff --git a/docs/internal-developers/block-client-apis/README.md b/docs/internal-developers/block-client-apis/README.md index e7f2d9a1ae0..dda5813c9e9 100644 --- a/docs/internal-developers/block-client-apis/README.md +++ b/docs/internal-developers/block-client-apis/README.md @@ -2,13 +2,13 @@ This folder contains documentation for API interfaces for Blocks. In _most cases_, these docs describe APIs and interfaces that are _internal_ only, and thus are provided to assist with developing the blocks in this repository. Documentation will tend to focus on high level overviews. -For more details about extensibility points in the blocks, you can reference the [extensibility docs](../extensibility/README.md). +For more details about extensibility points in the blocks, you can reference the [extensibility docs](../../third-party-developers/extensibility/README.md). -| Document | Description | -| -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| [Checkout API interface](checkout/checkout-api.md) | This doc goes into some detail about some of the API specifics for the checkout block architecture. | -| [Checkout Flow and Events](../../third-party-developers/extensibility/checkout-flow-and-events.md) | All about the checkout flow in the checkout block and the various emitted events that can be subscribed to. | -| [Notices](notices.md) | Explains how the notices system works and which methods are available to add an remove them. | +| Document | Description | +| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | +| [Checkout API interface](checkout/checkout-api.md) | This doc goes into some detail about some of the API specifics for the checkout block architecture. | +| [Checkout Flow and Events](../../internal-developers/block-client-apis/checkout/checkout-flow-and-events.md) | All about the checkout flow in the checkout block and the various emitted events that can be subscribed to. | +| [Notices](notices.md) | Explains how the notices system works and which methods are available to add an remove them. | diff --git a/docs/internal-developers/block-client-apis/checkout/checkout-api.md b/docs/internal-developers/block-client-apis/checkout/checkout-api.md index 3a91eab6631..ff4e9996b49 100644 --- a/docs/internal-developers/block-client-apis/checkout/checkout-api.md +++ b/docs/internal-developers/block-client-apis/checkout/checkout-api.md @@ -2,22 +2,22 @@ ## Table of contents -- [Contexts](#contexts) - - [Notices Context](#notices-context) - - [Customer Data Context](#customer-data-context) - - [Shipping Method Data context](#shipping-method-data-context) - - [Payment Method Data Context](#payment-method-data-context) - - [Checkout Context](#checkout-context) -- [Hooks](#hooks) - - [`usePaymentMethodInterface`](#usepaymentmethodinterface) +- [Contexts](#contexts) + - [Notices Context](#notices-context) + - [Customer Data Context](#customer-data-context) + - [Shipping Method Data context](#shipping-method-data-context) + - [Payment Method Data Context](#payment-method-data-context) + - [Checkout Context](#checkout-context) +- [Hooks](#hooks) + - [`usePaymentMethodInterface`](#usepaymentmethodinterface) -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](../../../internal-developers/block-client-apis/checkout/checkout-flow-and-events.md). ## Contexts Much of the data and api interface for components in the Checkout Block are constructed and exposed via [usage of `React.Context`](https://reactjs.org/docs/context.html). In some cases the context maintains the "tree" state within the context itself (via `useReducer`) and in others it interacts with a global `wp.data` store (for data that communicates with the server). -You can find type definitions (`typedef`) for contexts in [this file](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/assets/js/types/type-defs/contexts.js). +You can find type definitions (`typedef`) for contexts in [this file](../../../../assets/js/types/type-defs/contexts.js). ### Notices Context @@ -108,7 +108,7 @@ These docs currently don't go into detail for all the hooks as that is fairly st ### `usePaymentMethodInterface` -This hook is used to expose all the interfaces for the registered payment method components to utilize. Essentially the result from this hook is fed in as props on the registered payment components when they are setup by checkout. You can use the typedef ([`PaymentMethodInterface`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/assets/js/type-defs/payment-method-interface.ts)) to see what is fed to payment methods as props from this hook. +This hook is used to expose all the interfaces for the registered payment method components to utilize. Essentially the result from this hook is fed in as props on the registered payment components when they are setup by checkout. You can use the typedef ([`PaymentMethodInterface`](../../../../assets/js/types/type-defs/payment-method-interface.ts)) to see what is fed to payment methods as props from this hook. _Why don't payment methods just implement this hook_? diff --git a/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md b/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md index 90c1cd653a2..1b66f393b2b 100644 --- a/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md +++ b/docs/internal-developers/block-client-apis/checkout/checkout-flow-and-events.md @@ -2,24 +2,24 @@ ## Table of Contents -- [General Concepts](#general-concepts) - - [Tracking flow through status](#tracking-flow-through-status) - - [`CheckoutProvider` Exposed Statuses](#checkoutprovider-exposed-statuses) - - [Special States:](#special-states) - - [`ShippingProvider` Exposed Statuses](#shippingprovider-exposed-statuses) - - [`PaymentMethodDataProvider` Exposed Statuses](#paymentmethoddataprovider-exposed-statuses) - - [Emitting Events](#emitting-events) - - [`onCheckoutValidationBeforeProcessing`](#oncheckoutvalidationbeforeprocessing) - - [`onPaymentProcessing`](#onpaymentprocessing) - - [Success](#success) - - [Fail](#fail) - - [Error](#error) - - [`onCheckoutAfterProcessingWithSuccess`](#oncheckoutafterprocessingwithsuccess) - - [`onCheckoutAfterProcessingWithError`](#oncheckoutafterprocessingwitherror) - - [`onShippingRateSuccess`](#onshippingratesuccess) - - [`onShippingRateFail`](#onshippingratefail) - - [`onShippingRateSelectSuccess`](#onshippingrateselectsuccess) - - [`onShippingRateSelectFail`](#onshippingrateselectfail) +- [General Concepts](#general-concepts) + - [Tracking flow through status](#tracking-flow-through-status) + - [`CheckoutProvider` Exposed Statuses](#checkoutprovider-exposed-statuses) + - [Special States:](#special-states) + - [`ShippingProvider` Exposed Statuses](#shippingprovider-exposed-statuses) + - [`PaymentMethodDataProvider` Exposed Statuses](#paymentmethoddataprovider-exposed-statuses) + - [Emitting Events](#emitting-events) + - [`onCheckoutValidationBeforeProcessing`](#oncheckoutvalidationbeforeprocessing) + - [`onPaymentProcessing`](#onpaymentprocessing) + - [Success](#success) + - [Fail](#fail) + - [Error](#error) + - [`onCheckoutAfterProcessingWithSuccess`](#oncheckoutafterprocessingwithsuccess) + - [`onCheckoutAfterProcessingWithError`](#oncheckoutafterprocessingwitherror) + - [`onShippingRateSuccess`](#onshippingratesuccess) + - [`onShippingRateFail`](#onshippingratefail) + - [`onShippingRateSelectSuccess`](#onshippingrateselectsuccess) + - [`onShippingRateSelectFail`](#onshippingrateselectfail) This document gives an overview of the flow for the checkout in the WooCommerce checkout block, and some general architectural overviews. @@ -99,7 +99,7 @@ The status is exposed on the `currentErrorStatus` object provided by the `useShi ### `PaymentMethodDataProvider` Exposed Statuses -This context provider exposes everything related to payment method data and registered payment methods. The statuses exposed via this provider help inform the current state of _client side_ processing for payment methods and are updated via the payment method data event emitters. _Client side_ means the state of processing any payments by registered and active payment methods when the checkout form is submitted via those payment methods registered client side components. It's still possible that payment methods might have additional server side processing when the order is being processed but that is not reflected by these statuses (more in the [payment method integration doc](./payment-method-integration.md)). +This context provider exposes everything related to payment method data and registered payment methods. The statuses exposed via this provider help inform the current state of _client side_ processing for payment methods and are updated via the payment method data event emitters. _Client side_ means the state of processing any payments by registered and active payment methods when the checkout form is submitted via those payment methods registered client side components. It's still possible that payment methods might have additional server side processing when the order is being processed but that is not reflected by these statuses (more in the [payment method integration doc](../../../third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md)). The possible _internal_ statuses that may be set are: @@ -266,7 +266,7 @@ const successResponse = { type: 'success' }; When a success response is returned, the payment method context status will be changed to `SUCCESS`. In addition, including any of the additional properties will result in extra actions: - `paymentMethodData`: The contents of this object will be included as the value for `payment_data` when checkout sends a request to the checkout endpoint for processing the order. This is useful if a payment method does additional server side processing. -- `billingData`: This allows payment methods to update any billing data information in the checkout (typically used by Express payment methods) so it's included in the checkout processing request to the server. This data should be in the [shape outlined here](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/assets/js/type-defs/billing.js). +- `billingData`: This allows payment methods to update any billing data information in the checkout (typically used by Express payment methods) so it's included in the checkout processing request to the server. This data should be in the [shape outlined here](../../../../assets/js/types/type-defs/billing.js). - `shippingData`: This allows payment methods to update any shipping data information for the order (typically used by Express payment methods) so it's included in the checkout processing request to the server. This data should be in the [shape outlined here](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/34e17c3622637dbe8b02fac47b5c9b9ebf9e3596/assets/js/type-defs/cart.js#L20-L32). If `billingData` or `shippingData` properties aren't in the response object, then the state for the data is left alone. diff --git a/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md b/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md index 0ad0aec77f0..29c2b43646d 100644 --- a/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md +++ b/docs/internal-developers/blocks/feature-flags-and-experimental-interfaces.md @@ -2,19 +2,19 @@ ## Table of contents -- [Blocks behind flags](#blocks-behind-flags) - - [Feature plugin flag](#feature-plugin-flag) - - [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) - - [JS methods](#js-methods) - - [Slots](#slots) - - [Misc](#misc) -- [Usages of `experimental` prefix](#usages-of-experimental-prefix) +- [Blocks behind flags](#blocks-behind-flags) + - [Feature plugin flag](#feature-plugin-flag) + - [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) + - [JS methods](#js-methods) + - [Slots](#slots) + - [Misc](#misc) +- [Usages of `experimental` prefix](#usages-of-experimental-prefix) We have feature gating system setup in our plugin that defines what is accessible to the public and what is not, it has three phases: @@ -77,8 +77,8 @@ We also have individual features or code blocks behind a feature flag, this is a ### JS methods -- `__experimentalDeRegisterPaymentMethod` function used to deregister a payment method, only used in tests ([experimental function](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b07883b8b76feeb439d655b255507b24fc59e091/assets/js/blocks-registry/payment-methods/registry.ts#L114)). -- `__experimentalDeRegisterExpressPaymentMethod` function used to deregister an express payment method, only used in tests ([experimental function](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/b07883b8b76feeb439d655b255507b24fc59e091/assets/js/blocks-registry/payment-methods/registry.ts#L120)). +- `__experimentalDeRegisterPaymentMethod` function used to deregister a payment method, only used in tests ([experimental function](https://github.com/woocommerce/woocommerce-blocks/blob/f27456dd00fa0b21b29a935943defb18351edf48/assets/js/blocks-registry/payment-methods/registry.ts#L110-L114)). +- `__experimentalDeRegisterExpressPaymentMethod` function used to deregister an express payment method, only used in tests ([experimental function](https://github.com/woocommerce/woocommerce-blocks/blob/f27456dd00fa0b21b29a935943defb18351edf48/assets/js/blocks-registry/payment-methods/registry.ts#L116-L120)). - `__experimentalRegisterCheckoutFilters` and `__experimentalApplyCheckoutFilter` methods included with `@woocommerce/blocks-checkout` package. They allow registering and applying a filter to certain parts of the Cart and Checkout blocks ([experimental method 1](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/3e59ec9842464f783f6e087947e717fa0b0a7b1b/packages/checkout/registry/index.js#L2) | [experimental method 2](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/3e59ec9842464f783f6e087947e717fa0b0a7b1b/packages/checkout/registry/index.js#L17)). ### Slots diff --git a/docs/internal-developers/testing/releases/260.md b/docs/internal-developers/testing/releases/260.md index b3bc55c650f..e5feb8a1994 100644 --- a/docs/internal-developers/testing/releases/260.md +++ b/docs/internal-developers/testing/releases/260.md @@ -5,7 +5,7 @@ ## Cart and Checkout Blocks -[See testing notes here](https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/trunk/docs/testing/cart-checkout) +[See testing notes here](../cart-checkout/) ## All Products diff --git a/docs/internal-developers/testing/releases/270.md b/docs/internal-developers/testing/releases/270.md index 227778a234b..65f11fc50d5 100644 --- a/docs/internal-developers/testing/releases/270.md +++ b/docs/internal-developers/testing/releases/270.md @@ -11,7 +11,7 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. ![Checkout heading styles](https://user-images.githubusercontent.com/3616980/84032118-1e327300-a997-11ea-8c06-363ac2bd78b3.png) - In Checkout, the item quantity badges are visible with dark backgrounds (with Storefront, you can change the background color in Appearance > Customize > Background) (#2619). \ ![Item quantity badges](https://user-images.githubusercontent.com/3616980/84031988-ed523e00-a996-11ea-8545-339111e31f5f.png) - - Try adding the code snippet from the [Cart and Checkout theming](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/theming/cart-and-checkout.md#item-quantity-badge) docs (you can do it via a child theme or directly in the browser devtools) and verify the item quantity badge styles update accordingly. + - Try adding the code snippet from the [Cart and Checkout theming](../../../designers/theming/cart-and-checkout.md#item-quantity-badge) docs (you can do it via a child theme or directly in the browser devtools) and verify the item quantity badge styles update accordingly. - In general, verify there were no regressions introduced after 2.6.0. - The Cart block title should be `Your cart (X items)` (#2615). \ ![Cart block title](https://user-images.githubusercontent.com/3616980/84032294-66ea2c00-a997-11ea-8d6d-929668cb702b.png) @@ -30,10 +30,10 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. ![Select in Hello theme](https://user-images.githubusercontent.com/3616980/84032650-f4c61700-a997-11ea-969d-6427d1e221bb.png) - Twenty Twenty: - Add the All Products block and the Hand-picked Products block in a page and verify (#2573): - That with the All Products block you can add the On Sale badge and it's correctly aligned in the editor and the frontend (before, it was always shown on top of the image). \ - ![All Products in Twenty Twenty](https://user-images.githubusercontent.com/3616980/83013870-fef22800-a01d-11ea-8ea8-21229285d10a.png) + ![All Products in Twenty Twenty](https://user-images.githubusercontent.com/3616980/83013870-fef22800-a01d-11ea-8ea8-21229285d10a.png) - The Hand-picked Products block discounted prices are not underlined. \ ![Hand-picked Products in Twenty Twenty](https://user-images.githubusercontent.com/3616980/83013599-8e4b0b80-a01d-11ea-88ab-a1537110c4e2.png) -- Go to the Checkout block and verify font sizes look correct (they are inherited from the theme) (#2533). +- Go to the Checkout block and verify font sizes look correct (they are inherited from the theme) (#2533). ## Cart and Checkout error flow (#2655) @@ -94,7 +94,7 @@ You'll need to be logged in with a user that has saved payment methods. - Add the All Products block and a PHP-based product grids block (Hand-picked Products, for example) and verify: - Both of them have the same styles for prices. - Both of them scale up the small image. _Hand-picked Products on top, All Products below:_ \ ![Product grid blocks by default](https://user-images.githubusercontent.com/3616980/83166453-3d1b4480-a10f-11ea-813f-2515b26dedac.png) -- Add the [code snippets](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/theming/product-grid-270.md#product-grid-blocks-style-update-in-270) from the theming docs to undo the changes and verify: - Hand-picked Products block doesn't scale up the image anymore. - All Products block shows discounted prices in two lines. +- Add the [code snippets](../../../designers/theming/product-grid-270.md#product-grid-blocks-style-update-in-270) from the theming docs to undo the changes and verify: - Hand-picked Products block doesn't scale up the image anymore. - All Products block shows discounted prices in two lines. _Hand-picked Products on top, All Products below:_ \ ![Product grid blocks with the code snippets applied](https://user-images.githubusercontent.com/3616980/83164436-828a4280-a10c-11ea-81c1-b9a62cdf52b5.png) diff --git a/docs/internal-developers/testing/releases/820.md b/docs/internal-developers/testing/releases/820.md index 5df2aa2069a..441b7f144e9 100644 --- a/docs/internal-developers/testing/releases/820.md +++ b/docs/internal-developers/testing/releases/820.md @@ -149,7 +149,7 @@ Test that there are no regressions compared with the previous `Product Best Sell [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/internal-developers/testing/releases/810.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/internal-developers/testing/releases/820.md) diff --git a/docs/internal-developers/testing/releases/821.md b/docs/internal-developers/testing/releases/821.md index bd77494dd93..c19e1678a9b 100644 --- a/docs/internal-developers/testing/releases/821.md +++ b/docs/internal-developers/testing/releases/821.md @@ -20,7 +20,7 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. [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/internal-developers/testing/releases/810.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/internal-developers/testing/releases/821.md) diff --git a/docs/internal-developers/testing/releases/830.md b/docs/internal-developers/testing/releases/830.md index e9b578395f7..fe469c83d6f 100644 --- a/docs/internal-developers/testing/releases/830.md +++ b/docs/internal-developers/testing/releases/830.md @@ -118,6 +118,7 @@ Verify the wording says **checkout**. [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/internal-developers/testing/releases/810.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/internal-developers/testing/releases/830.md) + diff --git a/docs/internal-developers/testing/releases/831.md b/docs/internal-developers/testing/releases/831.md index 4cfa595de6f..b2a269d901c 100644 --- a/docs/internal-developers/testing/releases/831.md +++ b/docs/internal-developers/testing/releases/831.md @@ -22,6 +22,7 @@ Zip file for testing: [woocommerce-gutenberg-products-block.zip](https://github. [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/internal-developers/testing/releases/810.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/internal-developers/testing/releases/831.md) + diff --git a/docs/internal-developers/testing/releases/840.md b/docs/internal-developers/testing/releases/840.md index dcd27987102..26a35ec5f20 100644 --- a/docs/internal-developers/testing/releases/840.md +++ b/docs/internal-developers/testing/releases/840.md @@ -136,3 +136,4 @@ To test this feature you need the latest trunk of WooCommerce, or WooCommerce 6. 🐞 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/internal-developers/testing/releases/840.md) + diff --git a/docs/internal-developers/translations/translation-management.md b/docs/internal-developers/translations/translation-management.md index e33a17d8f8b..f15bb715596 100644 --- a/docs/internal-developers/translations/translation-management.md +++ b/docs/internal-developers/translations/translation-management.md @@ -1,6 +1,6 @@ # Translation management -As mentioned in [Translation basics](docs/translations/translation-basics.md), all translations are managed using [GlotPress](https://wordpress.org/plugins/glotpress/). The translations of the WooCommerce Blocks plugin can be found on . +As mentioned in [Translation basics](../../internal-developers/translations/translation-basics.md), all translations are managed using [GlotPress](https://wordpress.org/plugins/glotpress/). The translations of the WooCommerce Blocks plugin can be found on . ## Roles diff --git a/docs/internal-developers/translations/translations-in-FSE-templates.md b/docs/internal-developers/translations/translations-in-FSE-templates.md index 97c83f30374..2fbe29a994a 100644 --- a/docs/internal-developers/translations/translations-in-FSE-templates.md +++ b/docs/internal-developers/translations/translations-in-FSE-templates.md @@ -1,6 +1,6 @@ # Translations in FSE templates -To make the WooCommerce Blocks plugin inclusive, all user-facing strings should be translatable. Managing [Translations in PHP files](docs/translations/translations-in-PHP-files.md) and [Translations in JS/TS files](docs/translations/translations-in-JS-TS-files.md) is simple as PHP and JS/TS are languages are programming languages which contain translation function. In comparison, FSE-templates are using plain HTML. As HTML is a markup language and not a programming language, translation functions such as `__()` and `_n()` are not available in HTML. Therefore, translations within FSE-templates require a different approach. +To make the WooCommerce Blocks plugin inclusive, all user-facing strings should be translatable. Managing [Translations in PHP files](../../internal-developers/translations/translations-in-PHP-files.md) and [Translations in JS/TS files](../../internal-developers/translations/translations-in-JS-TS-files.md) is simple as PHP and JS/TS are languages are programming languages which contain translation function. In comparison, FSE-templates are using plain HTML. As HTML is a markup language and not a programming language, translation functions such as `__()` and `_n()` are not available in HTML. Therefore, translations within FSE-templates require a different approach. Let's take a look at `templates/parts/mini-cart.html`: diff --git a/docs/third-party-developers/extensibility/README.md b/docs/third-party-developers/extensibility/README.md index c831ffecdfc..9f1ccb29305 100644 --- a/docs/third-party-developers/extensibility/README.md +++ b/docs/third-party-developers/extensibility/README.md @@ -2,24 +2,24 @@ ## Table of Contents -- [Hooks (actions and filters)](#hooks-actions-and-filters) -- [REST API](#rest-api) -- [Checkout Payment Methods](#checkout-payment-methods) -- [Checkout Block](#checkout-block) +- [Hooks (actions and filters)](#hooks-actions-and-filters) +- [REST API](#rest-api) +- [Checkout Payment Methods](#checkout-payment-methods) +- [Checkout Block](#checkout-block) These documents are all dealing with extensibility in the various WooCommerce Blocks. ## Hooks (actions and filters) -| Document | Description | -| ----------------------- | ------------------------------------------------------- | +| Document | Description | +| ----------------------------- | ------------------------------------------------------- | | [Actions](./hooks/actions.md) | Documentation covering action hooks on the server side. | | [Filters](./hooks/filters.md) | Documentation covering filter hooks on the server side. | ## REST API -| Document | Description | -| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| Document | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | [Exposing your data in the Store API.](./rest-api/extend-rest-api-add-data.md) | Explains how you can add additional data to Store API endpoints. | | [Available endpoints to extend with ExtendSchema](./rest-api/available-endpoints-to-extend.md) | A list of all available endpoints to extend. | | [Adding an endpoint to ExtendSchema.](./rest-api/extend-rest-api-new-endpoint.md) | A step by step process for contributors to expose a new endpoint via ExtendSchema. | @@ -27,23 +27,23 @@ These documents are all dealing with extensibility in the various WooCommerce Bl ## Checkout Payment Methods -| Document | Description | -| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| Document | Description | +| -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | [Checkout Flow and Events](./checkout-payment-methods/checkout-flow-and-events.md) | All about the checkout flow in the checkout block and the various emitted events that can be subscribed to. | | [Payment Method Integration](./checkout-payment-methods/payment-method-integration.md) | Information about implementing payment methods. | | [Filtering Payment Methods](./checkout-payment-methods/filtering-payment-methods.md) | Information about filtering the payment methods available in the Checkout Block. | ## Checkout Block -In addition to the reference material below, [please see the `block-checkout` package documentation](../../packages/checkout/README.md) which is used to extend checkout with Filters, Slot Fills, and Inner Blocks. +In addition to the reference material below, [please see the `block-checkout` package documentation](../../../packages/checkout/README.md) which is used to extend checkout with Filters, Slot Fills, and Inner Blocks. | Document | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| [IntegrationInterface](./checkout-block/integration-interface.md) | The `IntegrationInterface` class and how to use it to register scripts, styles, and data with WooCommerce Blocks. | -| [Available Filters](./checkout-block/available-filters.md) | All about the filters that you may use to change values of certain elements of WooCommerce Blocks. | -| [Slots and Fills](./checkout-block/slot-fills.md) | Explains Slot Fills and how to use them to render your own components in Cart and Checkout. | -| [Available Slot Fills](./checkout-block/available-slot-fills.md) | Available Slots that you can use and their positions in Cart and Checkout. | -| [DOM Events](./checkout-block/dom-events.md) | A list of DOM Events used by some blocks to communicate between them and with other parts of WooCommerce. | +| [IntegrationInterface](./checkout-block/integration-interface.md) | The `IntegrationInterface` class and how to use it to register scripts, styles, and data with WooCommerce Blocks. | +| [Available Filters](./checkout-block/available-filters.md) | All about the filters that you may use to change values of certain elements of WooCommerce Blocks. | +| [Slots and Fills](./checkout-block/slot-fills.md) | Explains Slot Fills and how to use them to render your own components in Cart and Checkout. | +| [Available Slot Fills](./checkout-block/available-slot-fills.md) | Available Slots that you can use and their positions in Cart and Checkout. | +| [DOM Events](./checkout-block/dom-events.md) | A list of DOM Events used by some blocks to communicate between them and with other parts of WooCommerce. | | [Filter Registry](../../../packages/checkout/filter-registry/README.md) | The filter registry allows callbacks to be registered to manipulate certain values. | diff --git a/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md b/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md index f0ce088a1b3..b4cc726f420 100644 --- a/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md +++ b/docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md @@ -2,18 +2,18 @@ ## Table of Contents -- [ExperimentalOrderMeta](#experimentalordermeta) - - [Passed parameters](#passed-parameters) -- [ExperimentalOrderShippingPackages](#experimentalordershippingpackages) - - [Passed parameters](#passed-parameters-1) -- [ExperimentalDiscountsMeta](#experimentaldiscountsmeta) - - [Passed paramters](#passed-paramters) +- [ExperimentalOrderMeta](#experimentalordermeta) + - [Passed parameters](#passed-parameters) +- [ExperimentalOrderShippingPackages](#experimentalordershippingpackages) + - [Passed parameters](#passed-parameters-1) +- [ExperimentalDiscountsMeta](#experimentaldiscountsmeta) + - [Passed paramters](#passed-paramters) This document presents the list of available Slots that you can use for adding your custom content (Fill). -If you want to add a new SlotFill component, check the [Checkout - Slot Fill document](../../packages/checkout/slot/README.md). To read more about Slot and Fill, check the [Slot and Fill document](./slot-fills.md). +If you want to add a new SlotFill component, check the [Checkout - Slot Fill document](../../../../packages/checkout/slot/README.md). To read more about Slot and Fill, check the [Slot and Fill document](./slot-fills.md). -**Note About Naming:** Slots that are prefixed with `Experimental` are experimental and subject to change or remove. Once they graduate from the experimental stage, the naming would change and the `Experimental` prefix would be dropped. Check the [Feature Gating document](../blocks/feature-flags-and-experimental-interfaces.md) from more information. +**Note About Naming:** Slots that are prefixed with `Experimental` are experimental and subject to change or remove. Once they graduate from the experimental stage, the naming would change and the `Experimental` prefix would be dropped. Check the [Feature Gating document](../../../internal-developers/blocks/feature-flags-and-experimental-interfaces.md) from more information. ## ExperimentalOrderMeta diff --git a/docs/third-party-developers/extensibility/checkout-block/slot-fills.md b/docs/third-party-developers/extensibility/checkout-block/slot-fills.md index ca58b301ac5..10a0525b071 100644 --- a/docs/third-party-developers/extensibility/checkout-block/slot-fills.md +++ b/docs/third-party-developers/extensibility/checkout-block/slot-fills.md @@ -2,15 +2,15 @@ ## Table of Contents -- [The problem](#the-problem) -- [Solution](#solution) -- [Basic Usage](#basic-usage) -- [registerPlugin](#registerplugin) -- [Requirements](#requirements) +- [The problem](#the-problem) +- [Solution](#solution) +- [Basic Usage](#basic-usage) +- [registerPlugin](#registerplugin) +- [Requirements](#requirements) ## The problem -You added custom data to the [Store API](./extend-rest-api-add-data.md). You changed several strings using [Checkout filters](./available-filters.md). Now you want to render your own components in specific places in the Cart and Checkout. +You added custom data to the [Store API](../rest-api/extend-rest-api-add-data.md). You changed several strings using [Checkout filters](./available-filters.md). Now you want to render your own components in specific places in the Cart and Checkout. ## Solution diff --git a/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md b/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md index 418460588fb..c44667e47ca 100644 --- a/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md +++ b/docs/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md @@ -12,3 +12,13 @@ To see the Checkout Flow and Events please consult the following document: + + +--- + +[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/third-party-developers/extensibility/checkout-payment-methods/checkout-flow-and-events.md) + + + diff --git a/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md b/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md index a19e5fea054..ceba6960536 100644 --- a/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md +++ b/docs/third-party-developers/extensibility/checkout-payment-methods/filtering-payment-methods.md @@ -2,20 +2,20 @@ ## Table of Contents -- [The problem](#the-problem) - - [The solution](#the-solution) - - [Importing](#importing) - - [Aliased import](#aliased-import) - - [`wc global`](#wc-global) - - [Signature](#signature) - - [Extension namespace collision](#extension-namespace-collision) - - [Usage example](#usage-example) - - [Callbacks registered for payment methods](#callbacks-registered-for-payment-methods) -- [Filtering payment methods using requirements](#filtering-payment-methods-using-requirements) - - [The problem](#the-problem-1) - - [The solution](#the-solution-1) - - [Basic usage](#basic-usage) - - [Putting it all together](#putting-it-all-together) +- [The problem](#the-problem) + - [The solution](#the-solution) + - [Importing](#importing) + - [Aliased import](#aliased-import) + - [`wc global`](#wc-global) + - [Signature](#signature) + - [Extension namespace collision](#extension-namespace-collision) + - [Usage example](#usage-example) + - [Callbacks registered for payment methods](#callbacks-registered-for-payment-methods) +- [Filtering payment methods using requirements](#filtering-payment-methods-using-requirements) + - [The problem](#the-problem-1) + - [The solution](#the-solution-1) + - [Basic usage](#basic-usage) + - [Putting it all together](#putting-it-all-together) ## The problem @@ -97,7 +97,7 @@ interface CanMakePaymentArgument { } ``` -If you need data that is not available in the parameter received by the callback you can consider [exposing your data in the Store API](extend-rest-api-add-data.md). +If you need data that is not available in the parameter received by the callback you can consider [exposing your data in the Store API](../rest-api/extend-rest-api-add-data.md). ## Filtering payment methods using requirements @@ -113,7 +113,7 @@ To allow the shopper to check out without entering payment details, but still re Using the `supports` configuration of payment methods it is possible to prevent other payment methods (such as credit card, PayPal etc.) from being used to check out, and only allow the one your extension has added to appear in the Checkout block. -For more information on how to register a payment method with WooCommerce Blocks, please refer to the [Payment method integration](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/payment-method-integration.md) documentation. +For more information on how to register a payment method with WooCommerce Blocks, please refer to the [Payment method integration](../checkout-payment-methods/payment-method-integration.md) documentation. ### Basic usage diff --git a/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md b/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md index a031f730920..6898f3ba160 100644 --- a/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md +++ b/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md @@ -75,7 +75,7 @@ This should be a unique string (wise to try to pick something unique for your ga #### `content` (required) -This should be a React node that will output in the express payment method area when the block is rendered in the frontend. It will be cloned in the rendering process. When cloned, this React node will receive props passed in from the checkout payment method interface that will allow your component to interact with checkout data (more on [these props later](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/payment-method-integration.md#props-fed-to-payment-method-nodes)). +This should be a React node that will output in the express payment method area when the block is rendered in the frontend. It will be cloned in the rendering process. When cloned, this React node will receive props passed in from the checkout payment method interface that will allow your component to interact with checkout data (more on [these props later](./payment-method-integration.md#props-fed-to-payment-method-nodes)). #### `edit` (required) @@ -149,10 +149,10 @@ The options you feed the configuration instance are the same as those for expres ### Props Fed to Payment Method Nodes -A big part of the payment method integration is the interface that is exposed for payment methods to use via props when the node provided is cloned and rendered on block mount. While all the props are listed below, you can find more details about what the props reference, their types etc via the [typedefs described in this file](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/9bae7c3a4a0b6650686dd4a8876bd1d11a9259fd/assets/js/types/type-defs/payment-method-interface.ts). +A big part of the payment method integration is the interface that is exposed for payment methods to use via props when the node provided is cloned and rendered on block mount. While all the props are listed below, you can find more details about what the props reference, their types etc via the [typedefs described in this file](../../../../assets/js/types/type-defs/payment-method-interface.ts). | Property | Type | Description | Values | -| ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | | `activePaymentMethod` | String | The slug of the current active payment method in the checkout. | - | | `billing` | Object | Contains everything related to billing. | `billingData`, `cartTotal`, `currency`, `cartTotalItems`, `displayPricesIncludingTax`, `appliedCoupons`, `customerId` | | `cartData` | Object | Data exposed from the cart including items, fees, and any registered extension data. Note that this data should be treated as immutable (should not be modified/mutated) or it will result in errors in your application. | `cartItems`, `cartFees`, `extensions` | @@ -160,8 +160,8 @@ A big part of the payment method integration is the interface that is exposed fo | `components` | Object | It exposes React components that can be implemented by your payment method for various common interface elements used by payment methods. |
  • `ValidationInputError`: a container for holding validation errors which typically you'll include after any inputs
  • [`PaymentMethodLabel`](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/e089ae17043fa525e8397d605f0f470959f2ae95/assets/js/payment-method-extensions/payment-methods/paypal/index.js#L37-L40): use this component for the payment method label, including an optional icon
  • `PaymentMethodIcons`: a React component used for displaying payment method icons
  • `LoadingMask`: a wrapper component that handles displaying a loading state when the isLoading prop is true. Exposes the [LoadingMask component](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/c9074a4941919987dbad16a80f358b960336a09d/assets/js/base/components/loading-mask/index.js)
| | `emitResponse` | Object | Contains some constants that can be helpful when using the event emitter. Read the _[Emitting Events](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/e267cd96a4329a4eeef816b2ef627e113ebb72a5/docs/extensibility/checkout-flow-and-events.md#emitting-events)_ section for more details. |
  • `noticeContexts`: This is an object containing properties referencing areas where notices can be targeted in the checkout. The object has the following properties:
    • `PAYMENTS`: This is a reference to the notice area in the payment methods step.
    • `EXPRESS_PAYMENTS`: This is a reference to the notice area in the express payment methods step.
  • `responseTypes`: This is an object containing properties referencing the various response types that can be returned by observers for some event emitters. It makes it easier for autocompleting the types and avoiding typos due to human error. The types are `SUCCESS`, `FAIL`, `ERROR`. The values for these types also correspond to the [payment status types](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/34e17c3622637dbe8b02fac47b5c9b9ebf9e3596/src/Payments/PaymentResult.php#L21) from the [checkout endpoint response from the server](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/34e17c3622637dbe8b02fac47b5c9b9ebf9e3596/src/RestApi/StoreApi/Schemas/CheckoutSchema.php#L103-L113).
| | `eventRegistration` | object | Contains all the checkout event emitter registration functions. These are functions the payment method can register observers on to interact with various points in the checkout flow (see [this doc](./checkout-flow-and-events.md) for more info). | `onCheckoutValidationBeforeProcessing`, `onCheckoutAfterProcessingWithSuccess`, `onCheckoutAfterProcessingWithError`, `onPaymentProcessing`, `onShippingRateSuccess`, `onShippingRateFail`, `onShippingRateSelectSuccess`, `onShippingRateSelectFail` | -| `onClick` | Function | **Provided to express payment methods** that should be triggered when the payment method button is clicked (which will signal to checkout the payment method has taken over payment processing) | - | | -| `onClose` | Function | **Provided to express payment methods** that should be triggered when the express payment method modal closes and control is returned to checkout. | - | | +| `onClick` | Function | **Provided to express payment methods** that should be triggered when the payment method button is clicked (which will signal to checkout the payment method has taken over payment processing) | - | | +| `onClose` | Function | **Provided to express payment methods** that should be triggered when the express payment method modal closes and control is returned to checkout. | - | | | `onSubmit` | Function | Submits the checkout and begins processing | - | | `paymentStatus` | Object | Various payment status helpers. Note, your payment method does not have to handle setting this status client side. Checkout will handle this via the responses your payment method gives from observers registered to [checkout event emitters](./checkout-flow-and-events.md). | `isPristine`, `isStarted`, `isProcessing`, `isFinished`, `hasError`, `hasFailed`, `isSuccessful` | | `setExpressPaymentError` | Function | Receives a string and allows express payment methods to set an error notice for the express payment area on demand. This can be necessary because some express payment method processing might happen outside of checkout events. | - | diff --git a/docs/third-party-developers/extensibility/hooks/actions.md b/docs/third-party-developers/extensibility/hooks/actions.md index a5c68419205..dcd3c5ffd12 100644 --- a/docs/third-party-developers/extensibility/hooks/actions.md +++ b/docs/third-party-developers/extensibility/hooks/actions.md @@ -69,7 +69,7 @@ do_action( 'woocommerce_add_to_cart', string $cart_id, integer $product_id, inte ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -94,8 +94,8 @@ do_action( 'woocommerce_after_main_content' ) ### 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) --- @@ -116,7 +116,7 @@ do_action( 'woocommerce_after_shop_loop' ) ### Source - - [BlockTypes/ClassicTemplate.php](../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- @@ -141,7 +141,7 @@ do_action( 'woocommerce_applied_coupon', string $coupon_code ) ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -163,7 +163,7 @@ do_action( 'woocommerce_archive_description' ) ### Source - - [BlockTypes/ClassicTemplate.php](../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- @@ -190,8 +190,8 @@ do_action( 'woocommerce_before_main_content' ) ### 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) --- @@ -214,7 +214,7 @@ do_action( 'woocommerce_before_shop_loop' ) ### Source - - [BlockTypes/ClassicTemplate.php](../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- @@ -230,8 +230,8 @@ do_action( 'woocommerce_blocks_cart_enqueue_data' ) ### Source - - [BlockTypes/Cart.php](../../src/BlockTypes/Cart.php) - - [BlockTypes/MiniCart.php](../../src/BlockTypes/MiniCart.php) + - [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) + - [BlockTypes/MiniCart.php](../../../../src/BlockTypes/MiniCart.php) --- @@ -247,7 +247,7 @@ do_action( 'woocommerce_blocks_checkout_enqueue_data' ) ### Source - - [BlockTypes/Checkout.php](../../src/BlockTypes/Checkout.php) + - [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) --- @@ -263,7 +263,7 @@ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' ) ### Source - - [BlockTypes/Cart.php](../../src/BlockTypes/Cart.php) + - [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) --- @@ -279,7 +279,7 @@ do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' ) ### Source - - [BlockTypes/Cart.php](../../src/BlockTypes/Cart.php) + - [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php) --- @@ -295,7 +295,7 @@ do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_after' ) ### Source - - [BlockTypes/Checkout.php](../../src/BlockTypes/Checkout.php) + - [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) --- @@ -311,7 +311,7 @@ do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_before' ) ### Source - - [BlockTypes/Checkout.php](../../src/BlockTypes/Checkout.php) + - [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php) --- @@ -337,7 +337,7 @@ do_action( 'woocommerce_blocks_{$this->registry_identifier}_registration', \Auto ### Source - - [Integrations/IntegrationRegistry.php](../../src/Integrations/IntegrationRegistry.php) + - [Integrations/IntegrationRegistry.php](../../../../src/Integrations/IntegrationRegistry.php) --- @@ -363,7 +363,7 @@ 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) --- @@ -394,7 +394,7 @@ do_action( 'woocommerce_created_customer', integer $customer_id, array $new_cust ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -415,7 +415,7 @@ do_action( 'woocommerce_no_products_found' ) ### Source - - [BlockTypes/ClassicTemplate.php](../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- @@ -446,7 +446,7 @@ do_action( 'woocommerce_register_post', string $username, string $user_email, \W ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -474,7 +474,7 @@ do_action_ref_array( 'woocommerce_rest_checkout_process_payment_with_context', [ ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -490,7 +490,7 @@ do_action( 'woocommerce_shop_loop' ) ### Source - - [BlockTypes/ClassicTemplate.php](../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- @@ -535,7 +535,7 @@ 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) --- @@ -558,7 +558,7 @@ do_action( 'woocommerce_store_api_cart_update_customer_from_request', \WC_Custom ### Source - - [StoreApi/Routes/V1/CartUpdateCustomer.php](../../src/StoreApi/Routes/V1/CartUpdateCustomer.php) + - [StoreApi/Routes/V1/CartUpdateCustomer.php](../../../../src/StoreApi/Routes/V1/CartUpdateCustomer.php) --- @@ -582,7 +582,7 @@ do_action( 'woocommerce_store_api_cart_update_order_from_request', \WC_Order $dr ### Source - - [StoreApi/Routes/V1/AbstractCartRoute.php](../../src/StoreApi/Routes/V1/AbstractCartRoute.php) + - [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) --- @@ -628,7 +628,7 @@ add_action( 'woocommerce_blocks_checkout_order_processed', 'my_function_callback ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -651,7 +651,7 @@ do_action( 'woocommerce_store_api_checkout_update_customer_from_request', \WC_Cu ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -678,7 +678,7 @@ do_action( 'woocommerce_store_api_checkout_update_order_from_request', \WC_Order ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -709,7 +709,7 @@ do_action( 'woocommerce_store_api_checkout_update_order_meta', \WC_Order $order ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -736,7 +736,7 @@ do_action( 'woocommerce_store_api_validate_add_to_cart', \WC_Product $product, a ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -759,7 +759,7 @@ do_action( 'woocommerce_store_api_validate_cart_item', \WC_Product $product, arr ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- diff --git a/docs/third-party-developers/extensibility/hooks/filters.md b/docs/third-party-developers/extensibility/hooks/filters.md index 1c6546e1227..501fa8fd848 100644 --- a/docs/third-party-developers/extensibility/hooks/filters.md +++ b/docs/third-party-developers/extensibility/hooks/filters.md @@ -15,7 +15,6 @@ - [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_admin_disabled](#woocommerce_admin_disabled) - [woocommerce_apply_individual_use_coupon](#woocommerce_apply_individual_use_coupon) - [woocommerce_apply_with_individual_use_coupon](#woocommerce_apply_with_individual_use_coupon) - [woocommerce_blocks_product_grid_is_cacheable](#woocommerce_blocks_product_grid_is_cacheable) @@ -58,7 +57,7 @@ apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_block', ### Source - - [BlockTypesController.php](../../src/BlockTypesController.php) + - [BlockTypesController.php](../../../../src/BlockTypesController.php) --- @@ -84,7 +83,7 @@ apply_filters( '__experimental_woocommerce_blocks_add_data_attributes_to_namespa ### Source - - [BlockTypesController.php](../../src/BlockTypesController.php) + - [BlockTypesController.php](../../../../src/BlockTypesController.php) --- @@ -130,7 +129,7 @@ add_filter( '__experimental_woocommerce_blocks_payment_gateway_features_list', ' ### Source - - [Payments/Integrations/PayPal.php](../../src/Payments/Integrations/PayPal.php) + - [Payments/Integrations/PayPal.php](../../../../src/Payments/Integrations/PayPal.php) --- @@ -161,7 +160,7 @@ apply_filters( 'woocommerce_add_cart_item', array $cart_item_data, string $cart_ ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -194,7 +193,7 @@ apply_filters( 'woocommerce_add_cart_item_data', array $cart_item_data, integer ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -228,7 +227,7 @@ apply_filters( 'woocommerce_add_to_cart_sold_individually_quantity', integer $so ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -266,7 +265,7 @@ apply_filters( 'woocommerce_add_to_cart_validation', boolean $passed_validation, ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -300,23 +299,7 @@ apply_filters( 'woocommerce_adjust_non_base_location_prices', boolean $adjust_no ### Source - - [StoreApi/Utilities/ProductQuery.php](../../src/StoreApi/Utilities/ProductQuery.php) - ---- - -## woocommerce_admin_disabled - - - - -```php -apply_filters( 'woocommerce_admin_disabled' ) -``` - -### Source - - - - [InboxNotifications.php](../../src/InboxNotifications.php) + - [StoreApi/Utilities/ProductQuery.php](../../../../src/StoreApi/Utilities/ProductQuery.php) --- @@ -348,7 +331,7 @@ apply_filters( 'woocommerce_apply_individual_use_coupon', array $coupons, \WC_Co ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -381,7 +364,7 @@ apply_filters( 'woocommerce_apply_with_individual_use_coupon', boolean $apply_wi ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -409,7 +392,7 @@ apply_filters( 'woocommerce_blocks_product_grid_is_cacheable', boolean $is_cache ### Source - - [BlockTypes/AbstractProductGrid.php](../../src/BlockTypes/AbstractProductGrid.php) + - [BlockTypes/AbstractProductGrid.php](../../../../src/BlockTypes/AbstractProductGrid.php) --- @@ -438,7 +421,7 @@ apply_filters( 'woocommerce_blocks_product_grid_item_html', string $html, array ### Source - - [BlockTypes/AbstractProductGrid.php](../../src/BlockTypes/AbstractProductGrid.php) + - [BlockTypes/AbstractProductGrid.php](../../../../src/BlockTypes/AbstractProductGrid.php) --- @@ -466,7 +449,7 @@ apply_filters( 'woocommerce_blocks_register_script_dependencies', array $depende ### Source - - [Assets/Api.php](../../src/Assets/Api.php) + - [Assets/Api.php](../../../../src/Assets/Api.php) --- @@ -496,7 +479,7 @@ apply_filters( 'woocommerce_cart_contents_changed', array $cart_contents ) ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -521,7 +504,7 @@ apply_filters( 'woocommerce_ga_disable_tracking', boolean $disable_tracking ) ### Source - - [Domain/Services/GoogleAnalytics.php](../../src/Domain/Services/GoogleAnalytics.php) + - [Domain/Services/GoogleAnalytics.php](../../../../src/Domain/Services/GoogleAnalytics.php) --- @@ -556,7 +539,7 @@ apply_filters( 'woocommerce_get_item_data', array $item_data, array $cart_item ) ### Source - - [StoreApi/Schemas/V1/CartItemSchema.php](../../src/StoreApi/Schemas/V1/CartItemSchema.php) + - [StoreApi/Schemas/V1/CartItemSchema.php](../../../../src/StoreApi/Schemas/V1/CartItemSchema.php) --- @@ -587,7 +570,7 @@ apply_filters( 'woocommerce_new_customer_data', array $customer_data ) ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -623,7 +606,7 @@ apply_filters( 'woocommerce_registration_errors', \WP_Error $errors, string $use ### Source - - [StoreApi/Routes/V1/Checkout.php](../../src/StoreApi/Routes/V1/Checkout.php) + - [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php) --- @@ -657,7 +640,7 @@ apply_filters( 'woocommerce_shared_settings', array $data ) ### Source - - [Assets/AssetDataRegistry.php](../../src/Assets/AssetDataRegistry.php) + - [Assets/AssetDataRegistry.php](../../../../src/Assets/AssetDataRegistry.php) --- @@ -689,7 +672,7 @@ apply_filters( 'woocommerce_shipping_package_name', string $shipping_package_nam ### Source - - [StoreApi/Utilities/CartController.php](../../src/StoreApi/Utilities/CartController.php) + - [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php) --- @@ -710,7 +693,7 @@ apply_filters( 'woocommerce_show_page_title' ) ### Source - - [BlockTypes/ClassicTemplate.php](../../src/BlockTypes/ClassicTemplate.php) + - [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php) --- @@ -741,7 +724,7 @@ apply_filters( 'woocommerce_store_api_disable_nonce_check', boolean $disable_non ### Source - - [StoreApi/Routes/V1/AbstractCartRoute.php](../../src/StoreApi/Routes/V1/AbstractCartRoute.php) + - [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php) --- @@ -773,7 +756,7 @@ apply_filters( 'woocommerce_store_api_product_quantity_limit', integer $quantity ### Source - - [StoreApi/Utilities/QuantityLimits.php](../../src/StoreApi/Utilities/QuantityLimits.php) + - [StoreApi/Utilities/QuantityLimits.php](../../../../src/StoreApi/Utilities/QuantityLimits.php) --- @@ -806,7 +789,7 @@ apply_filters( 'woocommerce_store_api_product_quantity_{$value_type}', mixed $va ### Source - - [StoreApi/Utilities/QuantityLimits.php](../../src/StoreApi/Utilities/QuantityLimits.php) + - [StoreApi/Utilities/QuantityLimits.php](../../../../src/StoreApi/Utilities/QuantityLimits.php) --- @@ -843,7 +826,7 @@ apply_filters( 'woocommerce_variation_option_name', string $value, null $unused, ### Source - - [StoreApi/Schemas/V1/CartItemSchema.php](../../src/StoreApi/Schemas/V1/CartItemSchema.php) + - [StoreApi/Schemas/V1/CartItemSchema.php](../../../../src/StoreApi/Schemas/V1/CartItemSchema.php) --- diff --git a/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md b/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md index fdc5749d51d..b2944d6e012 100644 --- a/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md +++ b/docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md @@ -126,9 +126,9 @@ If you try to register again, under the same namespace, the previously registere You are the author of an extension that lets the shopper redeem points that they earn on your website for a discount on their order. There is a text field where the shopper can enter how many points they want to redeem, and a submit button that will apply the redemption. -Your extension adds these UI elements to the sidebar in the Cart and Checkout blocks using the [`DiscountsMeta`](./available-slot-fills.md) Slot. +Your extension adds these UI elements to the sidebar in the Cart and Checkout blocks using the [`DiscountsMeta`](../checkout-block/available-slot-fills.md) Slot. -More information on how to use Slots is available in our [Slots and Fills documentation](./slot-fills.md). +More information on how to use Slots is available in our [Slots and Fills documentation](../checkout-block/slot-fills.md). Once implemented, the sidebar has a control added to it like this: @@ -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/packages/checkout/filter-registry/README.md b/packages/checkout/filter-registry/README.md index d03b0572d26..c90ff9f7d1b 100644 --- a/packages/checkout/filter-registry/README.md +++ b/packages/checkout/filter-registry/README.md @@ -2,20 +2,20 @@ ## Table of Contents -- [\_\_experimentalRegisterCheckoutFilters](#__experimentalregistercheckoutfilters) - - [Usage](#usage) - - [Options](#options) - - [`namespace (string)`](#namespace-string) - - [`filters (object)`](#filters-object) -- [\_\_experimentalApplyCheckoutFilter](#__experimentalapplycheckoutfilter) - - [Usage](#usage-1) - - [Options](#options-1) - - [`filterName (string, required)`](#filtername-string-required) - - [`defaultValue (mixed, required)`](#defaultvalue-mixed-required) - - [`extensions`](#extensions) - - [`arg (object)`](#arg-object) - - [`validation (function)`](#validation-function) -- [Available Filters](#available-filters) +- [\_\_experimentalRegisterCheckoutFilters](#__experimentalregistercheckoutfilters) + - [Usage](#usage) + - [Options](#options) + - [`namespace (string)`](#namespace-string) + - [`filters (object)`](#filters-object) +- [\_\_experimentalApplyCheckoutFilter](#__experimentalapplycheckoutfilter) + - [Usage](#usage-1) + - [Options](#options-1) + - [`filterName (string, required)`](#filtername-string-required) + - [`defaultValue (mixed, required)`](#defaultvalue-mixed-required) + - [`extensions`](#extensions) + - [`arg (object)`](#arg-object) + - [`validation (function)`](#validation-function) +- [Available Filters](#available-filters) The filter registry allows callbacks to be registered to manipulate certain values. This is similar to the traditional filter system in WordPress (where you register a callback with a specific filter and return a modified value). @@ -121,7 +121,7 @@ A function that needs to return true when the filtered value is passed in order ## Available Filters -Filters are implemented throughout the Mini Cart, Cart and Checkout Blocks, as well as some components. For a list of filters, [see this document](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/available-filters.md). You can also search for [usage of `__experimentalApplyCheckoutFilter` within the source code](https://github.com/woocommerce/woocommerce-gutenberg-products-block/search?q=__experimentalApplyCheckoutFilter). +Filters are implemented throughout the Mini Cart, Cart and Checkout Blocks, as well as some components. For a list of filters, [see this document](../../../docs/third-party-developers/extensibility/checkout-block/available-filters.md). You can also search for [usage of `__experimentalApplyCheckoutFilter` within the source code](https://github.com/woocommerce/woocommerce-gutenberg-products-block/search?q=__experimentalApplyCheckoutFilter). diff --git a/packages/checkout/slot/README.md b/packages/checkout/slot/README.md index 4b332264894..eeb677b95e0 100644 --- a/packages/checkout/slot/README.md +++ b/packages/checkout/slot/README.md @@ -2,20 +2,20 @@ ## Table of Contents -- [`createSlotFill( slotName )`](#createslotfill-slotname-) - - [Usage](#usage) - - [Options](#options) - - [`slotName (string, required)`](#slotname-string-required) - - [`onError (Function)`](#onerror-function) - - [`Slot` Component](#slot-component) - - [Usage](#usage-1) - - [Options](#options-1) - - [`as (string|element)`](#as-stringelement) - - [`className (string)`](#classname-string) - - [`fillProps (object)`](#fillprops-object) - - [`Fill` Component](#fill-component) -- [Extending Checkout via Slot Fills](#extending-checkout-via-slot-fills) -- [Available Slot Fills](#available-slot-fills) +- [`createSlotFill( slotName )`](#createslotfill-slotname-) + - [Usage](#usage) + - [Options](#options) + - [`slotName (string, required)`](#slotname-string-required) + - [`onError (Function)`](#onerror-function) + - [`Slot` Component](#slot-component) + - [Usage](#usage-1) + - [Options](#options-1) + - [`as (string|element)`](#as-stringelement) + - [`className (string)`](#classname-string) + - [`fillProps (object)`](#fillprops-object) + - [`Fill` Component](#fill-component) +- [Extending Checkout via Slot Fills](#extending-checkout-via-slot-fills) +- [Available Slot Fills](#available-slot-fills) Slot and Fill are a pair of components which enable developers to render elsewhere in a React element tree, a pattern often referred to as "portal" rendering. It is a pattern for component extensibility, where a single Slot may be occupied by an indeterminate number of Fills elsewhere in the application. @@ -181,7 +181,7 @@ registerPlugin( 'my-plugin', { render } ); ## Available Slot Fills -Slot Fills are implemented throughout the Cart and Checkout Blocks, as well as some components. For a list of available Slot Fills, [see this document](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/available-slot-fills.md). +Slot Fills are implemented throughout the Cart and Checkout Blocks, as well as some components. For a list of available Slot Fills, [see this document](../../../docs/third-party-developers/extensibility/checkout-block/available-slot-fills.md). diff --git a/packages/checkout/utils/README.md b/packages/checkout/utils/README.md index a6bb6be5776..e4735267082 100644 --- a/packages/checkout/utils/README.md +++ b/packages/checkout/utils/README.md @@ -2,15 +2,15 @@ ## Table of Contents -- [`extensionCartUpdate`](#extensioncartupdate) - - [Usage](#usage) - - [Options](#options) - - [`args (object, required)`](#args-object-required) -- [`mustContain`](#mustcontain) - - [Usage](#usage-1) - - [Options](#options-1) - - [`value (string, required)`](#value-string-required) - - [`requiredValue (string, required)`](#requiredvalue-string-required) +- [`extensionCartUpdate`](#extensioncartupdate) + - [Usage](#usage) + - [Options](#options) + - [`args (object, required)`](#args-object-required) +- [`mustContain`](#mustcontain) + - [Usage](#usage-1) + - [Options](#options-1) + - [`value (string, required)`](#value-string-required) + - [`requiredValue (string, required)`](#requiredvalue-string-required) Miscellaneous utility functions for dealing with checkout functionality. @@ -41,7 +41,7 @@ The following options are available: #### `args (object, required)` -Args to pass to the Rest API endpoint. This can contain data and a namespace to trigger extension specific functionality on the server-side. [You can read more about this, and the server-side implementation, in this doc.](https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/trunk/docs/extensibility/extend-rest-api-update-cart.md) +Args to pass to the Rest API endpoint. This can contain data and a namespace to trigger extension specific functionality on the server-side. [You can read more about this, and the server-side implementation, in this doc.](../../../docs/third-party-developers/extensibility/rest-api/extend-rest-api-update-cart.md) ## `mustContain`