4efd2123a3
* 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
|
||
---|---|---|
.. | ||
README.md | ||
cart.md | ||
checkout.md | ||
collections.md | ||
payment.md | ||
query-state.md | ||
schema.md | ||
store-notices.md | ||
validation.md |
README.md
Data Store
This document provides an overview of the data stores registered with wp.data
for use by various blocks. Store keys are exported as constants on the wc.wcBlocksData
export (externally registered as @woocommerce/block-data
and enqueued via handle wc-blocks-data-store
). For any block using the store, it's recommended to import the store key rather than using the reference directly to ensure dependencies are extracted correctly. It is assumed readers have some familiarity with the wp.data
API. You can read more about that here.
Cart Store (wc/store/cart)
The Cart Store (wc/store/cart) is responsible for handling cart-related data and operations. To access this store using a constant, you can use:
const { CART_STORE_KEY } = window.wc.wcBlocksData;
Checkout Store (wc/store/checkout)
The Checkout Store (wc/store/checkout) manages the checkout process, ensuring a seamless experience for users. To access this store using a constant, you can use:
const { CHECKOUT_STORE_KEY } = window.wc.wcBlocksData;
Collections Store (wc/store/collections)
The Collections Store (wc/store/collections) holds data indexed by namespace, model name, and query string. To access this store using a constant, you can use:
const { COLLECTIONS_STORE_KEY } = window.wc.wcBlocksData;
Payment Store (wc/store/payment)
The Payment Store (wc/store/payment) deals with all payment-related data and transactions. To access this store using a constant, you can use:
const { PAYMENT_STORE_KEY } = window.wc.wcBlocksData;
Query-State Store (wc/store/query-state)
The Query-State Store (wc/store/query-state) holds arbitrary values indexed by context and key. It's often used for tracking the state of query objects for a given context. To access this store using a constant, you can use:
const { QUERY_STATE_STORE_KEY } = window.wc.wcBlocksData;
Schema Store (wc/store/schema)
The Schema Store (wc/store/schema) is primarily used for accessing routes and has more of an internal usage. To access this store using a constant, you can use:
const { SCHEMA_STORE_KEY } = window.wc.wcBlocksData;
Store Notices Store (wc/store/store-notices)
The Store Notices Store (wc/store/store-notices) is dedicated to handling various store notices and alerts. To access this store using a constant, you can use:
const { STORE_NOTICES_STORE_KEY } = window.wc.wcBlocksData;
Validation Store (wc/store/validation)
The Validation Store (wc/store/validation) holds data relating to validation errors, it is primarily used in the Cart and Checkout flows to ensure the Checkout doesn't continue while invalid data is present. To access this store using a constant, you can use:
const { VALIDATION_STORE_KEY } = window.wc.wcBlocksData;
We're hiring! Come work with us!
🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.