woocommerce/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md

844 lines
22 KiB
Markdown
Raw Normal View History

<!-- DO NOT UPDATE THIS DOC DIRECTLY -->
<!-- Use `npm run build:docs` to automatically build hook documentation -->
# Actions
## Table of Contents
- [deprecated_function_run](#deprecated_function_run)
- [woocommerce_add_to_cart](#woocommerce_add_to_cart)
- [woocommerce_after_main_content](#woocommerce_after_main_content)
- [woocommerce_after_shop_loop](#woocommerce_after_shop_loop)
- [woocommerce_applied_coupon](#woocommerce_applied_coupon)
- [woocommerce_archive_description](#woocommerce_archive_description)
- [woocommerce_before_main_content](#woocommerce_before_main_content)
- [woocommerce_before_shop_loop](#woocommerce_before_shop_loop)
- [woocommerce_blocks_cart_enqueue_data](#woocommerce_blocks_cart_enqueue_data)
- [woocommerce_blocks_checkout_enqueue_data](#woocommerce_blocks_checkout_enqueue_data)
- [woocommerce_blocks_enqueue_cart_block_scripts_after](#woocommerce_blocks_enqueue_cart_block_scripts_after)
- [woocommerce_blocks_enqueue_cart_block_scripts_before](#woocommerce_blocks_enqueue_cart_block_scripts_before)
- [woocommerce_blocks_enqueue_checkout_block_scripts_after](#woocommerce_blocks_enqueue_checkout_block_scripts_after)
- [woocommerce_blocks_enqueue_checkout_block_scripts_before](#woocommerce_blocks_enqueue_checkout_block_scripts_before)
- [woocommerce_blocks_loaded](#woocommerce_blocks_loaded)
- [woocommerce_blocks_{$this->registry_identifier}_registration](#woocommerce_blocks_this-registry_identifier_registration)
- [woocommerce_check_cart_items](#woocommerce_check_cart_items)
- [woocommerce_created_customer](#woocommerce_created_customer)
- [woocommerce_no_products_found](#woocommerce_no_products_found)
- [woocommerce_register_post](#woocommerce_register_post)
- [woocommerce_shop_loop](#woocommerce_shop_loop)
- [woocommerce_store_api_cart_errors](#woocommerce_store_api_cart_errors)
- [woocommerce_store_api_cart_select_shipping_rate](#woocommerce_store_api_cart_select_shipping_rate)
- [woocommerce_store_api_cart_update_customer_from_request](#woocommerce_store_api_cart_update_customer_from_request)
- [woocommerce_store_api_cart_update_order_from_request](#woocommerce_store_api_cart_update_order_from_request)
- [woocommerce_store_api_checkout_order_processed](#woocommerce_store_api_checkout_order_processed)
- [woocommerce_store_api_checkout_update_customer_from_request](#woocommerce_store_api_checkout_update_customer_from_request)
- [woocommerce_store_api_checkout_update_order_meta](#woocommerce_store_api_checkout_update_order_meta)
- [woocommerce_store_api_rate_limit_exceeded](#woocommerce_store_api_rate_limit_exceeded)
- [woocommerce_store_api_validate_add_to_cart](#woocommerce_store_api_validate_add_to_cart)
- [woocommerce_store_api_validate_cart_item](#woocommerce_store_api_validate_cart_item)
- [woocommerce_{$product->get_type()}_add_to_cart](#woocommerce_product-get_type_add_to_cart)
- [{$hook}](#hook)
---
## deprecated_function_run
2023-02-24 12:08:34 +00:00
Fires when a deprecated function is called.
```php
do_action( 'deprecated_function_run' )
```
### Source
- [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php)
---
## woocommerce_add_to_cart
Fires when an item is added to the cart.
```php
do_action( 'woocommerce_add_to_cart', string $cart_id, integer $product_id, integer $request_quantity, integer $variation_id, array $variation, array $cart_item_data )
```
**Note: Matches action name in WooCommerce core.**
### Description
<p>This hook fires when an item is added to the cart. This is triggered from the Store API in this context, but WooCommerce core add to cart events trigger the same hook.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $cart_id | string | ID of the item in the cart. |
| $product_id | integer | ID of the product added to the cart. |
| $request_quantity | integer | Quantity of the item added to the cart. |
| $variation_id | integer | Variation ID of the product added to the cart. |
| $variation | array | Array of variation data. |
| $cart_item_data | array | Array of other cart item data. |
### Source
- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)
---
## woocommerce_after_main_content
Hook: woocommerce_after_main_content
```php
do_action( 'woocommerce_after_main_content' )
```
### Description
<p>Called after rendering the main content for a product.</p>
### See
- woocommerce_output_content_wrapper_end() - Outputs closing DIV for the content (priority 10)
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_after_shop_loop
Hook: woocommerce_after_shop_loop.
```php
do_action( 'woocommerce_after_shop_loop' )
```
### See
- woocommerce_pagination() - Renders pagination (priority 10)
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_applied_coupon
Fires after a coupon has been applied to the cart.
```php
do_action( 'woocommerce_applied_coupon', string $coupon_code )
```
**Note: Matches action name in WooCommerce core.**
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $coupon_code | string | The coupon code that was applied. |
### Source
- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)
---
## woocommerce_archive_description
Hook: woocommerce_archive_description.
```php
do_action( 'woocommerce_archive_description' )
```
### See
- woocommerce_taxonomy_archive_description() - Renders the taxonomy archive description (priority 10)
- woocommerce_product_archive_description() - Renders the product archive description (priority 10)
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_before_main_content
Hook: woocommerce_before_main_content
```php
do_action( 'woocommerce_before_main_content' )
```
### Description
<p>Called before rendering the main content for a product.</p>
### See
- woocommerce_output_content_wrapper() - Outputs opening DIV for the content (priority 10)
- woocommerce_breadcrumb() - Outputs breadcrumb trail to the current product (priority 20)
- WC_Structured_Data::generate_website_data() - Outputs schema markup (priority 30)
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_before_shop_loop
Hook: woocommerce_before_shop_loop.
```php
do_action( 'woocommerce_before_shop_loop' )
```
### See
- woocommerce_output_all_notices() - Render error notices (priority 10)
- woocommerce_result_count() - Show number of results found (priority 20)
- woocommerce_catalog_ordering() - Show form to control sort order (priority 30)
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_blocks_cart_enqueue_data
Fires after cart block data is registered.
```php
do_action( 'woocommerce_blocks_cart_enqueue_data' )
```
### Source
- [BlockTypes/MiniCart.php](../../../../src/BlockTypes/MiniCart.php)
- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php)
---
## woocommerce_blocks_checkout_enqueue_data
Fires after checkout block data is registered.
```php
do_action( 'woocommerce_blocks_checkout_enqueue_data' )
```
### Source
- [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php)
---
## woocommerce_blocks_enqueue_cart_block_scripts_after
Fires after cart block scripts are enqueued.
```php
do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after' )
```
### Source
- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php)
---
## woocommerce_blocks_enqueue_cart_block_scripts_before
Fires before cart block scripts are enqueued.
```php
do_action( 'woocommerce_blocks_enqueue_cart_block_scripts_before' )
```
### Source
- [BlockTypes/Cart.php](../../../../src/BlockTypes/Cart.php)
---
## woocommerce_blocks_enqueue_checkout_block_scripts_after
Fires after checkout block scripts are enqueued.
```php
do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_after' )
```
### Source
- [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php)
---
## woocommerce_blocks_enqueue_checkout_block_scripts_before
Fires before checkout block scripts are enqueued.
```php
do_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_before' )
```
### Source
- [BlockTypes/Checkout.php](../../../../src/BlockTypes/Checkout.php)
---
## woocommerce_blocks_loaded
Fires when the woocommerce blocks are loaded and ready to use.
```php
do_action( 'woocommerce_blocks_loaded' )
```
### Description
<p>This hook is intended to be used as a safe event hook for when the plugin has been loaded, and all dependency requirements have been met.</p> <p>To ensure blocks are initialized, you must use the <code>woocommerce_blocks_loaded</code> hook instead of the <code>plugins_loaded</code> hook. This is because the functions hooked into plugins_loaded on the same priority load in an inconsistent and unpredictable manner.</p>
### Source
- [Domain/Bootstrap.php](../../../../src/Domain/Bootstrap.php)
---
## woocommerce_blocks_{$this->registry_identifier}_registration
Fires when the IntegrationRegistry is initialized.
```php
do_action( 'woocommerce_blocks_{$this->registry_identifier}_registration', \Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry $this )
```
### Description
<p>Runs before integrations are initialized allowing new integration to be registered for use. This should be used as the primary hook for integrations to include their scripts, styles, and other code extending the blocks.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $this | \Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry | Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method. |
### Source
- [Integrations/IntegrationRegistry.php](../../../../src/Integrations/IntegrationRegistry.php)
---
## ~~woocommerce_check_cart_items~~
Fires when cart items are being validated.
```php
do_action( 'woocommerce_check_cart_items' )
```
**Deprecated: This hook is deprecated and will be removed**
**Note: Matches action name in WooCommerce core.**
### Description
<p>Allow 3rd parties to validate cart items. This is a legacy hook from Woo core. This filter will be deprecated because it encourages usage of wc_add_notice. For the API we need to capture notices and convert to wp errors instead.</p>
### Source
- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)
---
## woocommerce_created_customer
Fires after a customer account has been registered.
```php
do_action( 'woocommerce_created_customer', integer $customer_id, array $new_customer_data, string $password_generated )
```
**Note: Matches filter name in WooCommerce core.**
### Description
<p>This hook fires after customer accounts are created and passes the customer data.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $customer_id | integer | New customer (user) ID. |
| $new_customer_data | array | Array of customer (user) data. |
| $password_generated | string | The generated password for the account. |
### Source
- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php)
---
## woocommerce_no_products_found
Hook: woocommerce_no_products_found.
```php
do_action( 'woocommerce_no_products_found' )
```
### See
- wc_no_products_found() - Default no products found content (priority 10)
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_register_post
Fires before a customer account is registered.
```php
do_action( 'woocommerce_register_post', string $username, string $user_email, \WP_Error $errors )
```
**Note: Matches filter name in WooCommerce core.**
### Description
<p>This hook fires before customer accounts are created and passes the form data (username, email) and an array of errors.</p> <p>This could be used to add extra validation logic and append errors to the array.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $username | string | Customer username. |
| $user_email | string | Customer email address. |
| $errors | \WP_Error | Error object. |
### Source
- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php)
---
## woocommerce_shop_loop
Hook: woocommerce_shop_loop.
```php
do_action( 'woocommerce_shop_loop' )
```
### Source
- [BlockTypes/ClassicTemplate.php](../../../../src/BlockTypes/ClassicTemplate.php)
---
## woocommerce_store_api_cart_errors
Fires an action to validate the cart.
```php
do_action( 'woocommerce_store_api_cart_errors', \WP_Error $errors, \WC_Cart $cart )
```
### Description
<p>Functions hooking into this should add custom errors using the provided WP_Error instance.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $errors | \WP_Error | WP_Error object. |
| $cart | \WC_Cart | Cart object. |
### Example
# Validate Cart
```php
// The action callback function.
function my_function_callback( $errors, $cart ) {
// Validate the $cart object and add errors. For example, to create an error if the cart contains more than 10 items:
if ( $cart->get_cart_contents_count() > 10 ) {
$errors->add( 'my_error_code', 'Too many cart items!' );
}
}
add_action( 'woocommerce_store_api_cart_errors', 'my_function_callback', 10 );
```
### Source
- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)
---
2023-02-24 12:08:34 +00:00
## woocommerce_store_api_cart_select_shipping_rate
2023-02-24 12:08:34 +00:00
Fires an action after a shipping method has been chosen for package(s) via the Store API.
```php
do_action( 'woocommerce_store_api_cart_select_shipping_rate', string|null $package_id, string $rate_id, \WP_REST_Request $request )
```
### Description
<p>This allows extensions to perform addition actions after a shipping method has been chosen, but before the cart totals are recalculated.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $package_id | string, null | The sanitized ID of the package being updated. Null if all packages are being updated. |
| $rate_id | string | The sanitized chosen rate ID for the package. |
| $request | \WP_REST_Request | Full details about the request. |
2023-02-24 12:08:34 +00:00
### Source
- [StoreApi/Routes/V1/CartSelectShippingRate.php](../../../../src/StoreApi/Routes/V1/CartSelectShippingRate.php)
2023-02-24 12:08:34 +00:00
---
## woocommerce_store_api_cart_update_customer_from_request
Fires when the Checkout Block/Store API updates a customer from the API request data.
```php
do_action( 'woocommerce_store_api_cart_update_customer_from_request', \WC_Customer $customer, \WP_REST_Request $request )
```
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $customer | \WC_Customer | Customer object. |
| $request | \WP_REST_Request | Full details about the request. |
### Source
- [StoreApi/Routes/V1/CartUpdateCustomer.php](../../../../src/StoreApi/Routes/V1/CartUpdateCustomer.php)
---
## woocommerce_store_api_cart_update_order_from_request
Fires when the order is synced with cart data from a cart route.
```php
do_action( 'woocommerce_store_api_cart_update_order_from_request', \WC_Order $draft_order, \WC_Customer $customer, \WP_REST_Request $request )
```
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $draft_order | \WC_Order | Order object. |
| $customer | \WC_Customer | Customer object. |
| $request | \WP_REST_Request | Full details about the request. |
### Source
- [StoreApi/Routes/V1/AbstractCartRoute.php](../../../../src/StoreApi/Routes/V1/AbstractCartRoute.php)
---
## woocommerce_store_api_checkout_order_processed
Fires before an order is processed by the Checkout Block/Store API.
```php
do_action( 'woocommerce_store_api_checkout_order_processed', \WC_Order $order )
```
### Description
<p>This hook informs extensions that $order has completed processing and is ready for payment.</p> <p>This is similar to existing core hook woocommerce_checkout_order_processed. We're using a new action:</p> <ul> <li>To keep the interface focused (only pass $order, not passing request data).</li> <li>This also explicitly indicates these orders are from checkout block/StoreAPI.</li> </ul>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $order | \WC_Order | Order object. |
### Example
# Checkout Order Processed
```php
// The action callback function.
function my_function_callback( $order ) {
// Do something with the $order object.
$order->save();
}
add_action( 'woocommerce_blocks_checkout_order_processed', 'my_function_callback', 10 );
```
### See
- https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3238
### Source
- [StoreApi/Routes/V1/CheckoutOrder.php](../../../../src/StoreApi/Routes/V1/CheckoutOrder.php)
- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php)
---
## woocommerce_store_api_checkout_update_customer_from_request
Fires when the Checkout Block/Store API updates a customer from the API request data.
```php
do_action( 'woocommerce_store_api_checkout_update_customer_from_request', \WC_Customer $customer, \WP_REST_Request $request )
```
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $customer | \WC_Customer | Customer object. |
| $request | \WP_REST_Request | Full details about the request. |
### Source
- [StoreApi/Routes/V1/CheckoutOrder.php](../../../../src/StoreApi/Routes/V1/CheckoutOrder.php)
- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php)
---
## woocommerce_store_api_checkout_update_order_meta
Fires when the Checkout Block/Store API updates an order's meta data.
```php
do_action( 'woocommerce_store_api_checkout_update_order_meta', \WC_Order $order )
```
### Description
<p>This hook gives extensions the chance to add or update meta data on the $order. Throwing an exception from a callback attached to this action will make the Checkout Block render in a warning state, effectively preventing checkout.</p> <p>This is similar to existing core hook woocommerce_checkout_update_order_meta. We're using a new action:</p> <ul> <li>To keep the interface focused (only pass $order, not passing request data).</li> <li>This also explicitly indicates these orders are from checkout block/StoreAPI.</li> </ul>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $order | \WC_Order | Order object. |
### See
- https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686
### Source
- [StoreApi/Routes/V1/Checkout.php](../../../../src/StoreApi/Routes/V1/Checkout.php)
---
## woocommerce_store_api_rate_limit_exceeded
2023-02-24 12:08:34 +00:00
Fires when the rate limit is exceeded.
```php
2023-02-24 12:08:34 +00:00
do_action( 'woocommerce_store_api_rate_limit_exceeded', string $ip_address )
```
2023-02-24 12:08:34 +00:00
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
2023-02-24 12:08:34 +00:00
| $ip_address | string | The IP address of the request. |
### Source
- [StoreApi/Authentication.php](../../../../src/StoreApi/Authentication.php)
---
## woocommerce_store_api_validate_add_to_cart
Fires during validation when adding an item to the cart via the Store API.
```php
do_action( 'woocommerce_store_api_validate_add_to_cart', \WC_Product $product, array $request )
```
### Description
<p>Fire action to validate add to cart. Functions hooking into this should throw an \Exception to prevent add to cart from happening.</p>
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $product | \WC_Product | Product object being added to the cart. |
| $request | array | Add to cart request params including id, quantity, and variation attributes. |
### Source
- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)
---
## woocommerce_store_api_validate_cart_item
Fire action to validate add to cart. Functions hooking into this should throw an \Exception to prevent add to cart from occurring.
```php
do_action( 'woocommerce_store_api_validate_cart_item', \WC_Product $product, array $cart_item )
```
### Parameters
| Argument | Type | Description |
| -------- | ---- | ----------- |
| $product | \WC_Product | Product object being added to the cart. |
| $cart_item | array | Cart item array. |
### Source
- [StoreApi/Utilities/CartController.php](../../../../src/StoreApi/Utilities/CartController.php)
2023-02-24 12:08:34 +00:00
---
## woocommerce_{$product->get_type()}_add_to_cart
2023-02-24 12:08:34 +00:00
Trigger the single product add to cart action for each product type.
```php
do_action( 'woocommerce_{$product->get_type()}_add_to_cart' )
```
### Source
- [BlockTypes/AddToCartForm.php](../../../../src/BlockTypes/AddToCartForm.php)
2023-02-24 12:08:34 +00:00
---
## {$hook}
2023-02-24 12:08:34 +00:00
Action to render the content of a hook.
```php
do_action( '{$hook}' )
```
### Source
- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php)
Add Cart/Checkout/Order-Received Templates (https://github.com/woocommerce/woocommerce-blocks/pull/9301) * WIP: dirty attempt to dry run Cart & Checkout templates * Added Cart and Checkout to the template hierarchies * Merge branch 'trunk' into poc/cart_and_checkout_fse_templates * Updated cart & Checkout templates * Order Received FSE template (https://github.com/woocommerce/woocommerce-blocks/pull/8937) * Order Received template bootstrap * typo * WIP: new block * add logic here * Order received classic template * reverted constants.ts * Added the post title (buggy) * Corrected page title * Updated constants.ts * Fixed template typo * removed placeholder for order received block * add order-received template description * updated placeholder description * Formatting fixes * Template description. * replaced hardcoded string with OrderReceivedTemplate::SLUG --------- Co-authored-by: Luigi <gigitux@gmail.com> * Code formatting (https://github.com/woocommerce/woocommerce-blocks/pull/8350) * Code formatting * page_template_hierarchy priority to 1 (https://github.com/woocommerce/woocommerce-blocks/pull/9323) Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> * Migrate Cart and Checkout Pages to the Template Editor when using a FSE theme (https://github.com/woocommerce/woocommerce-blocks/pull/9339) * Introduce woocommerce_blocks_template_content hook * Migrate cart and checkout page content to the template editor * Add redirection from edit page to edit template --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> * Removed header and footer from checkout template. (https://github.com/woocommerce/woocommerce-blocks/pull/9378) * Removed header and footer from checkout template. * Removed header and footer from checkout template migration * Permalink solution for the checkout endpoint/template (https://github.com/woocommerce/woocommerce-blocks/pull/9406) * Checkout endpoint work * Move setting field to util * Include link to edit the template * Remove todo * Refactor checkout templates to share logic (https://github.com/woocommerce/woocommerce-blocks/pull/9411) * Sync endpoints with pages (https://github.com/woocommerce/woocommerce-blocks/pull/9426) * Switch to page syncing * Update settings descriptions --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> * Migrate pages to templates once (https://github.com/woocommerce/woocommerce-blocks/pull/9488) * Migrate content on init, once * Skip migration if page does not exist * Put back HTML for header and footer parts * Fix page redirect due to wrong ID * fix loading template part * Removed unnecessary var * update cart and checkout html templates --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> * Include a notice to redirect user to template editor (https://github.com/woocommerce/woocommerce-blocks/pull/9508) * Template Placeholder Design for the Order Received Template (https://github.com/woocommerce/woocommerce-blocks/pull/9602) * Load frontend styles in editor iframe * Update placeholder to include skeleton and updated icons * Update classic template configs * 1px border for .wp-block-woocommerce-classic-template__placeholder-copy * Show copy on focus * Sample data --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> * Add simplified header on checkout template (https://github.com/woocommerce/woocommerce-blocks/pull/9607) * Added simplified header on checkout template * Moved simplified header to template part * updated constants.ts * added template part to checkout.html * Add missing translation * frontpage_template_hierarchy no longer needed * Allow plugin based template parts (https://github.com/woocommerce/woocommerce-blocks/pull/9667) * Merge branch 'trunk' into add/9288_cart-checkout-order-received_fse_templates * Synced templates on blockified folder * Add blockified order-received.html * removed WooCommerce prefix * Refactor/rebrand order received template to order confirmation (https://github.com/woocommerce/woocommerce-blocks/pull/9734) * rebrand order received to order confirmation * updated descriptions for templates * updated descriptions for order confirmation placeholder * Resolve merge conflict * Resolve merge conflicts * Resolve more merge conflicts after rebase * Fix formatting * Use patterns for localisation (https://github.com/woocommerce/woocommerce-blocks/pull/9883) * e2e tests for cart and checkout templates (https://github.com/woocommerce/woocommerce-blocks/pull/9939) * Merge branch 'trunk' into poc/cart_and_checkout_fse_templates * Merge branch 'trunk' into add/9288_cart-checkout-order-received_fse_templates * Resolve merge conflicts * Add e2e for permalink settings * Test that templates exist * Add test to check that templates can be edited * Add tests to confirm templates can be edited * Ensure cart has contents before running tests on frontend views * Commend out problem test * Make sure search has multiple results * Remove useThrottle - bad rebase * Revert changes to docs after rebase * Revert function call for noReviewsPlaceholder * Bad rebase * Reverts * Remove revertTemplate * Spacing * Wait for networkidle after navigation * Always wait for network * Use button roles in site editor * More specific button locator * Update option comparison * Fix template content * Disable failing tests * Disable failing classic template tests * Use enterEditMode * More enterEditMode usage * enterEditMode * Use test.skip * More robust selectors * Alt iframe selector --------- Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com> * Skip flakey test --------- Co-authored-by: Luigi <gigitux@gmail.com> Co-authored-by: Mike Jolley <mike.jolley@me.com>
2023-06-29 13:41:22 +00:00
---
<!-- FEEDBACK -->
---
[Docs] Update links from WooCommerce.com to Woo.com for the Woo Blocks documentation (#43055) * Update woocommerce.com URLs in documentation and code files * Add changelog * Fix github repository link in extend-rest-api-add-custom-fields.md Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> * Add github reporter (#42974) * Add github reporter * Add changelog --------- Co-authored-by: Jon Lane <jon.lane@automattic.com> * Fix product task redirect to support grouped and external products (#43051) * Rearrange product redirection logic to better accept grouped and external produc types * Add changelog * Modify feedback modal actions (#43005) * Adapt feedback modal actions * Add changelogs * Modify comments * Fix tests * Fix test * Update class-wc-gateway-bacs.php (#43054) * Update class-wc-gateway-bacs.php Fix typo in textdomain * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> * [Product Block Editor]: Add `Linked product` tab (#43009) * add linked-products to group IDs * add Linked Products tab * tweak hideConditions condition * changelog * fix typo in doc comment * Introduce a product type selection within the new experience (#41823) * Create a relation between the product type and the product block template * Add 'patterns' to name the kind of products that can be created for a specific template * Resolve template using its id as a template query param * Rename ProductEditPattern to ProductTemplate * Rename get_patterns hook to woocommerce_product_editor_get_product_templates * Return the list of templates to the client * Set layout template events as array * Register the layout template based on the product template or the post type in case of product variations * Registering non supported product types * Create and register the woocommerce/product-details-section-description block * Add the product type to the section description * Create product type selector * Fix menu item style * Highlight selected menu item * Set the selected product template * Set product template title to lowercase in the content description * Rename blocks by blockTemplates under the AbstractBlockTemplate class * Rename to woocommerce_product_editor_product_templates filter * Remove product_template_ prefix from the supported_product_types map * Rename get_formatted to to_JSON and convert the props to client side like * Refactor get_product_templates * Fix icon resolution * Add a confirmation modal for unsupported product templates * Add changelog files * Remove product types using for testing * Fix redirection when changing to a non supported product template * Set the change button state to busy when it is saving the product * Fix php linter errors * Fix rebase conflict * Move ProductTemplate to Automattic\WooCommerce\Admin\Features\ProductBlockEditor namespace * Add the to_json definition to the BlockTemplateInterface * Create default product template by custom product type if it does not have a template associated yet * Fix some comments and product template creation validation * Add support to load the product template icon from an external resource * Fix php linter * Fix the changelog description * [Experimental] Interactivity Dropdown multi-select mode, ratings filter and introduce each directive (#42981) --------- Co-authored-by: David Arenas <david.arenas@automattic.com> * Introduce the transient files engine (#42877) Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com> * Change marketplace install API request to POST instead of GET (#43033) * Change marketplace install API to using POST instead of GET * Fix linting error * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> * Prep trunk for 8.6 cycle (#43021) Prep trunk for 8.6 cycle with version bump to 8.6.0-dev Co-authored-by: WooCommerce Bot <no-reply@woo.com> * Add Playwright tests for All Reviews, Reviews by Product and Reviews by Category blocks (#42903) * Remove Reviews blocks Puppeteer tests * Minor code cleanup * Typos * Create publishAndVisitPost() editor util * Fix subcategories when importing products in Playwright and add reviews * Add Reviews blocks tests in Playwright * More typos * Add changefile(s) from automation for the following project(s): woocommerce-blocks * Create a 'reviews' object in data.ts so we can store reviews data in one single place * Update test so instead of creating a new post in each test, we go to the already-created post * Add source comments to reviews data to match it with the script --------- Co-authored-by: github-actions <github-actions@github.com> * Release: Remove 8.5 change files (#43022) Delete changelog files from 8.5 release Co-authored-by: WooCommerce Bot <no-reply@woo.com> Co-authored-by: Alex López <alex.lopez@automattic.com> * Delete changelog files based on PR 43033 (#43079) Delete changelog files for 43033 Co-authored-by: WooCommerce Bot <no-reply@woo.com> * Delete changelog files based on PR 43051 (#43081) Delete changelog files for 43051 Co-authored-by: WooCommerce Bot <no-reply@woo.com> * Interactive Price Filter: use `context` instead of `state` (#42980) * feat: use context instead of state * fix: temporary move the context to inner element for diffing to work * fix: update context before navigation for optimistic UI * Load google analytics gtag script asynchronously in WooCommerce Blocks (#43040) Co-authored-by: github-actions <github-actions@github.com> * set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build (#43074) * set WOOCOMMERCE_BLOCKS_PHASE to 1 for the production build * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> * Revert "Fix schedule sales error" (#43094) Revert "Fix schedule sales error (#42700)" This reverts commit 9b800aa179b25bafebfed0da8c00eec892272cb4. * [Product Block Editor]: add Linked product sections. First approach. (#43013) * add Linked products, Upsell section * changelog * add Cross-lens section * add links to the Upsell sections * changelog * fix lint issues * fix lint issus * fix linting issue :-| * check whether the linked product group is defined * [Product Block Editor]: introduce ShoppingBags component (#43042) * add ShoppingBags component * Add ShoppingBag story * changelog * Fix: Collection data being leaked between Collection Filters blocks (#43044) * fix: CYS - change heading color (#43076) * fix: CYS - change heading color * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com> * Delete changelog files based on PR 43074 (#43118) Delete changelog files for 43074 Co-authored-by: WooCommerce Bot <no-reply@woo.com> * [Product Block Editor]: fix feature flag to hide the Linked products (#43119) * fix flag to hide/show product editor * changelog * Add changelog --------- Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com> Co-authored-by: Jonathan Lane <lanej0@users.noreply.github.com> Co-authored-by: Jon Lane <jon.lane@automattic.com> Co-authored-by: louwie17 <lourensschep@gmail.com> Co-authored-by: Fernando Marichal <fernando.marichal@automattic.com> Co-authored-by: Marc Guay <marc.guay@gmail.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Damián Suárez <rdsuarez@gmail.com> Co-authored-by: Maikel David Pérez Gómez <maikel.perez@automattic.com> Co-authored-by: Sam Seay <samueljseay@gmail.com> Co-authored-by: Néstor Soriano <konamiman@konamiman.com> Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com> Co-authored-by: Kyle Nel <22053773+kdevnel@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: WooCommerce Bot <no-reply@woo.com> Co-authored-by: Alex López <alex.lopez@automattic.com> Co-authored-by: Tung Du <dinhtungdu@gmail.com> Co-authored-by: Thomas Roberts <5656702+opr@users.noreply.github.com> Co-authored-by: Luigi Teschio <gigitux@gmail.com> Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
2023-12-29 15:28:11 +00:00
[We're hiring!](https://woo.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/hooks/actions.md)
<!-- /FEEDBACK -->