Merge branch 'trunk' into fix/45550-cache-orders-at-datastore-layer

This commit is contained in:
Michael Pretty 2024-09-09 19:29:07 -04:00 committed by GitHub
commit a7e3ed1f09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1998 changed files with 51696 additions and 89817 deletions

View File

@ -31,24 +31,25 @@
- team: vortex - team: vortex
"packages/js/components/**/*": "packages/js/components/**/*":
- team: mothra - team: woo-fse
- team: ghidorah - team: ghidorah
"packages/js/csv-export/**/*": "packages/js/csv-export/**/*":
- team: mothra - team: woo-fse
"packages/js/currency/**/*": "packages/js/currency/**/*":
- team: mothra - team: woo-fse
"packages/js/customer-effort-score/**/*": "packages/js/customer-effort-score/**/*":
- team: mothra - team: woo-fse
- team: ghidorah
"packages/js/data/**/*": "packages/js/data/**/*":
- team: mothra - team: woo-fse
- team: ghidorah - team: ghidorah
"packages/js/date/**/*": "packages/js/date/**/*":
- team: mothra - team: woo-fse
"packages/js/dependency-extraction-webpack-plugin/**/*": "packages/js/dependency-extraction-webpack-plugin/**/*":
- team: vortex - team: vortex
@ -57,26 +58,27 @@
- team: vortex - team: vortex
"packages/js/experimental/**/*": "packages/js/experimental/**/*":
- team: mothra - team: woo-fse
"packages/js/explat/**/*": "packages/js/explat/**/*":
- team: mothra - team: woo-fse
- team: ghidorah - team: ghidorah
"packages/js/navigation/**/*": "packages/js/navigation/**/*":
- team: mothra - team: woo-fse
"packages/js/number/**/*": "packages/js/number/**/*":
- team: mothra - team: woo-fse
"packages/js/onboarding/**/*": "packages/js/onboarding/**/*":
- team: ghidorah - team: ghidorah
"packages/js/product-editor/**/*": "packages/js/product-editor/**/*":
- team: mothra - team: woo-fse
"packages/js/tracks/**/*": "packages/js/tracks/**/*":
- team: mothra - team: woo-fse
- team: ghidorah
"plugins/woocommerce/**/*": "plugins/woocommerce/**/*":
- team: proton - team: proton
@ -89,7 +91,7 @@
- team: proton - team: proton
"plugins/woocommerce/src/Admin/**/*": "plugins/woocommerce/src/Admin/**/*":
- team: mothra - team: woo-fse
- team: ghidorah - team: ghidorah
"plugins/woocommerce/src/Blocks/**/*": "plugins/woocommerce/src/Blocks/**/*":
@ -97,7 +99,7 @@
- team: woo-fse - team: woo-fse
"plugins/woocommerce/src/Internal/Admin/**/*": "plugins/woocommerce/src/Internal/Admin/**/*":
- team: mothra - team: woo-fse
- team: ghidorah - team: ghidorah
"plugins/woocommerce/src/StoreApi/**/*": "plugins/woocommerce/src/StoreApi/**/*":
@ -105,7 +107,7 @@
- team: woo-fse - team: woo-fse
"plugins/woocommerce-admin/**/*": "plugins/woocommerce-admin/**/*":
- team: mothra - team: woo-fse
- team: ghidorah - team: ghidorah
"plugins/woocommerce-blocks/**/*": "plugins/woocommerce-blocks/**/*":

View File

@ -162,7 +162,7 @@ jobs:
else else
MESSAGE="${{ github.event_name }}" MESSAGE="${{ github.event_name }}"
fi fi
echo "BUILDKITE_ANALYTICS_MESSAGE=$MESSAGE" >> "$GITHUB_OUTPUT" echo "BUILDKITE_ANALYTICS_MESSAGE=$MESSAGE" >> "$GITHUB_ENV"
shell: bash shell: bash
- name: 'Resolve artifacts path' - name: 'Resolve artifacts path'

View File

@ -2,20 +2,30 @@
set -eo pipefail set -eo pipefail
function title() {
echo -e "\n\033[1m$1\033[0m"
}
if [[ -z "$GITHUB_EVENT_NAME" ]]; then if [[ -z "$GITHUB_EVENT_NAME" ]]; then
echo "::error::GITHUB_EVENT_NAME must be set" echo "::error::GITHUB_EVENT_NAME must be set"
exit 1 exit 1
fi fi
echo "Installing dependencies" title "Installing NVM"
pnpm install --filter="compare-perf" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash > /dev/null
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
echo "Installed version: $(nvm -v)"
title "Installing dependencies"
pnpm install --frozen-lockfile --filter="compare-perf" > /dev/null
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
echo "Comparing performance with trunk" title "Comparing performance with trunk"
pnpm --filter="compare-perf" run compare perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA pnpm --filter="compare-perf" run compare perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
echo "Comparing performance with base branch" title "Comparing performance with base branch"
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt) WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
# Updating the WP version used for performance jobs means theres a high # Updating the WP version used for performance jobs means theres a high
# chance that the reference commit used for performance test stability # chance that the reference commit used for performance test stability
@ -32,7 +42,7 @@ elif [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}" WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
pnpm --filter="compare-perf" run compare perf $GITHUB_SHA $BASE_SHA --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR" pnpm --filter="compare-perf" run compare perf $GITHUB_SHA $BASE_SHA --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
echo "Publish results to CodeVitals" title "Publish results to CodeVitals"
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI") COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
pnpm --filter="compare-perf" run log $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT pnpm --filter="compare-perf" run log $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT
else else

View File

@ -1,45 +1,51 @@
name: 'Process stale needs-feedback issues' name: 'Process stale needs-feedback issues'
on: on:
schedule: schedule:
- cron: '21 0 * * *' - cron: '21 0 * * *'
workflow_dispatch:
permissions: {} permissions: { }
jobs: jobs:
stale: stale:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions: permissions:
contents: read contents: read
issues: write issues: write
pull-requests: write pull-requests: write
steps: steps:
- name: Scan issues - name: Scan issues
uses: actions/stale@v9.0.0 uses: actions/stale@v9.0.0
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "As a part of this repository's maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.\n\n###### After 7 days with no activity this issue will be automatically be closed." stale-issue-message: "As a part of this repository's maintenance, this issue is being marked as stale due to inactivity. Please feel free to comment on it in case we missed something.\n\n###### After 7 days with no activity this issue will be automatically be closed."
close-issue-message: 'This issue was closed because it has been 14 days with no activity.' close-issue-message: 'This issue was closed because it has been 14 days with no activity.'
operations-per-run: 140 operations-per-run: 140
days-before-stale: -1 days-before-stale: -1
days-before-close: -1 days-before-close: -1
days-before-issue-stale: 7 days-before-issue-stale: 7
days-before-issue-close: 7 days-before-issue-close: 7
stale-issue-label: 'status: stale' stale-issue-label: 'status: stale'
stale-pr-label: 'status: stale' stale-pr-label: 'status: stale'
exempt-issue-labels: 'type: enhancement' exempt-issue-labels: 'type: enhancement'
only-issue-labels: 'needs: author feedback' only-issue-labels: 'needs: author feedback'
close-issue-label: "status: can't reproduce" close-issue-label: "status: can't reproduce"
ascending: true ascending: true
- name: Close Stale Flaky Test Issues - name: Process Stale Flaky Test Issues
uses: actions/stale@v9.0.0 uses: actions/stale@v9.0.0
with: with:
only-labels: 'metric: flaky e2e test, team: Vortex' repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 5 only-issue-labels: 'metric: flaky e2e test'
days-before-close: 2 days-before-stale: -1
stale-issue-label: 'metric: stale flaky e2e test report' days-before-close: -1
stale-issue-message: 'This test may have been a one-time failure. It will be auto-closed if no further activity occurs within the next 2 days.' days-before-issue-stale: 5
close-issue-message: 'Auto-closed due to inactivity. Please re-open if you believe this issue is still valid.' days-before-issue-close: 2
close-issue-reason: 'not_planned' stale-issue-label: 'status: stale'
remove-stale-when-updated: true stale-issue-message: 'This issue is being marked as stale due to inactivity. It will be auto-closed if no further activity occurs within the next 2 days.'
exempt-all-assignees: true close-issue-message: 'Auto-closed due to inactivity. Please re-open if you believe this issue is still valid.'
enable-statistics: true close-issue-reason: 'not_planned'
remove-stale-when-updated: true
exempt-all-assignees: false
enable-statistics: true
ascending: true
operations-per-run: 120

View File

@ -59,8 +59,8 @@ jobs:
<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}> <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>
*Labels:* ${{ join(github.event.pull_request.labels.*.name, ', ') }} *Labels:* ${{ join(github.event.pull_request.labels.*.name, ', ') }}
*Monthly Release Milestone:* <${{ github.event.pull_request.milestone.html_url }}|${{ github.event.pull_request.milestone.title }}> (Release Date: ${{ env.MILESTONE_DATE }}) *Monthly Release Milestone:* <${{ github.event.pull_request.milestone.html_url }}|${{ github.event.pull_request.milestone.title }}> (Release Date: ${{ env.MILESTONE_DATE }})
*WooAF (weekly) Timeline: this PR can be tested from:* ${{ env.TEST_DATE_MESSAGE }} Please check the Milestone above and test using the latest <https://github.com/woocommerce/woocommerce/releases|pre-release build>.
Please visit the <#${{ secrets.WOO_CORE_RELEASES_SLACK_CHANNEL }}> to obtain the latest WooAF build for testing. If a pre-release build for the stated Milestone does not exist, please use the Nightly build.
slack-optional-unfurl_links: false slack-optional-unfurl_links: false
slack-optional-unfurl_media: false slack-optional-unfurl_media: false

View File

@ -12,7 +12,7 @@
"dependencies": [ "dependencies": [
"pnpm" "pnpm"
], ],
"pinVersion": "^9.1.0", "pinVersion": "9.1.3",
"packages": [ "packages": [
"**" "**"
] ]
@ -88,7 +88,8 @@
"webpack*" "webpack*"
], ],
"packages": [ "packages": [
"@woocommerce/block-library" "@woocommerce/block-library",
"@woocommerce/storybook"
], ],
"isIgnored": true "isIgnored": true
}, },
@ -172,7 +173,7 @@
"packages": [ "packages": [
"**" "**"
], ],
"pinVersion": "^1.45.1" "pinVersion": "^1.46.1"
}, },
{ {
"dependencies": [ "dependencies": [
@ -199,7 +200,10 @@
"@wordpress/viewport", "@wordpress/viewport",
"@wordpress/interface", "@wordpress/interface",
"@wordpress/router", "@wordpress/router",
"@wordpress/edit-site" "@wordpress/edit-site",
"@wordpress/private-apis",
"@wordpress/dataviews",
"@wordpress/icons"
], ],
"packages": [ "packages": [
"@woocommerce/block-templates", "@woocommerce/block-templates",

View File

@ -4,7 +4,7 @@ This document aims to provide as much context as possible to aid in the developm
## Getting Started ## Getting Started
Please refer to [the Getting Started section of the `README.md`](README.md#getting-started) for a general-purpose guide on getting started. The rest of this document will assume that you've installed all of the prequisites and setup described there. Please refer to [the Getting Started section of the `README.md`](README.md#getting-started) for a general-purpose guide on getting started. The rest of this document will assume that you've installed all of the prerequisites and setup described there.
### Plugin, Package, and Tool Filtering ### Plugin, Package, and Tool Filtering

View File

@ -1,5 +1,351 @@
== Changelog == == Changelog ==
= 9.2.3 2024-08-26 =
**WooCommerce**
* Fix - Ensure translation is fully loaded for certain parts of Checkout block. [#50892](https://github.com/woocommerce/woocommerce/pull/50892)
= 9.2.2 2024-08-22 =
**WooCommerce**
* Fix - Revert PR#48731 to address possible issues with plugins using WC's bundled select2 package. [#50854](https://github.com/woocommerce/woocommerce/pull/50854)
* Fix - Partially revert PR#48709 as it could cause issues for some users of the REST API system_status endpoint. [#50881](https://github.com/woocommerce/woocommerce/pull/50881)
= 9.2.1 2024-08-21 =
**WooCommerce**
* Fix - Revert turning of AccessiblePrivateMethods::_accessible_private_methods into a static property because it caused fatal errors in some edge cases. [#50809](https://github.com/woocommerce/woocommerce/pull/50809)
= 9.2.0 2024-08-20 =
**WooCommerce**
* Update - Enhanced sanitization in `@woocommerce/currency`. [#50802](https://github.com/woocommerce/woocommerce/pull/50802)
* Fix - Hardening against XSS by leveraging HTML API for adding block attribute data. [#50801](https://github.com/woocommerce/woocommerce/pull/50801)
* Fix - Prevent downloads of digitial products after partial refund. [#50804](https://github.com/woocommerce/woocommerce/pull/50804)
* Add - Adds support for tracking downloads when a partial (ranged) request is made. [#50805](https://github.com/woocommerce/woocommerce/pull/50805)
* Update - Turn AccessiblePrivateMethods::_accessible_private_methods into a static property. [#50806](https://github.com/woocommerce/woocommerce/pull/50806)
* Fix - Correct label of shipping dimensions length field. [#50180](https://github.com/woocommerce/woocommerce/pull/50180)
* Fix - Allow new accounts to set new password even if logged in. [#50700](https://github.com/woocommerce/woocommerce/pull/50700)
* Fix - Remove global_unique_id from interface and add warning in case it is not implemented [#50685](https://github.com/woocommerce/woocommerce/pull/50685)
* Fix - CYS: avoid to enqueue Jetpack scripts [#50679](https://github.com/woocommerce/woocommerce/pull/50679)
* Fix - Clear product unique ID (`global_unique_id`) when duplicating products. [#50629](https://github.com/woocommerce/woocommerce/pull/50629)
* Fix - Resolved an issue that caused the page title and content text to display in the incorrect order on the Order Confirmation page. [#50592](https://github.com/woocommerce/woocommerce/pull/50592)
* Fix - Customer Account - Maintain the size of the icon in smaller screens. [#50410](https://github.com/woocommerce/woocommerce/pull/50410)
* Fix - Accessibility: Prevent shipping losing focus when making selections during checkout. [#48370](https://github.com/woocommerce/woocommerce/pull/48370)
* Fix - Add aria-label to mini-cart button on first render to improve accessibility [#48329](https://github.com/woocommerce/woocommerce/pull/48329)
* Fix - Add missing script dependencies to product variation generation script. [#49595](https://github.com/woocommerce/woocommerce/pull/49595)
* Fix - Address timing issue with React 18 when unregistering blocks and add missing dependency to editor bootstrapping code. [#49642](https://github.com/woocommerce/woocommerce/pull/49642)
* Fix - Add the "Customer account" block into the "Minimal Header" to fix the spacing. [#49893](https://github.com/woocommerce/woocommerce/pull/49893)
* Fix - Avoid Product Search Results block template to fall back to the Product Catalog template from the theme [#48887](https://github.com/woocommerce/woocommerce/pull/48887)
* Fix - Changed from using React.render to React.createRoot for product editor areas as it has been deprecated since React 18 [#48834](https://github.com/woocommerce/woocommerce/pull/48834)
* Fix - Check if parent product exists when creating attribute lookup data for variations [#49474](https://github.com/woocommerce/woocommerce/pull/49474)
* Fix - Check if there's an actual session available inside wc_clear_cart_after_payment [#45821](https://github.com/woocommerce/woocommerce/pull/45821)
* Fix - Comment: Update db_version variable and use it to prevent adding global_unique_id when the lookup table was not yet updated [#49472](https://github.com/woocommerce/woocommerce/pull/49472)
* Fix - Correctly escape the HTML when linking customer orders. [#49195](https://github.com/woocommerce/woocommerce/pull/49195)
* Fix - CSY - Fix intro banner copy for existing themes [#49787](https://github.com/woocommerce/woocommerce/pull/49787)
* Fix - CYS - Fix marking the CYS task as completed only by accessing the Intro page. [#49374](https://github.com/woocommerce/woocommerce/pull/49374)
* Fix - CYS - Remove the site title block length from the "Large Header" and the "Centered Menu Header". [#48671](https://github.com/woocommerce/woocommerce/pull/48671)
* Fix - CYS: Disable readonly mode only when full composability feature flag is enabled. [#48752](https://github.com/woocommerce/woocommerce/pull/48752)
* Fix - CYS: Ensure that the button in the Intro page redirects to the Customizer when a classic theme is enabled. [#49804](https://github.com/woocommerce/woocommerce/pull/49804)
* Fix - CYS: fix: Assembler follows admin color schema. [#49159](https://github.com/woocommerce/woocommerce/pull/49159)
* Fix - CYS: fix arrow welcome tour [#49607](https://github.com/woocommerce/woocommerce/pull/49607)
* Fix - CYS: Fix border width pattern preview. [#49753](https://github.com/woocommerce/woocommerce/pull/49753)
* Fix - CYS: Fix button background on Featured Category Cover image [#49659](https://github.com/woocommerce/woocommerce/pull/49659)
* Fix - CYS: fix drag to resize bar [#49657](https://github.com/woocommerce/woocommerce/pull/49657)
* Fix - CYS: fix flickering effect. [#48767](https://github.com/woocommerce/woocommerce/pull/48767)
* Fix - CYS: fix logic to disable click on the no block placeholder [#48722](https://github.com/woocommerce/woocommerce/pull/48722)
* Fix - CYS: Fix no block placeholder style. [#49673](https://github.com/woocommerce/woocommerce/pull/49673)
* Fix - CYS: Fix pattern rendering issues [#49041](https://github.com/woocommerce/woocommerce/pull/49041)
* Fix - CYS: fix pattern wrapped twice by group blocks [#48712](https://github.com/woocommerce/woocommerce/pull/48712)
* Fix - CYS: fix selected header/footer pattern [#49788](https://github.com/woocommerce/woocommerce/pull/49788)
* Fix - CYS: fix shuffle feature logic. [#49153](https://github.com/woocommerce/woocommerce/pull/49153)
* Fix - CYS: fix the default intro pattern. [#49082](https://github.com/woocommerce/woocommerce/pull/49082)
* Fix - CYS: Fix the tooltip overlap with the pattern. [#49700](https://github.com/woocommerce/woocommerce/pull/49700)
* Fix - CYS: fix toolbar position after the site preview resizes [#49028](https://github.com/woocommerce/woocommerce/pull/49028)
* Fix - CYS: hide button to resize the image [#48714](https://github.com/woocommerce/woocommerce/pull/48714)
* Fix - CYS: Hide shuffle button when only one pattern is available [#49790](https://github.com/woocommerce/woocommerce/pull/49790)
* Fix - CYS: not enable PTK features on WordPress 6.5. [#49591](https://github.com/woocommerce/woocommerce/pull/49591)
* Fix - CYS: open Intro panel when user clicks on Design your homepage [#49005](https://github.com/woocommerce/woocommerce/pull/49005)
* Fix - CYS: Remove not necessary placeholder on homepage sidebar. [#49705](https://github.com/woocommerce/woocommerce/pull/49705)
* Fix - CYS: show default TT4 fonts pair. [#49675](https://github.com/woocommerce/woocommerce/pull/49675)
* Fix - CYS: show logo when the header is updated. [#49681](https://github.com/woocommerce/woocommerce/pull/49681)
* Fix - Display "View store" button text by default in the toolbar. [#48690](https://github.com/woocommerce/woocommerce/pull/48690)
* Fix - Display admin notice of expired and expiring Woo subscription when the product
is connected / activated on the site. [#49717](https://github.com/woocommerce/woocommerce/pull/49717)
* Fix - Do not set the `tk_ai` tracking cookie if tracking is disabled. [#47863](https://github.com/woocommerce/woocommerce/pull/47863)
* Fix - Ensure the second address line input appears when using autofill [#49730](https://github.com/woocommerce/woocommerce/pull/49730)
* Fix - Ensure the Store API recalculates cart totals prior to running validation hooks. [#49455](https://github.com/woocommerce/woocommerce/pull/49455)
* Fix - Exclude simple products from variations reports by default. [#49244](https://github.com/woocommerce/woocommerce/pull/49244)
* Fix - Failure to fetch the country list no longer blocks users in the profiler. [#49519](https://github.com/woocommerce/woocommerce/pull/49519)
* Fix - Fetch site cache status correctly if directly navigating to LYS Success page, and some refactoring [#48710](https://github.com/woocommerce/woocommerce/pull/48710)
* Fix - Fix: Make woocommerce/product-price available in the Single Product template [#49906](https://github.com/woocommerce/woocommerce/pull/49906)
* Fix - Fix a bug where woocommerce removes the current-menu-item class. [#45095](https://github.com/woocommerce/woocommerce/pull/45095)
* Fix - Fix add product task to create template first and simplify logic [#49631](https://github.com/woocommerce/woocommerce/pull/49631)
* Fix - Fix add zone button flinching and vertical centering [#48869](https://github.com/woocommerce/woocommerce/pull/48869)
* Fix - Fix Analytics - Tax Report Pagination [#49562](https://github.com/woocommerce/woocommerce/pull/49562)
* Fix - Fix confusing messages prompting switch to classic templates [#48717](https://github.com/woocommerce/woocommerce/pull/48717)
* Fix - Fix default shipping selection when changing between pickup and shipping on block checkout. [#49718](https://github.com/woocommerce/woocommerce/pull/49718)
* Fix - Fixed "woocommerce_new_order" triggering on checkout blocks page visit. [#47422](https://github.com/woocommerce/woocommerce/pull/47422)
* Fix - Fixed a bug causing account email not to be taken in consideration for coupon validation when a customer has a different billing email set. [#48488](https://github.com/woocommerce/woocommerce/pull/48488)
* Fix - Fixed a bug that would cause incorrect pricing at checkout for very large amounts. [#49361](https://github.com/woocommerce/woocommerce/pull/49361)
* Fix - Fixed a bug where the close button is not visible on the mini cart when viewed on a mobile device [#48769](https://github.com/woocommerce/woocommerce/pull/48769)
* Fix - Fixed horizontal and vertical layout overflows on LYS success page [#49127](https://github.com/woocommerce/woocommerce/pull/49127)
* Fix - Fix fatal error in order reports when parent order doesn't exist [#49006](https://github.com/woocommerce/woocommerce/pull/49006)
* Fix - Fix get_options deprecated notice when viewing Analytics > Orders [#49092](https://github.com/woocommerce/woocommerce/pull/49092)
* Fix - Fix Order Count inconsistency between stats and reports [#49283](https://github.com/woocommerce/woocommerce/pull/49283)
* Fix - Fix sidebar attribute control in Products by Attribute block [#49351](https://github.com/woocommerce/woocommerce/pull/49351)
* Fix - Fix site coming soon page heading color [#49129](https://github.com/woocommerce/woocommerce/pull/49129)
* Fix - Fix Task List - Reminder bar close button styling [#49532](https://github.com/woocommerce/woocommerce/pull/49532)
* Fix - Fix the mini cart items not being visible when zoomed in [#48384](https://github.com/woocommerce/woocommerce/pull/48384)
* Fix - Fix the namespace of the RestApiControllerBase class [#49333](https://github.com/woocommerce/woocommerce/pull/49333)
* Fix - Fix the undefined array key "name" warning in ComingSoonRequestHandler.php when the font name is not set [#49795](https://github.com/woocommerce/woocommerce/pull/49795)
* Fix - Fix variation name in analytics variations report [#49440](https://github.com/woocommerce/woocommerce/pull/49440)
* Fix - Issue fixed where tags are overlapping divider line in "Filter by product category". [#48756](https://github.com/woocommerce/woocommerce/pull/48756)
* Fix - Made coupon fields during block checkout stack on smaller screen sizes [#48623](https://github.com/woocommerce/woocommerce/pull/48623)
* Fix - Make sure the correct block template file is used in the Site Editor for templates with fallback [#48621](https://github.com/woocommerce/woocommerce/pull/48621)
* Fix - Make the edit/delete actions of shipping/products in manual orders accessible [#48238](https://github.com/woocommerce/woocommerce/pull/48238)
* Fix - Make the Leaderboards on the Analytics > Dashboard page use consistent currency and number formatting across the page, and perceive the currency setting comes from the relevant filter. [#49097](https://github.com/woocommerce/woocommerce/pull/49097)
* Fix - Narrowed scope of block theme notice templates so other template overrides are unaffected [#48686](https://github.com/woocommerce/woocommerce/pull/48686)
* Fix - Prevent a warning showing when using the Shipping Address Calculator in combination with the additional checkout fields API [#49685](https://github.com/woocommerce/woocommerce/pull/49685)
* Fix - Prevent download permissions metabox from being toggled when toggling individual permission details. [#49022](https://github.com/woocommerce/woocommerce/pull/49022)
* Fix - Prevent possible type error in BatchProcessingController. [#49728](https://github.com/woocommerce/woocommerce/pull/49728)
* Fix - Prevent product editor styles loading on non wc-admin pages [#49170](https://github.com/woocommerce/woocommerce/pull/49170)
* Fix - Product Collection: allow custom collections to hide all of the filter controls, not only some of them [#49713](https://github.com/woocommerce/woocommerce/pull/49713)
* Fix - Product Collection: Fix alignment of the first item in Grid layout for WP 6.6 [#49096](https://github.com/woocommerce/woocommerce/pull/49096)
* Fix - Product Collection: Fix the Preview badge's corner radius [#48856](https://github.com/woocommerce/woocommerce/pull/48856)
* Fix - Product Collection: Show "Sync with current query" option only in archive templates where it makes sense [#48917](https://github.com/woocommerce/woocommerce/pull/48917)
* Fix - Product Fitlers: Bring back pattern [#49601](https://github.com/woocommerce/woocommerce/pull/49601)
* Fix - Product rating - Inherit the color of the star when no ratings [#49678](https://github.com/woocommerce/woocommerce/pull/49678)
* Fix - Provide more informative errors if a refund cannot be requested via the REST API, due to plugin conflicts. [#47918](https://github.com/woocommerce/woocommerce/pull/47918)
* Fix - Redirect the lost password page to edit account while logged in. [#49670](https://github.com/woocommerce/woocommerce/pull/49670)
* Fix - Removes several side effects in the code bases that caused translations to be loaded too early. [#47113](https://github.com/woocommerce/woocommerce/pull/47113)
* Fix - Remove strong tags from patterns [#49901](https://github.com/woocommerce/woocommerce/pull/49901)
* Fix - Replace the red CSS color with the $red SASS variable in WooCommerce legacy elements [#48742](https://github.com/woocommerce/woocommerce/pull/48742)
* Fix - Resolved issues with new order hook triggers during transitions to and from draft statuses. [#49098](https://github.com/woocommerce/woocommerce/pull/49098)
* Fix - Set coming soon preview body aspect ratio to 1/1 to fix broken template [#49749](https://github.com/woocommerce/woocommerce/pull/49749)
* Fix - Show variations only for the selected product's variations [#49470](https://github.com/woocommerce/woocommerce/pull/49470)
* Fix - Tooltips message is now selected based on the order status instead of the label of the order status, which would break if the current WordPress language was not English. Also passes the order object to the woocommerce_get_order_status_labels filter to allow for more personalized tooltips. [#49812](https://github.com/woocommerce/woocommerce/pull/49812)
* Fix - Update allowed statuses in legacy payment handler for checkout block. [#48788](https://github.com/woocommerce/woocommerce/pull/48788)
* Add - Use UTM parameters to link Tracks events from connect notice CTA and successful site connection [#50126](https://github.com/woocommerce/woocommerce/pull/50126)
* Add - Add a generic function to determine remote logging eligibility [#49371](https://github.com/woocommerce/woocommerce/pull/49371)
* Add - Add a rest api to manage the product custom fields [#48504](https://github.com/woocommerce/woocommerce/pull/48504)
* Add - Add column `global_unique_id` to `wc_product_meta_lookup` table
Add global_unique_id field to product and product variations [#49472](https://github.com/woocommerce/woocommerce/pull/49472)
* Add - Added notice to the order confirmation page for new accounts instructing them to change the default password. [#48673](https://github.com/woocommerce/woocommerce/pull/48673)
* Add - Add global unique ID field to the classic product editor [#49312](https://github.com/woocommerce/woocommerce/pull/49312)
* Add - Add placeholder options and validation to checkout country and state select inputs. [#49616](https://github.com/woocommerce/woocommerce/pull/49616)
* Add - Add Refresh Remote Inbox Notifications and Delete Remote Notification Tools [#48961](https://github.com/woocommerce/woocommerce/pull/48961)
* Add - Add some robots.txt rules about directories created by WooCommerce [#49432](https://github.com/woocommerce/woocommerce/pull/49432)
* Add - Adds product usage notice [#47697](https://github.com/woocommerce/woocommerce/pull/47697)
* Add - Add support to run e2e tests against WPCOM website. [#49403](https://github.com/woocommerce/woocommerce/pull/49403)
* Add - Add UTM parameters to missing payment method notice links. [#49621](https://github.com/woocommerce/woocommerce/pull/49621)
* Add - Add validation for `__experimentalRegisterProductCollection` arguments [#48141](https://github.com/woocommerce/woocommerce/pull/48141)
* Add - CYS: add badge that informs how many patterns have been inserted from each category. [#48668](https://github.com/woocommerce/woocommerce/pull/48668)
* Add - CYS: Add default patterns. [#48839](https://github.com/woocommerce/woocommerce/pull/48839)
* Add - CYS: Add Tracking for Fiverr Logo Maker CTA [#49783](https://github.com/woocommerce/woocommerce/pull/49783)
* Add - CYS: Enable the PTK feature. [#49565](https://github.com/woocommerce/woocommerce/pull/49565)
* Add - Expose __experimentalRegisterProductCollection in @woocommerce/blocks-registry Package [#48141](https://github.com/woocommerce/woocommerce/pull/48141)
* Add - Improvements in the handling of feature compatibility for plugins [#48169](https://github.com/woocommerce/woocommerce/pull/48169)
* Add - Product Collection: Rename "Sync with current query" option to "Use page context" and make it working in non-archive context as well [#49627](https://github.com/woocommerce/woocommerce/pull/49627)
* Update - Add pattern validation for global_unique_id [#50501](https://github.com/woocommerce/woocommerce/pull/50501)
* Update - Clear global_unique_id when restoring a product that doesn't have an unique id [#50496](https://github.com/woocommerce/woocommerce/pull/50496)
* Update - Use admin password reset on admin login screen [#50200](https://github.com/woocommerce/woocommerce/pull/50200)
* Update - Prevent creation of password-protected coupons. [#50236](https://github.com/woocommerce/woocommerce/pull/50236)
* Update - Add a link to the Theming docs from the blockified templates README.md file [#48538](https://github.com/woocommerce/woocommerce/pull/48538)
* Update - Add a new icon style to the "Customer Account" block. [#48979](https://github.com/woocommerce/woocommerce/pull/48979)
* Update - Adds setting to control the visibility of product count in Mini cart block [#48545](https://github.com/woocommerce/woocommerce/pull/48545)
* Update - Add tracking for enable auto renew links on notices [#49710](https://github.com/woocommerce/woocommerce/pull/49710)
* Update - Add UTM parameters to subscription renewal notice links. [#49645](https://github.com/woocommerce/woocommerce/pull/49645)
* Update - Adjust input field height and input label text size. [#49636](https://github.com/woocommerce/woocommerce/pull/49636)
* Update - Adjust top margin of the coupon code in the Cart and Checkout blocks. [#49603](https://github.com/woocommerce/woocommerce/pull/49603)
* Update - CYS - Add borders to footer and header patterns on the assembler. [#49299](https://github.com/woocommerce/woocommerce/pull/49299)
* Update - CYS - Add missing patterns to their categories for the assembler [#49154](https://github.com/woocommerce/woocommerce/pull/49154)
* Update - CYS - Add tracking events to pattern features. [#49556](https://github.com/woocommerce/woocommerce/pull/49556)
* Update - CYS - Disable the Full Composability for CYS AI flows [#49290](https://github.com/woocommerce/woocommerce/pull/49290)
* Update - CYS - Fetch patterns from the private dotcom patterns category instead of from the default source site. [#49007](https://github.com/woocommerce/woocommerce/pull/49007)
* Update - CYS - Fetch patterns from the WooCommerce PTK source site. [#48492](https://github.com/woocommerce/woocommerce/pull/48492)
* Update - CYS - Filter out patterns with external dependencies. [#48618](https://github.com/woocommerce/woocommerce/pull/48618)
* Update - CYS - Fix CSS spacing issues in the assembler. [#49232](https://github.com/woocommerce/woocommerce/pull/49232)
* Update - CYS - Fix dark patterns buttons color. [#49181](https://github.com/woocommerce/woocommerce/pull/49181)
* Update - CYS - Fix the column spacing for the "Four Image Grid Content Left" pattern [#49669](https://github.com/woocommerce/woocommerce/pull/49669)
* Update - CYS - Fix the font size of the "DON'T HAVE A LOGO YET?" title. [#49231](https://github.com/woocommerce/woocommerce/pull/49231)
* Update - CYS - Fix the intro cards size to match the designs. [#49297](https://github.com/woocommerce/woocommerce/pull/49297)
* Update - CYS - Fix the pattern preview border color on hover and for inserted patterns. [#49206](https://github.com/woocommerce/woocommerce/pull/49206)
* Update - CYS - Improve margins for CYS core patterns. [#49196](https://github.com/woocommerce/woocommerce/pull/49196)
* Update - CYS - Improve the designs of the Intro page bottom cards. [#48983](https://github.com/woocommerce/woocommerce/pull/48983)
* Update - CYS - Include the dotcom patterns from the "Reviews" category. [#49140](https://github.com/woocommerce/woocommerce/pull/49140)
* Update - CYS - Make some titles bold on CYS patterns. [#49151](https://github.com/woocommerce/woocommerce/pull/49151)
* Update - CYS - Make the patterns content translatable for patterns in the dictionary. [#49633](https://github.com/woocommerce/woocommerce/pull/49633)
* Update - CYS - Register PTK "Testimonials" patterns as "Reviews" [#48674](https://github.com/woocommerce/woocommerce/pull/48674)
* Update - CYS - Remove non-default patterns and register them from the PTK. Update margins. [#49101](https://github.com/woocommerce/woocommerce/pull/49101)
* Update - CYS - Schedule the `fetch_patterns` actions only once every hour. [#49754](https://github.com/woocommerce/woocommerce/pull/49754)
* Update - CYS - Update pattern categories and its descriptions. [#48665](https://github.com/woocommerce/woocommerce/pull/48665)
* Update - CYS - Update pattern toolbar delete button copy to `Delete`. [#49295](https://github.com/woocommerce/woocommerce/pull/49295)
* Update - CYS - Update the full composability layout styles [#49303](https://github.com/woocommerce/woocommerce/pull/49303)
* Update - CYS - Update the intro pages for different type of themes. [#49910](https://github.com/woocommerce/woocommerce/pull/49910)
* Update - CYS: Add the proper tracking string to the external Fiverr link in sidebar of the **Add your logo** screen. [#49745](https://github.com/woocommerce/woocommerce/pull/49745)
* Update - CYS: Add `rel="noreferrer"` to External Fiverr Link in sidebar of **Add your logo** screen. [#49314](https://github.com/woocommerce/woocommerce/pull/49314)
* Update - CYS: Improve Block Toolbar logic. [#48799](https://github.com/woocommerce/woocommerce/pull/48799)
* Update - CYS: improve copy no blocks placeholder. [#49030](https://github.com/woocommerce/woocommerce/pull/49030)
* Update - CYS: Improve patterns order [#49204](https://github.com/woocommerce/woocommerce/pull/49204)
* Update - CYS: no highlight the pattern when it is added. [#48802](https://github.com/woocommerce/woocommerce/pull/48802)
* Update - CYS: Remove margin last pattern preview [#49767](https://github.com/woocommerce/woocommerce/pull/49767)
* Update - CYS: Remove not necessary patterns. [#48750](https://github.com/woocommerce/woocommerce/pull/48750)
* Update - CYS: Revisit sidebar layout. [#48803](https://github.com/woocommerce/woocommerce/pull/48803)
* Update - CYS: Update Block Toolbar Position [#48662](https://github.com/woocommerce/woocommerce/pull/48662)
* Update - CYS: Update icon used by the "Customer account" block into header patterns [#49133](https://github.com/woocommerce/woocommerce/pull/49133)
* Update - CYS: Update sidebar homepage copy [#48882](https://github.com/woocommerce/woocommerce/pull/48882)
* Update - CYS: Update verbiage in the CTA to our Fiverr Logo Maker landing page. [#48987](https://github.com/woocommerce/woocommerce/pull/48987)
* Update - CYS: when the footer/header is clicked, the border color is blue. [#48765](https://github.com/woocommerce/woocommerce/pull/48765)
* Update - Deprecate and create new coming soon block version [#49786](https://github.com/woocommerce/woocommerce/pull/49786)
* Update - E2E: check the `Add` button when creating product variations in the new Product Editor [#48928](https://github.com/woocommerce/woocommerce/pull/48928)
* Update - E2E: in the new Product Editor app, update how to detect when global attributes are loaded. [#48915](https://github.com/woocommerce/woocommerce/pull/48915)
* Update - E2E: remove UI check when creating attribute global terms [#48934](https://github.com/woocommerce/woocommerce/pull/48934)
* Update - Ensure expiration-related modal is shown to the installed Woo subscriptions [#49747](https://github.com/woocommerce/woocommerce/pull/49747)
* Update - Ensures the product ID is valid when interacting with product variations via the REST API. [#48804](https://github.com/woocommerce/woocommerce/pull/48804)
* Update - Ensure that active plugins shown in the System Status api endpoint actually exist [#48709](https://github.com/woocommerce/woocommerce/pull/48709)
* Update - Ensuring product creation with unique sku for concurrent requests [#47476](https://github.com/woocommerce/woocommerce/pull/47476)
* Update - Fix: Show preview label only when Product Collection block is selected [#48795](https://github.com/woocommerce/woocommerce/pull/48795)
* Update - Fix Classic Template block registration on WP 6.6 [#48730](https://github.com/woocommerce/woocommerce/pull/48730)
* Update - Fix typo on Congratulations screen [#49233](https://github.com/woocommerce/woocommerce/pull/49233)
* Update - Hide account creation options not relevent to block checkout when using block checkout. [#49389](https://github.com/woocommerce/woocommerce/pull/49389)
* Update - Improve rendering of order list table on mobile. [#49592](https://github.com/woocommerce/woocommerce/pull/49592)
* Update - Improve the handling of the deprecated WC()->api property [#48884](https://github.com/woocommerce/woocommerce/pull/48884)
* Update - Make proceed to order button non sticky when zoom level is bigger than 100% [#48391](https://github.com/woocommerce/woocommerce/pull/48391)
* Update - Make Single Product gallery thumbnail images sharper by defining a srcset [#49112](https://github.com/woocommerce/woocommerce/pull/49112)
* Update - Migrate the cart and checkout block's state, country and custom field input to a native select [#48180](https://github.com/woocommerce/woocommerce/pull/48180)
* Update - Move remote logger to `./src` and improve `fetch_latest_woocommerce_version()` logic [#49639](https://github.com/woocommerce/woocommerce/pull/49639)
* Update - Optimize the method that gets the downloads count for a given download [#49008](https://github.com/woocommerce/woocommerce/pull/49008)
* Update - preparing checkout blocks docs for dev docs site [#49010](https://github.com/woocommerce/woocommerce/pull/49010)
* Update - Product Collection: revert renaming "Sync with current query" option [#49907](https://github.com/woocommerce/woocommerce/pull/49907)
* Update - Product Editor: improve E2E tests. Test the `+3 More` item label in the Organization tab [#48891](https://github.com/woocommerce/woocommerce/pull/48891)
* Update - Product Editor: restore and fix E2E test that creates product variations [#48725](https://github.com/woocommerce/woocommerce/pull/48725)
* Update - Product Editor: restore Product (local) Attributes E2E test [#48871](https://github.com/woocommerce/woocommerce/pull/48871)
* Update - Product Editor: update create product variations E2E test [#48627](https://github.com/woocommerce/woocommerce/pull/48627)
* Update - Redesigned the Product Collection block's insertion journey. [#48911](https://github.com/woocommerce/woocommerce/pull/48911)
* Update - Remove Jetpack copy experiment from core profiler [#49452](https://github.com/woocommerce/woocommerce/pull/49452)
* Update - Remove the hooked blocks feature gate and replace with wc_hooked_blocks_version option [#49302](https://github.com/woocommerce/woocommerce/pull/49302)
* Update - Replace the "Customer account" line logo. [#49666](https://github.com/woocommerce/woocommerce/pull/49666)
* Update - Return HTTP 404 for REST API requests involving non-existing tax class. [#48579](https://github.com/woocommerce/woocommerce/pull/48579)
* Update - Return HTTP 404 when accessing non-existent webhooks via REST API. [#48729](https://github.com/woocommerce/woocommerce/pull/48729)
* Update - Return HTTP 404 when trying to read or delete a non-existent product review. [#48726](https://github.com/woocommerce/woocommerce/pull/48726)
* Update - Run full e2e tests suite against Pressable and WPCOM websites. [#49597](https://github.com/woocommerce/woocommerce/pull/49597)
* Update - Update content for usage tracking modal for CYS experience [#49911](https://github.com/woocommerce/woocommerce/pull/49911)
* Update - Updated account settings descriptions for added clarity [#48556](https://github.com/woocommerce/woocommerce/pull/48556)
* Update - Update Jetpack's new SSO classes and methods to prevent deprecation notice. [#49752](https://github.com/woocommerce/woocommerce/pull/49752)
* Update - Update required and tested up to WP versions for the WordPress 6.6 release. [#49619](https://github.com/woocommerce/woocommerce/pull/49619)
* Update - Update Settings to disable Save button unless modifications are made. [#47444](https://github.com/woocommerce/woocommerce/pull/47444)
* Update - Update shipping method setup modal copy if the block-based local pickup is enabled [#48529](https://github.com/woocommerce/woocommerce/pull/48529)
* Update - Update Store Alert styles [#49174](https://github.com/woocommerce/woocommerce/pull/49174)
* Update - Update Store Alert widths to match main body [#48487](https://github.com/woocommerce/woocommerce/pull/48487)
* Update - Update the "Customer Account" block icon for the line style. [#49401](https://github.com/woocommerce/woocommerce/pull/49401)
* Update - Update the CYS opt-in messaging [#49894](https://github.com/woocommerce/woocommerce/pull/49894)
* Update - Update the footer section in "Add products" task [#49782](https://github.com/woocommerce/woocommerce/pull/49782)
* Update - Update WC Tasks in the WC Home. Rename to WooCommerce marketplace, add new browse marketplace, remove connect to woocomerce.com from inbox [#48128](https://github.com/woocommerce/woocommerce/pull/48128)
* Update - Utilize the new shared component to showcase WooPayments payment method logos. [#49300](https://github.com/woocommerce/woocommerce/pull/49300)
* Dev - Add Allure to Blocks e2e tests [#49228](https://github.com/woocommerce/woocommerce/pull/49228)
* Dev - Add daily checks for core e2e with PHP 8.1 and WP latest-1 [#48929](https://github.com/woocommerce/woocommerce/pull/48929)
* Dev - Add hook to customize the rendered receipt template [#48872](https://github.com/woocommerce/woocommerce/pull/48872)
* Dev - Add new CI workflow to trigger tests on demand. [#49674](https://github.com/woocommerce/woocommerce/pull/49674)
* Dev - Add support for e2e testing against external sites in CI [#49017](https://github.com/woocommerce/woocommerce/pull/49017)
* Dev - Another attempt to stabilize flaky Product Collection E2E tests. [#49638](https://github.com/woocommerce/woocommerce/pull/49638)
* Dev - Blocks E2E: Fix a flaky Product Collection test where accidental multiple edits occur and break the template saving step. [#49590](https://github.com/woocommerce/woocommerce/pull/49590)
* Dev - Blocks E2E: Fix DB snapshot removal step in setup script. [#49677](https://github.com/woocommerce/woocommerce/pull/49677)
* Dev - Build: speedup dependencies installation by disabling composer optimize autoloading by default. [#48980](https://github.com/woocommerce/woocommerce/pull/48980)
* Dev - CI: buffix for linting missing strict types directive. [#49015](https://github.com/woocommerce/woocommerce/pull/49015)
* Dev - CI: cleanup CI related command after fixing jobs matrix generation. [#49330](https://github.com/woocommerce/woocommerce/pull/49330)
* Dev - CI: code style fixes to pass linting in updated CI environment. [#49020](https://github.com/woocommerce/woocommerce/pull/49020)
* Dev - CI: improve flacky tests reporting job execution time. [#49665](https://github.com/woocommerce/woocommerce/pull/49665)
* Dev - CI: Re-group PHPUnit jobs. [#49443](https://github.com/woocommerce/woocommerce/pull/49443)
* Dev - CI: reduce running time for PHPUnit related jobs. [#49193](https://github.com/woocommerce/woocommerce/pull/49193)
* Dev - CI: tuning deps caching for playwright. [#49081](https://github.com/woocommerce/woocommerce/pull/49081)
* Dev - CI config: update changes lists to include wp-env config [#49626](https://github.com/woocommerce/woocommerce/pull/49626)
* Dev - Clean up unused files in plugins/woocommerce-blocks [#49319](https://github.com/woocommerce/woocommerce/pull/49319)
* Dev - Create a separate JS cart and checkout JavaScript bundle to improve performance. [#48010](https://github.com/woocommerce/woocommerce/pull/48010)
* Dev - CYS - Fix the "test_fetch_patterns_should_register_testimonials_category_as_reviews" tests. [#48719](https://github.com/woocommerce/woocommerce/pull/48719)
* Dev - Dropping select2 and point it to SelectWoo [#48731](https://github.com/woocommerce/woocommerce/pull/48731)
* Dev - E2E: enable slow tests reporting for blocks E2E tests. [#49367](https://github.com/woocommerce/woocommerce/pull/49367)
* Dev - E2E tests: fix basic spec for multiple environments [#49609](https://github.com/woocommerce/woocommerce/pull/49609)
* Dev - E2E tests: fix failing settings-tax e2e test [#48792](https://github.com/woocommerce/woocommerce/pull/48792)
* Dev - E2E tests: Fix flaky account email receiving test [#48957](https://github.com/woocommerce/woocommerce/pull/48957)
* Dev - E2E tests: Fix flaky connect to Woo.com test [#48926](https://github.com/woocommerce/woocommerce/pull/48926)
* Dev - E2E tests: Fix flaky filling regular price in the inventory tab [#49226](https://github.com/woocommerce/woocommerce/pull/49226)
* Dev - E2E tests: Fix flaky filling SKU field and CYS footer [#49191](https://github.com/woocommerce/woocommerce/pull/49191)
* Dev - E2E tests: Fix flaky Gutenberg, WC Services tests [#48916](https://github.com/woocommerce/woocommerce/pull/48916)
* Dev - E2E tests: Fix flaky Gutenberg tests [#48896](https://github.com/woocommerce/woocommerce/pull/48896)
* Dev - E2E tests: Fix flaky Gutenberg tests [#49548](https://github.com/woocommerce/woocommerce/pull/49548)
* Dev - E2E tests: Fix flaky logo picker waiting for response tests [#49451](https://github.com/woocommerce/woocommerce/pull/49451)
* Dev - E2E tests: Fix flaky merchant filling sku field in the new editor [#49134](https://github.com/woocommerce/woocommerce/pull/49134)
* Dev - E2E tests: Fix flaky merchant tests [#49381](https://github.com/woocommerce/woocommerce/pull/49381)
* Dev - E2E tests: Fix merchant settings general test [#48907](https://github.com/woocommerce/woocommerce/pull/48907)
* Dev - E2E tests: fix shopper checkout block test [#49596](https://github.com/woocommerce/woocommerce/pull/49596)
* Dev - E2E tests: fix some tests for WP 6.6 [#49634](https://github.com/woocommerce/woocommerce/pull/49634)
* Dev - E2E tests: tag different envs in e2e test suite to run in workflows [#48715](https://github.com/woocommerce/woocommerce/pull/48715)
* Dev - Final sanity check to make sure attributes are done saving [#48737](https://github.com/woocommerce/woocommerce/pull/48737)
* Dev - Fix broken syntax in e2e-guidelines.md. [#49018](https://github.com/woocommerce/woocommerce/pull/49018)
* Dev - Fix flaky orphaned refund test [#49741](https://github.com/woocommerce/woocommerce/pull/49741)
* Dev - Hide product filters overlay template part experimental feature from public release [#49564](https://github.com/woocommerce/woocommerce/pull/49564)
* Dev - In blocks codebase, export SITE_CURRENCY property with properties matching typescript definitions. [#48727](https://github.com/woocommerce/woocommerce/pull/48727)
* Dev - Lint new PHP files for strict types directive [#48943](https://github.com/woocommerce/woocommerce/pull/48943)
* Dev - Minor tooling tweaks (zip compression level, composer invocation) [#48857](https://github.com/woocommerce/woocommerce/pull/48857)
* Dev - Monorepo: enable Jest and babel-loader caching. [#49656](https://github.com/woocommerce/woocommerce/pull/49656)
* Dev - Monorepo: fix side-effects of setting strict mode for linting script. [#49436](https://github.com/woocommerce/woocommerce/pull/49436)
* Dev - Monorepo: minor tweaks in zip building script (use frozen lock file when installing dependecies). [#49640](https://github.com/woocommerce/woocommerce/pull/49640)
* Dev - Monorepo: refine approach to patching dependecies in favour of built-in pnpm functionality. [#49892](https://github.com/woocommerce/woocommerce/pull/49892)
* Dev - Monorepo: set strict mode for linting script. [#49366](https://github.com/woocommerce/woocommerce/pull/49366)
* Dev - Monorepo: tweak patching dependencies for better Webpack perfromance. [#49703](https://github.com/woocommerce/woocommerce/pull/49703)
* Dev - Move buildkite-test-collector to devDependencies [#49051](https://github.com/woocommerce/woocommerce/pull/49051)
* Dev - move docs out of main folder until subcategories are ready [#49354](https://github.com/woocommerce/woocommerce/pull/49354)
* Dev - Product Collection: add tracking for block usage [#46466](https://github.com/woocommerce/woocommerce/pull/46466)
* Dev - Remove performance tests from PR checks (leave on push to trunk) [#48927](https://github.com/woocommerce/woocommerce/pull/48927)
* Dev - Switch `render()` to `createRoot().render()` to use React 18 features. [#48858](https://github.com/woocommerce/woocommerce/pull/48858)
* Dev - Tests: pin wp-env core version to 6.5 (temporary until tests are fixed to pass with 6.6) [#49620](https://github.com/woocommerce/woocommerce/pull/49620)
* Dev - Tweaks related to caching Composer dependecies and Playwright downloads in CI. [#48865](https://github.com/woocommerce/woocommerce/pull/48865)
* Dev - Update Action Scheduler to 3.8.1 [#49483](https://github.com/woocommerce/woocommerce/pull/49483)
* Dev - Update a few e2e tests failing on the daily run [#49313](https://github.com/woocommerce/woocommerce/pull/49313)
* Dev - Update all values to be random so that retries don't fail on assertions [#48734](https://github.com/woocommerce/woocommerce/pull/48734)
* Dev - Updated CodeSniffer configuration to address conflicting rules. [#49183](https://github.com/woocommerce/woocommerce/pull/49183)
* Dev - Update Playwright from 1.44 to 1.45 [#49202](https://github.com/woocommerce/woocommerce/pull/49202)
* Tweak - Add admin_install_timestamp in WC_Tracker [#50076](https://github.com/woocommerce/woocommerce/pull/50076)
* Tweak - Add $wpdb->esc_like to the search criteria when searching for a product custom field name [#48949](https://github.com/woocommerce/woocommerce/pull/48949)
* Tweak - Add the initially installed WooCommerce version to the wp_options table [#49139](https://github.com/woocommerce/woocommerce/pull/49139)
* Tweak - Change CLIRunner namespace for better PSR compatibility. [#49390](https://github.com/woocommerce/woocommerce/pull/49390)
* Tweak - Equalize data in Order export with data in Client side CSV export [#49356](https://github.com/woocommerce/woocommerce/pull/49356)
* Tweak - Exclude coming soon patterns from block inserter [#48821](https://github.com/woocommerce/woocommerce/pull/48821)
* Tweak - Fix tip block syntax in register-product-collection.md [#49785](https://github.com/woocommerce/woocommerce/pull/49785)
* Tweak - Get tax line label instead of name in StoreAPI Order endpoint. [#48445](https://github.com/woocommerce/woocommerce/pull/48445)
* Tweak - Improve checks when offering to remove test orders [#49032](https://github.com/woocommerce/woocommerce/pull/49032)
* Tweak - Initialize BlockTemplatesController for block themes only. [#48905](https://github.com/woocommerce/woocommerce/pull/48905)
* Tweak - Product Collection: flatten telemetry query filters data to json string [#49680](https://github.com/woocommerce/woocommerce/pull/49680)
* Tweak - Remove enctype from verify email form [#48859](https://github.com/woocommerce/woocommerce/pull/48859)
* Tweak - Remove unneeded IE styling as IE is no longer supported [#49027](https://github.com/woocommerce/woocommerce/pull/49027)
* Tweak - Rename Google Listings and Ads with Google for WooCommerce [#47614](https://github.com/woocommerce/woocommerce/pull/47614)
* Tweak - Show Guest when there is no Customer name [#49594](https://github.com/woocommerce/woocommerce/pull/49594)
* Tweak - Trigger doing_it_wrong() when using HPOS query args for CPT order queries. [#47457](https://github.com/woocommerce/woocommerce/pull/47457)
* Tweak - Update text to Content right with image left pattern [#49792](https://github.com/woocommerce/woocommerce/pull/49792)
* Tweak - Update the "API enabled" entry in the System Status Report to clarify that it pertains to the Legacy REST API. [#48878](https://github.com/woocommerce/woocommerce/pull/48878)
* Tweak - Add placeholder options and validation to all checkout select inputs. [#49929](https://github.com/woocommerce/woocommerce/pull/49929)
* Performance - Load REST API namespaces only when needed. [#47704](https://github.com/woocommerce/woocommerce/pull/47704)
* Performance - Reduced number of recalculations on Store API cart routes [#48944](https://github.com/woocommerce/woocommerce/pull/48944)
* Enhancement - Add address title to edit/add buttons on My Account page [#49171](https://github.com/woocommerce/woocommerce/pull/49171)
* Enhancement - Added password field to block checkout (when enabled in settings) for new accounts to set a custom password. [#48985](https://github.com/woocommerce/woocommerce/pull/48985)
* Enhancement - Add required indication to login forms [#48743](https://github.com/woocommerce/woocommerce/pull/48743)
* Enhancement - Add scope attributes to the order table on My Account [#49201](https://github.com/woocommerce/woocommerce/pull/49201)
* Enhancement - Add strength meter to block checkout password field. [#49164](https://github.com/woocommerce/woocommerce/pull/49164)
* Enhancement - Allow blocks with parents in the "woocommerce" namespace to be added to the Checkout block without requiring them to be added to the "__experimental_woocommerce_blocks_add_data_attributes_to_block" hook. [#48543](https://github.com/woocommerce/woocommerce/pull/48543)
* Enhancement - Convert edit address link to a button on checkout [#49471](https://github.com/woocommerce/woocommerce/pull/49471)
* Enhancement - CYS: make the entire shuffle section clickable. [#48889](https://github.com/woocommerce/woocommerce/pull/48889)
* Enhancement - CYS: Remove iframe animation [#48941](https://github.com/woocommerce/woocommerce/pull/48941)
* Enhancement - Made the "return to cart" link (in the checkout block) hidden by default. [#48762](https://github.com/woocommerce/woocommerce/pull/48762)
* Enhancement - Provide the location context within the Product Collection block context [#44145](https://github.com/woocommerce/woocommerce/pull/44145)
* Enhancement - Updated block checkout and Store API stock handling so stock is only reserved when attempting payment for an order. [#49446](https://github.com/woocommerce/woocommerce/pull/49446)
= 9.1.4 2024-07-26 = = 9.1.4 2024-07-26 =
**WooCommerce** **WooCommerce**
@ -8,7 +354,6 @@
* Fix - Hardening against XSS via the Product Button unescaped attribute. [#50010](https://github.com/woocommerce/woocommerce/pull/50010) * Fix - Hardening against XSS via the Product Button unescaped attribute. [#50010](https://github.com/woocommerce/woocommerce/pull/50010)
* Fix - Enhance escaping for block attributes. [#50015](https://github.com/woocommerce/woocommerce/pull/50015) * Fix - Enhance escaping for block attributes. [#50015](https://github.com/woocommerce/woocommerce/pull/50015)
= 9.1.2 2024-07-12 = = 9.1.2 2024-07-12 =
**WooCommerce** **WooCommerce**
@ -5901,12 +6246,12 @@
* Dev - Revert work done in #4857 for automated shipping after OBW is completed #5971 * Dev - Revert work done in #4857 for automated shipping after OBW is completed #5971
* Add - Welcome modal when coming from Calypso #6004 * Add - Welcome modal when coming from Calypso #6004
* Enhancement - Add an a/b experiment for installing free business features #5786 * Enhancement - Add an a/b experiment for installing free business features #5786
* Dev - Add `onChangeCallback` feature to the wc-admin `<Form>` component #5786 * Dev - Add `onChangeCallback` feature to the wc-admin `<Form>` component #5786
* Fix - Generate JSON translation chunks on plugin activation #6028 * Fix - Generate JSON translation chunks on plugin activation #6028
* Dev - Add merchant email notifications #5922 * Dev - Add merchant email notifications #5922
* Add - Email note to add first product. #6024 * Add - Email note to add first product. #6024
* Add - Note for users coming from Calypso. #6030 * Add - Note for users coming from Calypso. #6030
* Enhancement - Add an "unread" indicator to inbox messages. #6047 * Enhancement - Add an "unread" indicator to inbox messages. #6047
* Add - Manage activity from home screen inbox message. #6072 * Add - Manage activity from home screen inbox message. #6072
= 4.9.5 2022-03-10 = = 4.9.5 2022-03-10 =
@ -6709,7 +7054,7 @@
* Fix - The WCPay method not appearing as recommended sometimes #4345 * Fix - The WCPay method not appearing as recommended sometimes #4345
* Fix - Removed URLSearchParams method #4501 * Fix - Removed URLSearchParams method #4501
* Fix - REST API collections schema. #4484 * Fix - REST API collections schema. #4484
* Fix - null issue in wpNavMenuClassChange #4513 🎉 gradosevic * Fix - null issue in wpNavMenuClassChange #4513 🎉 gradosevic
* Fix - RTL stylesheet loading for split code chunks. #4542 * Fix - RTL stylesheet loading for split code chunks. #4542
* Fix - Don't show store location step in tax and shipping tasks if the address has already been provided #4507 * Fix - Don't show store location step in tax and shipping tasks if the address has already been provided #4507
* Fix - Check for enabled methods before payment task completion #4530 * Fix - Check for enabled methods before payment task completion #4530
@ -6851,7 +7196,7 @@
* Dev - Fixed failing unit tests. #105 * Dev - Fixed failing unit tests. #105
**WooCommerce Admin 1.2.3** **WooCommerce Admin 1.2.3**
* Enhancement - Add onboarding payments note #4157 * Enhancement - Add onboarding payments note #4157
* Enhancement - Marketing Inbox Note #4030 * Enhancement - Marketing Inbox Note #4030
* Performance - Use Route based code splitting to reduce bundle size #4094 * Performance - Use Route based code splitting to reduce bundle size #4094
* Performance - trim down inbox note API request. #3977 * Performance - trim down inbox note API request. #3977
@ -7262,7 +7607,7 @@
* Dev - Add a filter `woocommerce_ajax_add_order_item_validation` to allow validations in `add_order_item` function. #24518 * Dev - Add a filter `woocommerce_ajax_add_order_item_validation` to allow validations in `add_order_item` function. #24518
* Dev - Use `wc_get_cart_url` instead of `wc_get_page_permalink( 'cart' )` because former has a filter `woocommerce_get_cart_url` to allow customization. #24530 * Dev - Use `wc_get_cart_url` instead of `wc_get_page_permalink( 'cart' )` because former has a filter `woocommerce_get_cart_url` to allow customization. #24530
* Dev - New `woocommerce_product_after_tabs` action hook added. #24694 * Dev - New `woocommerce_product_after_tabs` action hook added. #24694
* Dev - Enable append hashes on custom events (like ajax requests) #24665 * Dev - Enable append hashes on custom events (like ajax requests) #24665
* Dev - Introduced `woocommerce_order_get_formatted_billing_address` and `woocommerce_order_get_formatted_shipping_address` filters. #24677 * Dev - Introduced `woocommerce_order_get_formatted_billing_address` and `woocommerce_order_get_formatted_shipping_address` filters. #24677
* Dev - WC_Abstract_Order::recalculate_coupons() is public now. #24740 * Dev - WC_Abstract_Order::recalculate_coupons() is public now. #24740
* Dev - Added 'applied_coupon' trigger to checkout.js. #24406 * Dev - Added 'applied_coupon' trigger to checkout.js. #24406
@ -7375,7 +7720,7 @@
* Tweak - Update the generate username setting description label to reflect how the username is actually generated. #23911 * Tweak - Update the generate username setting description label to reflect how the username is actually generated. #23911
* Tweak - OBW: Adjust plugin highlight container sizes to avoid overlap. #23997 * Tweak - OBW: Adjust plugin highlight container sizes to avoid overlap. #23997
* Tweak - Round tax amounts late when the round at subtotal level setting is enabled to reduce rounding errors. #24024 * Tweak - Round tax amounts late when the round at subtotal level setting is enabled to reduce rounding errors. #24024
* Tweak - OBW: Now includes WooCommerce Admin as a recommended plugin. #24058 * Tweak - OBW: Now includes WooCommerce Admin as a recommended plugin. #24058
* Template - Review and update all template files escaping. #23460 * Template - Review and update all template files escaping. #23460
* Template - Remove mention of shipping section from the checkout/form-login.php template as shipping is not always a requirement for an order. #23941 * Template - Remove mention of shipping section from the checkout/form-login.php template as shipping is not always a requirement for an order. #23941
* Template - Add new filter `woocommerce_before_thankyou` to the checkout/thankyou.php template. #23538 * Template - Add new filter `woocommerce_before_thankyou` to the checkout/thankyou.php template. #23538
@ -8047,7 +8392,7 @@
* Fix - Fix warning when using logger instance in woocommerce_logging_class filter. #21448 * Fix - Fix warning when using logger instance in woocommerce_logging_class filter. #21448
* Fix - Use uppercase "ID" when sorting product queries by ID. #21461 * Fix - Use uppercase "ID" when sorting product queries by ID. #21461
* Fix - Consistently escape the gateway ID in the checkout payment method template. #21439 * Fix - Consistently escape the gateway ID in the checkout payment method template. #21439
* Fix - Avoid treating HTTP 301 and 302 codes as failures for webhooks. #21491 * Fix - Avoid treating HTTP 301 and 302 codes as failures for webhooks. #21491
* Fix - Add address_1 to shipping packages info in WC_Cart:: get_shipping_packages to make it work correctly in address formatting functions. #21493 * Fix - Add address_1 to shipping packages info in WC_Cart:: get_shipping_packages to make it work correctly in address formatting functions. #21493
* Fix - Don't fire two of the same action when saving shipping settings. #21494 * Fix - Don't fire two of the same action when saving shipping settings. #21494
* Fix - Remove double condition for address line 2 in `WC_Countries::get_default_address_fields`. #20629 * Fix - Remove double condition for address line 2 in `WC_Countries::get_default_address_fields`. #20629
@ -8359,7 +8704,7 @@
* Fix - Delete orphaned variations after product import. #19378 * Fix - Delete orphaned variations after product import. #19378
* Fix - Ensure API credentials exist before defining PayPal refund support. #19380 * Fix - Ensure API credentials exist before defining PayPal refund support. #19380
* Fix - Force word-wrapping in the log viewer to prevent layout-breaking long lines. #19503 * Fix - Force word-wrapping in the log viewer to prevent layout-breaking long lines. #19503
* Fix - Removes permission checks that were preventing webhooks from displaying properly when no post object existed. #19508 * Fix - Removes permission checks that were preventing webhooks from displaying properly when no post object existed. #19508
* Fix - Empty cart after completing PayPal payment. #19509 * Fix - Empty cart after completing PayPal payment. #19509
* Fix - Strip tags on aria-labels in Add to Cart template to prevent broken HTML. #19522 * Fix - Strip tags on aria-labels in Add to Cart template to prevent broken HTML. #19522
* Fix - Update post_modified date when saving products and variations but no other product data. #19595 * Fix - Update post_modified date when saving products and variations but no other product data. #19595
@ -8381,7 +8726,7 @@
* Fix - WC API should not try to create a product image when creating a product variation if an empty image is passed. #19971 * Fix - WC API should not try to create a product image when creating a product variation if an empty image is passed. #19971
* Fix - Force settings API settings to autoload by default. #19998 * Fix - Force settings API settings to autoload by default. #19998
* Fix - Cart html5 validation events when using keyboard. #20001 * Fix - Cart html5 validation events when using keyboard. #20001
* Fix - Don't show stock status fields in external product quick-edit. #20005 * Fix - Don't show stock status fields in external product quick-edit. #20005
* Fix - Prevent an infinite loop if 2 grouped products are linked. #20020 * Fix - Prevent an infinite loop if 2 grouped products are linked. #20020
* Fix - Switch stock_status when manage stock gets changed to prevent being out of stock if stock quantity is > 0. #20021 * Fix - Switch stock_status when manage stock gets changed to prevent being out of stock if stock quantity is > 0. #20021
* Fix - When duplicating variation, set the date to null. #20083 * Fix - When duplicating variation, set the date to null. #20083
@ -8643,7 +8988,7 @@
* Fix - is_visible should ensure product is is not trashed before returning true. * Fix - is_visible should ensure product is is not trashed before returning true.
* Fix - Return packages with no rates back to the cart so the shipping calculator is displayed even when the current country is not shippable. * Fix - Return packages with no rates back to the cart so the shipping calculator is displayed even when the current country is not shippable.
* Fix - Merge session and persistent carts when both exists after login. * Fix - Merge session and persistent carts when both exists after login.
* Fix - Remove "wc_error" query string after login. * Fix - Remove "wc_error" query string after login.
* Fix - Allow woocommerce_form_field() have 'custom_attributes' equal 0. * Fix - Allow woocommerce_form_field() have 'custom_attributes' equal 0.
* Fix - Bulk actions in status logs table. * Fix - Bulk actions in status logs table.
* Fix - Exclude add-to-cart from pagination links. * Fix - Exclude add-to-cart from pagination links.
@ -8684,19 +9029,19 @@
* Fix - Removed class within class in admin meta boxes HTML. * Fix - Removed class within class in admin meta boxes HTML.
* Fix - Fixed wrong `flex-control-nav` selector scope in `add-to-cart-variation.js` * Fix - Fixed wrong `flex-control-nav` selector scope in `add-to-cart-variation.js`
* Fix - Allow variations to be added to cart from query string. * Fix - Allow variations to be added to cart from query string.
* Fix - Use `add_filter` for `comment_feed_where` hook. * Fix - Use `add_filter` for `comment_feed_where` hook.
* Fix - Change nocache_headers hook firing in the cache helper. * Fix - Change nocache_headers hook firing in the cache helper.
* Fix - Coupon min/max spend based on displayed subtotal. * Fix - Coupon min/max spend based on displayed subtotal.
* Fix - Fix event propagation on click in setup wizard and improve validation. * Fix - Fix event propagation on click in setup wizard and improve validation.
* Fix - API - Change how line items are saved in API so calculations are correct. * Fix - API - Change how line items are saved in API so calculations are correct.
* Tweak - Hide downloads from admin emails. * Tweak - Hide downloads from admin emails.
* Tweak - Set placeholder for variation lxwxh field to that of the parent. * Tweak - Set placeholder for variation lxwxh field to that of the parent.
* Tweak - Improve the Add Payment Methods display so buttons are not shown when no payment methods support the feature. * Tweak - Improve the Add Payment Methods display so buttons are not shown when no payment methods support the feature.
* Localization - Update NJ tax rate. * Localization - Update NJ tax rate.
* Localization - Add Belarusian ruble BYN. * Localization - Add Belarusian ruble BYN.
= 3.2.3 - 2017-11-02 = = 3.2.3 - 2017-11-02 =
* Fix - Fixed a conflict with some slider plugins due to sanitization of archive/term descriptions. * Fix - Fixed a conflict with some slider plugins due to sanitization of archive/term descriptions.
* Fix - Fixed a flexslider bug when there is only 1 image on the product page (no gallery). * Fix - Fixed a flexslider bug when there is only 1 image on the product page (no gallery).
* Fix - Prevent potential notices when someone extends product tabs wrongly. * Fix - Prevent potential notices when someone extends product tabs wrongly.
* Fix - Fixed display of shipping calculator under some conditions. * Fix - Fixed display of shipping calculator under some conditions.

View File

@ -3,7 +3,7 @@
"MD003": { "style": "atx" }, "MD003": { "style": "atx" },
"MD007": { "indent": 4 }, "MD007": { "indent": 4 },
"MD013": { "line_length": 9999 }, "MD013": { "line_length": 9999 },
"MD024": { "allow_different_nesting": true }, "MD024": { "siblings_only": true },
"MD033": { "allowed_elements": ["video"] }, "MD033": { "allowed_elements": ["video"] },
"MD035": false, "MD035": false,
"MD041": false, "MD041": false,

View File

@ -0,0 +1,5 @@
---
category_title: Block Theme Development
category_slug: block-theme-development
post_title: Block theme development
---

View File

@ -0,0 +1,84 @@
---
post_title: Cart and checkout blocks theming
menu_title: Cart and Checkout Blocks Theming
tags: reference
---
> [!IMPORTANT]
> We strongly discourage writing CSS code based on existing block class names and prioritize using global styles when possible. We especially discourage writing CSS selectors that rely on a specific block being a descendant of another one, as users can move blocks around freely, so they are prone to breaking. Similar to WordPress itself, we consider the HTML structure within components, blocks, and block templates to be "private", and subject to further change in the future, so using CSS to target the internals of a block or a block template is _not recommended or supported_.
## Buttons
WC Blocks introduces the button component, it differs from a generic `button` in that it has some default styles to make it correctly fit in the Blocks design.
![Button screenshot](https://user-images.githubusercontent.com/3616980/86381945-e6fd6c00-bc8d-11ea-8811-7e546bea69b9.png)
Themes can still style them to match theme colors or styles as follows:
```css
.wc-block-components-button {
background-color: #d5502f;
color: #fff;
/* More rules can be added to modify the border, shadow, etc. */
}
/* It might be needed to modify the hover, focus, active and disabled states too */
```
![Button screenshot with custom styles](https://user-images.githubusercontent.com/3616980/86381505-b6b5cd80-bc8d-11ea-8ceb-cfbe84b411d4.png)
Notice the button component doesn't have the `.button` class name. So themes that wrote some styles for buttons might want to apply some (or all) of those styles to the button component as well.
## Mobile submit container
In small viewports, the Cart block displays the _Proceed to Checkout_ button inside a container fixed at the bottom of the screen.
![Submit container screenshot](https://user-images.githubusercontent.com/3616980/86382876-393e8d00-bc8e-11ea-8d0b-e4e347ea4773.png)
By default, the container has a white background so it plays well with the button component default colors. Themes that want to apply the same background color as the rest of the page can do it with the following code snippet:
```css
.wc-block-cart__submit-container {
background-color: #f9f4ee;
}
```
Take into consideration the container has a top box shadow that might not play well with some dark background colors. If needed, it can be modified directly setting the `color` property (internally, shadow color uses `currentColor`, so it honors the `color` property):
```css
.wc-block-cart__submit-container::before {
color: rgba( 214, 209, 203, 0.5 );
}
```
Alternatively, themes can override the `box-shadow` property completely:
```css
.wc-block-cart__submit-container::before {
box-shadow: 0 -10px 20px 10px rgba( 214, 209, 203, 0.5 );
}
```
![Submit container screenshot with custom styles](https://user-images.githubusercontent.com/3616980/86382693-27f58080-bc8e-11ea-894e-de378af3e2bb.png)
## Item quantity badge
The item quantity badge is the number that appears next to the image in the _Order summary_ section of the _Checkout_ block sidebar.
![Order summary screenshot](https://user-images.githubusercontent.com/3616980/83862844-c8559500-a722-11ea-9653-2fc8bcd544d2.png)
By default, it uses a combination of black and white borders and shadows so it has enough contrast with themes with light and dark backgrounds. Themes can modify the colors with their own palette with a single CSS selector and four properties. For example:
```css
.wc-block-components-order-summary-item__quantity {
background-color: #f9f4ee;
border-color: #4b3918;
box-shadow: 0 0 0 2px #f9f4ee;
color: #4b3918;
}
```
![Order summary screenshot with custom styles for the item quantity badge](https://user-images.githubusercontent.com/3616980/83863109-2e421c80-a723-11ea-9bf7-2033a96cf5b2.png)

View File

@ -0,0 +1,72 @@
---
post_title: CSS styling for themes
menu_title: CSS Styling for Themes
tags: reference
---
## Block and component class names
> [!IMPORTANT]
> We strongly discourage writing CSS code based on existing block class names and prioritize using global styles when possible. We especially discourage writing CSS selectors that rely on a specific block being a descendant of another one, as users can move blocks around freely, so they are prone to breaking. Similar to WordPress itself, we consider the HTML structure within components, blocks, and block templates to be "private", and subject to further change in the future, so using CSS to target the internals of a block or a block template is _not recommended or supported_.
WooCommerce Blocks follows BEM for class names, as [stated in our coding guidelines](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/docs/contributors/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.
The combination of block class names and component class names allows themes to style each component either globally or only in specific blocks. As an example, you could style all prices to be italics with:
```css
/* This will apply to all block prices */
.wc-block-components-formatted-money-amount {
font-style: italic;
}
```
But if you only wanted to make it italic in the Checkout block, that could be done adding the block selector:
```css
/* This will apply to prices in the checkout block */
.wc-block-checkout .wc-block-components-formatted-money-amount {
font-style: italic;
}
```
**Note:** for backwards compatibility, some components might have class names with both prefixes (ie: `wc-block-sort-select` and `wc-block-components-sort-select`). In those cases, the class name with `.wc-block-` prefix is deprecated and shouldn't be used in new code. It will be removed in future versions. If an element has both classes always style the one with `.wc-block-components-` prefix.
## Container query class names
Some of our components have responsive classes depending on the container width. The reason to use these classes instead of CSS media queries is to adapt to the container where the block is added (CSS media queries only allow reacting to viewport sizes).
Those classes are:
Container width | Class name
----------------|------------
\&gt;700px | `is-large`
521px-700px | `is-medium`
401px-520px | `is-small`
&lt;=400px | `is-mobile`
As an example, if we wanted to do the Checkout font size 10% larger when the container has a width of 521px or wider, we could do so with this code:
```css
.wc-block-checkout.is-medium,
.wc-block-checkout.is-large {
font-size: 1.1em;
}
```
## WC Blocks _vs._ theme style conflicts for semantic elements
WooCommerce Blocks uses HTML elements according to their semantic meaning, not their default layout. That means that some times blocks might use an anchor link (`&lt;a&gt;`) but display it as a button. Or the other way around, a `&lt;button&gt;` might be displayed as a text link. Similarly, headings might be displayed as regular text.
In these cases, Blocks include some CSS resets to undo most default styles introduced by themes. A `&lt;button&gt;` that is displayed as a text link will probably have resets for the background, border, etc. That will solve most conflicts out-of-the-box but in some occasions those CSS resets might not have effect if the theme has a specific CSS selector with higher specificity. When that happens, we really encourage theme developers to decrease their selectors specificity so Blocks styles have preference, if that's not possible, themes can write CSS resets on top.
## Hidden elements
WC Blocks use the [`hidden` HTML attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden) to hide some elements from the UI so they are not displayed in screens neither read by assistive technologies. If your theme has some generic styles that tweak the CSS display property of blocks elements (ie: `div { display: block; }`), make sure you correctly handle the hidden attribute: `div[hidden] { display: none; }`.
## Legacy classes from WooCommerce (.price, .star-rating, .button...)
WooCommerce Blocks avoids using legacy unprefixed classes as much as possible. However, you might find some of them that have been added for backwards compatibility. We still encourage themes to use the prefixed classes when possible, this avoids conflicts with other plugins, the editor, etc.

View File

@ -0,0 +1,85 @@
---
post_title: Theming for Woo blocks
menu_title: Theming for Woo Blocks
tags: reference
---
This page includes documentation about theming WooCommerce blocks and block themes.
**Note:** this document assumes some previous knowledge about block theme development and some WordPress concepts. If you are completely new to block theme development, please check [Develop Your First Low-Code Block Theme](https://learn.wordpress.org/course/develop-your-first-low-code-block-theme/)
to learn about block theme development, and explore
the [Create Block Theme plugin](https://wordpress.org/plugins/create-block-theme/) tool when you're ready to create a
new theme.
## General concepts
### Block templates
WooCommerce comes with several [block templates](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/templates/templates/blockified) by default. Those are:
- Single Product (`single-product.html`)
- Product Catalog (`archive-product.html`)
- Products by Category (`taxonomy-product_cat.html`)
- Products by Tag (`taxonomy-product_tag.html`)
- Products by Attribute (`taxonomy-product_attribute.html`)
- Product Search Results (`product-search-results.html`)
- Page: Coming soon (`page-coming-soon.html`)
- Page: Cart (`page-cart.html`)
- Page: Checkout (`page-checkout.html`)
- Order Confirmation (`order-confirmation.html`)
Block themes can customize those templates in the following ways:
- It's possible to override the templates by creating a file with the same file name under the `/templates` folder. For example, if a block theme contains a `wp-content/themes/yourtheme/templates/single-product.html` template, it will take priority over the WooCommerce default Single Product template.
- Products by Category, Products by Tag and Products by Attribute templates fall back to the Product Catalog template. In other words, if a theme provides an `archive-product.html` template but doesn't provide a `taxonomy-product_cat.html` template, the Products by Category template will use the `archive-product.html` template. Same for the Products by Tag and Products by Attribute templates.
- It's possible to create templates for specific products and taxonomies. For example, if the theme provides a template with file name of `single-product-cap.html`, that template will be used when rendering the product with slug `cap`. Similarly, themes can provide specific taxonomy templates: `taxonomy-product_cat-clothing.html` would be used in the product category with slug `clothing`.
- Always keep in mind users can make modifications to the templates provided by the theme via the Site Editor.
### Block template parts
WooCommerce also comes with two specific [block template parts](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/templates/parts):
- Mini-Cart (`mini-cart.html`): used inside the Mini-Cart block drawer.
- Checkout header (`checkout-header.html`): used as the header in the Checkout template.
Similarly to the templates, they can be overridden by themes by adding a file with the same file name under the `/parts` folder.
### Global styles
WooCommerce blocks rely on [global styles](https://developer.wordpress.org/themes/global-settings-and-styles/styles/) for their styling. Global styles can be defined by themes via `theme.json` or by users via Appearance > Editor > Styles and offer several advantages over plain CSS:
- Better performance, as only the required CSS is printed into the page, reducing the bundle size to render a page.
- Can be easily customized by users via the UI.
- Gracefully handle conflicts between plugins and themes.
- Are not affected by markup or class name updates into individual blocks or components.
- Don't depend on a specific nesting order of blocks: users can freely move blocks around without styles breaking.
#### Example
For example, let's imagine you are building a theme and would like to customize the Product Price block styles, you can do so by adding these properties in your `theme.json`:
```JSON
"styles": {
"blocks": {
"woocommerce/product-price": {
"color": {
"background": "#00cc00",
"text": "#fff"
},
"typography": {
"fontStyle": "italic",
"fontWeight": "700"
}
}
...
}
...
}
```
Before | After
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<img src="https://github.com/woocommerce/woocommerce/assets/3616980/fbc11b83-f47b-4b25-bdeb-df798b251cce" width="210" alt="Product Collection block showing the Product Price block with default styles" /> | <img src="https://github.com/woocommerce/woocommerce/assets/3616980/c9730445-b9df-4e96-8204-a10896ac2c5a" width="210" alt="Product Collection block showing the Product Price styled with background and text colors and italic and bold typography" /> <!-- markdownlint-disable-line no-inline-html -->
You can find more [documentation on global styles](https://developer.wordpress.org/themes/global-settings-and-styles/styles/) in developer.wordpress.org. You can also find the [list of WooCommerce blocks and their names in the docs](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/docs/block-references/block-references.md).

View File

@ -59,7 +59,7 @@ For our Woo extension, we'll be appending our field right at the end with `wooco
Let's get started with creating a new class which will hold the code for the field. Add a new file with the name `class-product-fields.php` to the `/includes/admin/` folder. Within the class, we add our namespace, an abort if anyone tries to call the file directly and a \_\_construct method which calls the `hooks()` method: Let's get started with creating a new class which will hold the code for the field. Add a new file with the name `class-product-fields.php` to the `/includes/admin/` folder. Within the class, we add our namespace, an abort if anyone tries to call the file directly and a \_\_construct method which calls the `hooks()` method:
```php ```php
<?php &lt;?php
namespace WooProductField\Admin; namespace WooProductField\Admin;
@ -68,7 +68,7 @@ defined( 'ABSPATH' ) || exit;
class ProductFields { class ProductFields {
public function __construct() { public function __construct() {
$this->hooks(); $this-&gt;hooks();
} }
private function hooks() {} private function hooks() {}
@ -93,19 +93,19 @@ With the class set up and being called, we can create a function to add the cust
```php ```php
public function add_field() { public function add_field() {
global $product_object; global $product_object;
?> ?&gt;
<div class="inventory_new_stock_information options_group show_if_simple show_if_variable"> &lt;div class="inventory_new_stock_information options_group show_if_simple show_if_variable"&gt;
<?php woocommerce_wp_text_input( &lt;?php woocommerce_wp_text_input(
array( array(
'id' => '_new_stock_information', 'id' =&gt; '_new_stock_information',
'label' => __( 'New Stock', 'woo_product_field' ), 'label' =&gt; __( 'New Stock', 'woo_product_field' ),
'description' => __( 'Information shown in store', 'woo_product_field' ), 'description' =&gt; __( 'Information shown in store', 'woo_product_field' ),
'desc_tip' => true, 'desc_tip' =&gt; true,
'value' => $product_object->get_meta( '_new_stock_information' ) 'value' =&gt; $product_object-&gt;get_meta( '_new_stock_information' )
) )
); ?> ); ?&gt;
</div> &lt;/div&gt;
<?php &lt;?php
} }
``` ```
@ -119,8 +119,8 @@ Now that we have our field, we need to save it. For this, we can hook into wooco
public function save_field( $post_id, $post ) { public function save_field( $post_id, $post ) {
if ( isset( $_POST['_new_stock_information'] ) ) { if ( isset( $_POST['_new_stock_information'] ) ) {
$product = wc_get_product( intval( $post_id ) ); $product = wc_get_product( intval( $post_id ) );
$product->update_meta_data( '_new_stock_information', sanitize_text_field( $_POST['_new_stock_information'] ) ); $product-&gt;update_meta_data( '_new_stock_information', sanitize_text_field( $_POST['_new_stock_information'] ) );
$product->save_meta_data(); $product-&gt;save_meta_data();
} }
} }
``` ```
@ -142,12 +142,12 @@ If we add data and save the product, then the new meta data is inserted into the
At this point you have a working extension that saves a custom field for a product as product meta. At this point you have a working extension that saves a custom field for a product as product meta.
Showing the field in the store Showing the field in the store
If we want to display the new field in our store, then we can do this with the `get_meta()` method of the Woo product class: `$product->get_meta( '\_new_stock_information' )` If we want to display the new field in our store, then we can do this with the `get_meta()` method of the Woo product class: `$product-&gt;get_meta( '\_new_stock_information' )`
Let's get started by creating a new file /includes/class-product.php. You may have noticed that this is outside the `/admin/` folder as this code will run in the front. So when we set up the class, we also adjust the namespace accordingly: Let's get started by creating a new file /includes/class-product.php. You may have noticed that this is outside the `/admin/` folder as this code will run in the front. So when we set up the class, we also adjust the namespace accordingly:
```php ```php
<?php &lt;?php
namespace WooProductField; namespace WooProductField;
@ -155,7 +155,7 @@ defined( 'ABSPATH' ) || exit;
class Product { class Product {
public function __construct() { public function __construct() {
$this->hooks(); $this-&gt;hooks();
} }
private function hooks() { } private function hooks() { }
@ -190,9 +190,9 @@ In our function we output the stock information with the [appropriate escape fun
```php ```php
public function add_stock_info() { public function add_stock_info() {
global $product; global $product;
?> ?&gt;
<p><?php echo esc_html( $product->get_meta( '_new_stock_information' ) ); ?> </p> &lt;p&gt;&lt;?php echo esc_html( $product-&gt;get_meta( '_new_stock_information' ) ); ?&gt; &lt;/p&gt;
<?php &lt;?php
} }
``` ```
@ -223,14 +223,14 @@ The setup is very similar to simple products, the main difference is that we nee
```php ```php
public function add_variation_field( $loop, $variation_data, $variation ) { public function add_variation_field( $loop, $variation_data, $variation ) {
$variation_product = wc_get_product( $variation->ID ); $variation_product = wc_get_product( $variation-&gt;ID );
woocommerce_wp_text_input( woocommerce_wp_text_input(
array( array(
'id' => '\_new_stock_information' . '[' . $loop . ']', 'id' =&gt; '\_new_stock_information' . '[' . $loop . ']',
'label' => \_\_( 'New Stock Information', 'woo_product_field' ), 'label' =&gt; \_\_( 'New Stock Information', 'woo_product_field' ),
'wrapper_class' => 'form-row form-row-full', 'wrapper_class' =&gt; 'form-row form-row-full',
'value' => $variation_product->get_meta( '\_new_stock_information' ) 'value' =&gt; $variation_product-&gt;get_meta( '\_new_stock_information' )
) )
); );
} }
@ -242,8 +242,8 @@ For saving we use:
public function save_variation_field( $variation_id, $i ) { public function save_variation_field( $variation_id, $i ) {
if ( isset( $_POST['_new_stock_information'][$i] ) ) { if ( isset( $_POST['_new_stock_information'][$i] ) ) {
$variation_product = wc_get_product( $variation_id ); $variation_product = wc_get_product( $variation_id );
$variation_product->update_meta_data( '_new_stock_information', sanitize_text_field( $_POST['_new_stock_information'][$i] ) ); $variation_product-&gt;update_meta_data( '_new_stock_information', sanitize_text_field( $_POST['_new_stock_information'][$i] ) );
$variation_product->save_meta_data(); $variation_product-&gt;save_meta_data();
} }
} }
``` ```

File diff suppressed because it is too large Load Diff

View File

@ -85,7 +85,7 @@ return (pass);
} }
# Block access to php admin pages via website # Block access to php admin pages via website
if (req.url ~ "^/phpmyadmin/.*$" || req.url ~ "^/phppgadmin/.*$" || req.url ~ "^/server-status.*$") { if (req.url ~ "^/phpmyadmin/.*$" || req.url ~ "^/phppgadmin/.*$" || req.url ~ "^/server-status.*$") {
error 403 "For security reasons, this URL is only accesible using localhost (127.0.0.1) as the hostname"; error 403 "For security reasons, this URL is only accessible using localhost (127.0.0.1) as the hostname";
} }
Add this to vcl_fetch: Add this to vcl_fetch:

View File

@ -617,7 +617,7 @@ You can use the `woocommerce_get_default_value_for_{$key}` filters to provide a
```php ```php
add_filter( add_filter(
"woocommerce_blocks_get_default_value_for_my-plugin-namespace/address-field", "woocommerce_get_default_value_for_my-plugin-namespace/address-field",
function ( $value, $group, $wc_object ) { function ( $value, $group, $wc_object ) {
if ( 'billing' === $group ) { if ( 'billing' === $group ) {
@ -633,7 +633,7 @@ add_filter(
); );
add_filter( add_filter(
"woocommerce_blocks_get_default_value_for_my-plugin-namespace/my-other-field", "woocommerce_get_default_value_for_my-plugin-namespace/my-other-field",
function ( $value, $group, $wc_object ) { function ( $value, $group, $wc_object ) {
$my_plugin_key = 'existing_order_field_key'; $my_plugin_key = 'existing_order_field_key';

View File

@ -24,7 +24,7 @@ This filter is called once for each inner block area, so it is possible to be ve
- _extensions_ `object` (default: `{}`) - The extensions object. - _extensions_ `object` (default: `{}`) - The extensions object.
- _args_ `object` - The arguments object with the following key: - _args_ `object` - The arguments object with the following key:
- _block_ `string` - The block name of the inner block area, e.g. `woocommerce/checkout-shipping-address-block`. - _block_ `string` - The block name of the inner block area, e.g. `woocommerce/checkout-shipping-address-block`.
- _validation_ `boolean` or `Error` - Checks if the returned value is an arry of strings. If an error occurs, it will be thrown. - _validation_ `boolean` or `Error` - Checks if the returned value is an array of strings. If an error occurs, it will be thrown.
### Returns <!-- omit in toc --> ### Returns <!-- omit in toc -->

View File

@ -10,41 +10,41 @@ Please note that the actions and filters here run on the server side. The client
## Legacy Filters ## Legacy Filters
- [loop_shop_per_page](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#loop_shop_per_page) - [loop_shop_per_page](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#loop_shop_per_page)
- [wc_session_expiration](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#wc_session_expiration) - [wc_session_expiration](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#wc_session_expiration)
- [woocommerce_add_cart_item](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_cart_item) - [woocommerce_add_cart_item](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_cart_item)
- [woocommerce_add_cart_item_data](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_cart_item_data) - [woocommerce_add_cart_item_data](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_cart_item_data)
- [woocommerce_add_to_cart_quantity](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_to_cart_quantity) - [woocommerce_add_to_cart_quantity](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_to_cart_quantity)
- [woocommerce_add_to_cart_sold_individually_quantity](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_to_cart_sold_individually_quantity) - [woocommerce_add_to_cart_sold_individually_quantity](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_to_cart_sold_individually_quantity)
- [woocommerce_add_to_cart_validation](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_to_cart_validation) - [woocommerce_add_to_cart_validation](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_add_to_cart_validation)
- [woocommerce_adjust_non_base_location_prices](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_adjust_non_base_location_prices) - [woocommerce_adjust_non_base_location_prices](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_adjust_non_base_location_prices)
- [woocommerce_apply_base_tax_for_local_pickup](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_apply_base_tax_for_local_pickup) - [woocommerce_apply_base_tax_for_local_pickup](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_apply_base_tax_for_local_pickup)
- [woocommerce_apply_individual_use_coupon](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_apply_individual_use_coupon) - [woocommerce_apply_individual_use_coupon](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_apply_individual_use_coupon)
- [woocommerce_apply_with_individual_use_coupon](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_apply_with_individual_use_coupon) - [woocommerce_apply_with_individual_use_coupon](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_apply_with_individual_use_coupon)
- [woocommerce_cart_contents_changed](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_cart_contents_changed) - [woocommerce_cart_contents_changed](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_cart_contents_changed)
- [woocommerce_cart_item_permalink](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_cart_item_permalink) - [woocommerce_cart_item_permalink](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_cart_item_permalink)
- [woocommerce_get_item_data](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_get_item_data) - [woocommerce_get_item_data](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_get_item_data)
- [woocommerce_loop_add_to_cart_args](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_loop_add_to_cart_args) - [woocommerce_loop_add_to_cart_args](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_loop_add_to_cart_args)
- [woocommerce_loop_add_to_cart_link](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_loop_add_to_cart_link) - [woocommerce_loop_add_to_cart_link](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_loop_add_to_cart_link)
- [woocommerce_new_customer_data](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_new_customer_data) - [woocommerce_new_customer_data](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_new_customer_data)
- [woocommerce_pay_order_product_has_enough_stock](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_pay_order_product_has_enough_stock) - [woocommerce_pay_order_product_has_enough_stock](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_pay_order_product_has_enough_stock)
- [woocommerce_pay_order_product_in_stock](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_pay_order_product_in_stock) - [woocommerce_pay_order_product_in_stock](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_pay_order_product_in_stock)
- [woocommerce_registration_errors](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_registration_errors) - [woocommerce_registration_errors](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_registration_errors)
- [woocommerce_shipping_package_name](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_shipping_package_name) - [woocommerce_shipping_package_name](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_shipping_package_name)
- [woocommerce_show_page_title](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_show_page_title) - [woocommerce_show_page_title](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_show_page_title)
- [woocommerce_single_product_image_thumbnail_html](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_single_product_image_thumbnail_html) - [woocommerce_single_product_image_thumbnail_html](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/filters.md#woocommerce_single_product_image_thumbnail_html)
## Legacy Actions ## Legacy Actions
- [woocommerce_add_to_cart](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_add_to_cart) - [woocommerce_add_to_cart](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_add_to_cart)
- [woocommerce_after_main_content](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_after_main_content) - [woocommerce_after_main_content](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_after_main_content)
- [woocommerce_after_shop_loop](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_after_shop_loop) - [woocommerce_after_shop_loop](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_after_shop_loop)
- [woocommerce_applied_coupon](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_applied_coupon) - [woocommerce_applied_coupon](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_applied_coupon)
- [woocommerce_archive_description](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_archive_description) - [woocommerce_archive_description](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_archive_description)
- [woocommerce_before_main_content](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_before_main_content) - [woocommerce_before_main_content](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_before_main_content)
- [woocommerce_before_shop_loop](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_before_shop_loop) - [woocommerce_before_shop_loop](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_before_shop_loop)
- [woocommerce_check_cart_items](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_check_cart_items) - [woocommerce_check_cart_items](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_check_cart_items)
- [woocommerce_created_customer](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_created_customer) - [woocommerce_created_customer](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_created_customer)
- [woocommerce_no_products_found](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_no_products_found) - [woocommerce_no_products_found](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_no_products_found)
- [woocommerce_register_post](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_register_post) - [woocommerce_register_post](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_register_post)
- [woocommerce_shop_loop](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_shop_loop) - [woocommerce_shop_loop](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/hooks/actions.md#woocommerce_shop_loop)

View File

@ -14,17 +14,17 @@ if ( ! function_exists( 'YOUR_PREFIX_login_message' ) ) {
*/ */
function YOUR_PREFIX_login_message() { function YOUR_PREFIX_login_message() {
if ( get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' ) { if ( get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' ) {
?> ?&gt;
<div class="woocommerce-info"> &lt;div class="woocommerce-info"&gt;
<p><?php _e( 'Returning customers login. New users register for next time so you can:', 'YOUR-TEXTDOMAIN' ); ?></p> &lt;p&gt;&lt;?php _e( 'Returning customers login. New users register for next time so you can:', 'YOUR-TEXTDOMAIN' ); ?&gt;&lt;/p&gt;
<ul> &lt;ul&gt;
<li><?php _e( 'View your order history', 'YOUR-TEXTDOMAIN' ); ?></li> &lt;li&gt;&lt;?php _e( 'View your order history', 'YOUR-TEXTDOMAIN' ); ?&gt;&lt;/li&gt;
<li><?php _e( 'Check on your orders', 'YOUR-TEXTDOMAIN' ); ?></li> &lt;li&gt;&lt;?php _e( 'Check on your orders', 'YOUR-TEXTDOMAIN' ); ?&gt;&lt;/li&gt;
<li><?php _e( 'Edit your addresses', 'YOUR-TEXTDOMAIN' ); ?></li> &lt;li&gt;&lt;?php _e( 'Edit your addresses', 'YOUR-TEXTDOMAIN' ); ?&gt;&lt;/li&gt;
<li><?php _e( 'Change your password', 'YOUR-TEXTDOMAIN' ); ?></li> &lt;li&gt;&lt;?php _e( 'Change your password', 'YOUR-TEXTDOMAIN' ); ?&gt;&lt;/li&gt;
</ul> &lt;/ul&gt;
</div> &lt;/div&gt;
<?php &lt;?php
} }
} }
add_action( 'woocommerce_before_customer_login_form', 'YOUR_PREFIX_login_message' ); add_action( 'woocommerce_before_customer_login_form', 'YOUR_PREFIX_login_message' );

View File

@ -5,8 +5,6 @@ tags: payment-methods
current wccom url: https://woocommerce.com/document/check-if-payment-gateway-supports-refunds-subscriptions-preorders/ current wccom url: https://woocommerce.com/document/check-if-payment-gateway-supports-refunds-subscriptions-preorders/
--- ---
# Check if a Payment Method Support Refunds, Subscriptions or Pre-orders
If a payment method's documentation doesnt clearly outline the supported features, you can often find what features are supported by looking at payment methods code. If a payment method's documentation doesnt clearly outline the supported features, you can often find what features are supported by looking at payment methods code.
Payment methods can add support for certain features from WooCommerce and its extensions. For example, a payment method can support refunds, subscriptions or pre-orders functionality. Payment methods can add support for certain features from WooCommerce and its extensions. For example, a payment method can support refunds, subscriptions or pre-orders functionality.
@ -41,4 +39,4 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
); );
``` ```
If you dont find `$this->supports` in the plugin files, that may mean that the payment method isnt correctly declaring support for refunds, subscripts or pre-orders. If you don't find `$this->supports` in the plugin files, that may mean that the payment method isn't correctly declaring support for refunds, subscripts or pre-orders.

View File

@ -5,15 +5,11 @@ tags: code-snippet, tax
current wccom url: https://woocommerce.com/document/setting-up-taxes-in-woocommerce/configuring-specific-tax-setups-in-woocommerce/#configuring-special-tax-setups current wccom url: https://woocommerce.com/document/setting-up-taxes-in-woocommerce/configuring-specific-tax-setups-in-woocommerce/#configuring-special-tax-setups
--- ---
# Code snippets for configuring special tax scenarios
## Scenario A: Charge the same price regardless of location and taxes ## Scenario A: Charge the same price regardless of location and taxes
Scenario A: Charge the same price regardless of location and taxes
If a store enters product prices including taxes, but levies various location-based tax rates, the prices will appear to change depending on which tax rate is applied. In reality, the base price remains the same, but the taxes influence the total. [Follow this link for a detailed explanation](https://woocommerce.com/document/how-taxes-work-in-woocommerce/#cross-border-taxes). If a store enters product prices including taxes, but levies various location-based tax rates, the prices will appear to change depending on which tax rate is applied. In reality, the base price remains the same, but the taxes influence the total. [Follow this link for a detailed explanation](https://woocommerce.com/document/how-taxes-work-in-woocommerce/#cross-border-taxes).
Some merchants prefer to dynamically change product base prices to account for the changes in taxes and so keep the total price consistent regardless of tax rate. Enable that functionality by adding the following snippet to your child themes functions.php file or via a code snippet plugin. Some merchants prefer to dynamically change product base prices to account for the changes in taxes and so keep the total price consistent regardless of tax rate. Enable that functionality by adding the following snippet to your child theme's functions.php file or via a code snippet plugin.
```php ```php
<?php <?php
@ -23,7 +19,7 @@ add_filter( 'woocommerce_adjust_non_base_location_prices', '__return_false' );
## Scenario B: Charge tax based on the subtotal amount ## Scenario B: Charge tax based on the subtotal amount
The following snippet is useful in case where a store only ads taxes when the subtotal reaches a specified minimum. In the code snippet below that minimum is 110 of the stores currency. Adjust the snippet according to your requirements. The following snippet is useful in case where a store only ads taxes when the subtotal reaches a specified minimum. In the code snippet below that minimum is 110 of the store's currency. Adjust the snippet according to your requirements.
```php ```php
<?php <?php
@ -42,7 +38,7 @@ function big_apple_get_tax_class( $tax_class, $product ) {
Some merchants may require different tax rates to be applied based on a customer role to accommodate for wholesale status or tax exemption. Some merchants may require different tax rates to be applied based on a customer role to accommodate for wholesale status or tax exemption.
To enable this functionality, add the following snippet to your child themes functions.php file or via a code snippet plugin. In this snippet, users with “administrator” capabilities will be assigned the **Zero rate tax class**. Adjust it according to your requirements. To enable this functionality, add the following snippet to your child theme's functions.php file or via a code snippet plugin. In this snippet, users with "administrator" capabilities will be assigned the **Zero rate tax class**. Adjust it according to your requirements.
```php ```php
<?php <?php
@ -62,7 +58,7 @@ add_filter( 'woocommerce_product_variation_get_tax_class', 'wc_diff_rate_for_use
## Scenario D: Show 0 value taxes ## Scenario D: Show 0 value taxes
Taxes that have 0-value are hidden by default. To show them regardless, add the following snippet to your themes functions.php file or via a code snippet plugins: Taxes that have 0-value are hidden by default. To show them regardless, add the following snippet to your theme's functions.php file or via a code snippet plugins:
```php ```php
add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' ); add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );
@ -70,7 +66,7 @@ add_filter( 'woocommerce_order_hide_zero_taxes', '__return_false' );
## Scenario E: Suffixes on the main variable product ## Scenario E: Suffixes on the main variable product
One of the tax settings for WooCommerce enables the use of suffixes to add additional information to product prices. Its available for use with the variations of a variable product, but is disabled at the main variation level as it can impact website performance when there are many variations. One of the tax settings for WooCommerce enables the use of suffixes to add additional information to product prices. It's available for use with the variations of a variable product, but is disabled at the main variation level as it can impact website performance when there are many variations.
The method responsible for the related price output can be customized via filter hooks if needed for variable products. This will require customization that can be implemented via this filter: The method responsible for the related price output can be customized via filter hooks if needed for variable products. This will require customization that can be implemented via this filter:

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

View File

@ -4,10 +4,13 @@ menu_title: Disabling marketplace suggestions
current wccom url: https://woocommerce.com/document/woocommerce-marketplace-suggestions-settings/#section-6 current wccom url: https://woocommerce.com/document/woocommerce-marketplace-suggestions-settings/#section-6
--- ---
## Disabling Marketplace Suggestions Programmatically
For those who prefer to programmatically disable marketplace suggestions that are fetched from woocommerce.com, add the `woocommerce_allow_marketplace_suggestions` filter to your themes `functions.php` or a custom plugin. For those who prefer to programmatically disable marketplace suggestions that are fetched from woocommerce.com, add the `woocommerce_allow_marketplace_suggestions` filter to your themes `functions.php` or a custom plugin.
For example: For example:
```php
add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false' );
```
This filter will completely remove Marketplace Suggestions from your WooCommerce admin. This filter will completely remove Marketplace Suggestions from your WooCommerce admin.

View File

@ -18,7 +18,7 @@ The functionality to hide all other methods, and only show Free Shipping, requir
Before adding snippets, clear your WooCommerce cache. Go to WooCommerce > System Status > Tools > WooCommerce Transients > Clear transients. Before adding snippets, clear your WooCommerce cache. Go to WooCommerce > System Status > Tools > WooCommerce Transients > Clear transients.
Add this code to your child themes `functions.php`, or via a plugin that allows custom functions to be added. Please dont add custom code directly to a parent themes `functions.php` as changes are entirely erased when a parent theme updates. Add this code to your child theme's `functions.php`, or via a plugin that allows custom functions to be added. Please don't add custom code directly to a parent theme's `functions.php` as changes are entirely erased when a parent theme updates.
## Code Snippets ## Code Snippets
@ -34,7 +34,7 @@ This means you can use `add_filter()` on `woocommerce_shipping_free_shipping_is_
### How do I only show Free Shipping? ### How do I only show Free Shipping?
The following snippet hides everything but `free_shipping`, if its available and the customer's cart qualifies. The following snippet hides everything but `free_shipping`, if it's available and the customer's cart qualifies.
```php ```php
/** /**
@ -59,7 +59,7 @@ add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_availabl
### How do I only show Local Pickup and Free Shipping? ### How do I only show Local Pickup and Free Shipping?
The snippet below hides everything but `free_shipping` and `local_pickup`, if its available and the customer's cart qualifies. The snippet below hides everything but `free_shipping` and `local_pickup`, if it's available and the customer's cart qualifies.
```php ```php

View File

@ -1,15 +1,13 @@
--- ---
post_title: Legacy Local Pickup Advanced Settings and Customization post_title: Advanced settings and customization for legacy Local Pickup
tags: code-snippet tags: code-snippet
current wccom url: https://woocommerce.com/document/local-pickup/#advanced-settings-customization current wccom url: https://woocommerce.com/document/local-pickup/#advanced-settings-customization
note: Docs links out to Skyverge's site for howto add a custom email - do we have our own alternative? note: Docs links out to Skyverge's site for howto add a custom email - do we have our own alternative?
--- ---
# Advanced settings and customization for legacy Local Pickup
## Disable local taxes when using local pickup ## Disable local taxes when using local pickup
Local Pickup calculates taxes based on your stores location (address) by default, and not the customers address. Add this snippet at the end of your theme's `functions.php` to use your standard tax configuration instead: Local Pickup calculates taxes based on your store's location (address) by default, and not the customer's address. Add this snippet at the end of your theme's `functions.php` to use your standard tax configuration instead:
```php ```php
add_filter( 'woocommerce_apply_base_tax_for_local_pickup', '__return_false' ); add_filter( 'woocommerce_apply_base_tax_for_local_pickup', '__return_false' );
@ -19,7 +17,7 @@ Regular taxes is then used when local pickup is selected, instead of store-locat
## Changing the location for local taxes ## Changing the location for local taxes
To charge local taxes based on the postcode and city of the local pickup location, you need to define the shops base city and post code using this example code: To charge local taxes based on the postcode and city of the local pickup location, you need to define the shop's base city and post code using this example code:
```php ```php
add_filter( 'woocommerce_countries_base_postcode', create_function( '', 'return "80903";' ) ); add_filter( 'woocommerce_countries_base_postcode', create_function( '', 'return "80903";' ) );
@ -33,5 +31,5 @@ Update `80903` to reflect your preferred postcode/zip, and `COLORADO SPRINGS` wi
_Shipping Address_ is not displayed on the admin order emails when Local Pickup is used as the shipping method. _Shipping Address_ is not displayed on the admin order emails when Local Pickup is used as the shipping method.
Since all core shipping options use the standard order flow, customers receive the same order confirmation email whether they select local pickup or any other shipping option. Since all core shipping options use the standard order flow, customers receive the same order confirmation email whether they select local pickup or any other shipping option.
Use this guide to create custom emails for local pickup if youd like to send a separate email for local pickup orders: [How to Add a Custom WooCommerce Email](https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/). Use this guide to create custom emails for local pickup if you'd like to send a separate email for local pickup orders: [How to Add a Custom WooCommerce Email](https://www.skyverge.com/blog/how-to-add-a-custom-woocommerce-email/).

View File

@ -5,8 +5,6 @@ tags: code-snippet
current wccom url: https://woocommerce.com/document/woocommerce-localization/#making-your-translation-upgrade-safe current wccom url: https://woocommerce.com/document/woocommerce-localization/#making-your-translation-upgrade-safe
--- ---
# Making your translation upgrade safe
Like all other plugins, WooCommerce keeps translations in `wp-content/languages/plugins`. Like all other plugins, WooCommerce keeps translations in `wp-content/languages/plugins`.
However, if you want to include a custom translation, you can add them to `wp-content/languages/woocommerce`, or you can use a snippet to load a custom translation stored elsewhere: However, if you want to include a custom translation, you can add them to `wp-content/languages/woocommerce`, or you can use a snippet to load a custom translation stored elsewhere:

View File

@ -9,7 +9,7 @@ current wccom url: https://woocommerce.com/document/ssl-and-https/#websites-behi
WooCommerce uses the `is_ssl()` WordPress function to verify if your website using SSL or not. WooCommerce uses the `is_ssl()` WordPress function to verify if your website using SSL or not.
`is_ssl()` checks if the connection is via HTTPS or on Port 443. However, this wont work for websites behind load balancers, especially websites hosted at Network Solutions. For details, read [WordPress is_ssl() function reference notes](https://codex.wordpress.org/Function_Reference/is_ssl#Notes). `is_ssl()` checks if the connection is via HTTPS or on Port 443. However, this won't work for websites behind load balancers, especially websites hosted at Network Solutions. For details, read [WordPress is_ssl() function reference notes](https://codex.wordpress.org/Function_Reference/is_ssl#Notes).
Websites behind load balancers or reverse proxies that support `HTTP_X_FORWARDED_PROTO` can be fixed by adding the following code to the `wp-config.php` file, above the require_once call: Websites behind load balancers or reverse proxies that support `HTTP_X_FORWARDED_PROTO` can be fixed by adding the following code to the `wp-config.php` file, above the require_once call:

View File

@ -5,20 +5,18 @@ tags: code-snippet
current wccom url: https://woocommerce.com/document/installing-uninstalling-woocommerce/#uninstalling-woocommerce current wccom url: https://woocommerce.com/document/installing-uninstalling-woocommerce/#uninstalling-woocommerce
--- ---
# Uninstall and remove all WooCommerce Data
The WooCommerce plugin can be uninstalled like any other WordPress plugin. By default, the WooCommerce data is left in place though. The WooCommerce plugin can be uninstalled like any other WordPress plugin. By default, the WooCommerce data is left in place though.
If you need to remove *all* WooCommerce data as well, including products, order data, coupons, etc., you need to to modify the sites `wp-config.php` *before* deactivating and deleting the WooCommerce plugin. If you need to remove *all* WooCommerce data as well, including products, order data, coupons, etc., you need to to modify the site's `wp-config.php` *before* deactivating and deleting the WooCommerce plugin.
As this action is destructive and permanent, the information is provided as is. WooCommerce Support cannot help with this process or anything that happens as a result. As this action is destructive and permanent, the information is provided as is. WooCommerce Support cannot help with this process or anything that happens as a result.
To fully remove all WooCommerce data from your WordPress site, open `wp-config.php`, scroll down to the bottom of the file, and add the following constant on its own line above `/* Thats all, stop editing. */`. To fully remove all WooCommerce data from your WordPress site, open `wp-config.php`, scroll down to the bottom of the file, and add the following constant on its own line above `/* That's all, stop editing. */`.
```php ```php
define( 'WC_REMOVE_ALL_DATA', true ); define( 'WC_REMOVE_ALL_DATA', true );
/* Thats all, stop editing! Happy publishing. */ /* That's all, stop editing! Happy publishing. */
``` ```
Then, once the changes are saved to the file, when you deactivate and delete WooCommerce, all of its data is removed from your WordPress site database. Then, once the changes are saved to the file, when you deactivate and delete WooCommerce, all of its data is removed from your WordPress site database.

View File

@ -5,8 +5,6 @@ tags: code-snippet
current wccom url: https://woocommerce.com/document/digital-downloadable-product-handling/#protecting-your-uploads-directory current wccom url: https://woocommerce.com/document/digital-downloadable-product-handling/#protecting-your-uploads-directory
--- ---
## Using NGINX server to protect your upload directory
If you using NGINX server for your site along with **X-Accel-Redirect/X-Sendfile** or **Force Downloads** download method, it is necessary that you add this configuration for better security: If you using NGINX server for your site along with **X-Accel-Redirect/X-Sendfile** or **Force Downloads** download method, it is necessary that you add this configuration for better security:
```php ```php

View File

@ -15,7 +15,7 @@ Inside each subfolder you'll find various markdown files. When imported into the
## Getting Setup ## Getting Setup
> This guide presumes that you're familar with basic Git and GitHub functionality, that you're signed into a GitHub account, and that you have Git setup locally. If you're new to GitHub, we recommend reading their [quickstart](https://docs.github.com/en/get-started/quickstart/hello-world) and [working with forks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) guides before getting started. > This guide presumes that you're familiar with basic Git and GitHub functionality, that you're signed into a GitHub account, and that you have Git setup locally. If you're new to GitHub, we recommend reading their [quickstart](https://docs.github.com/en/get-started/quickstart/hello-world) and [working with forks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) guides before getting started.
### Initial Setup ### Initial Setup
@ -33,7 +33,7 @@ Inside each subfolder you'll find various markdown files. When imported into the
6. [Open a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) that merges your branch with the WooCommerce monorepo's trunk branch. 6. [Open a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) that merges your branch with the WooCommerce monorepo's trunk branch.
* To do this, when creating the pull request, set the `base repository` to `woocommerce/woocommerce`, the `base` to `trunk`, the `head repository` to `yourgithubusername/woocommerce` and the `compare` to the branch you created (eg: `docs/improve-extension-performance`). * To do this, when creating the pull request, set the `base repository` to `woocommerce/woocommerce`, the `base` to `trunk`, the `head repository` to `yourgithubusername/woocommerce` and the `compare` to the branch you created (eg: `docs/improve-extension-performance`).
* When creating the pull request, set a descriptive title. Additionally, ensure you fill out the template provided in the description. For purely docs changes, your testing instructions should reference any major changes you think should be checked. * When creating the pull request, set a descriptive title. Additionally, ensure you fill out the template provided in the description. For purely docs changes, your testing instructions should reference any major changes you think should be checked.
7. The WooCommerce Developer Advocacy team will review your pull request and provide feedback via the comments as neccesary. Once the content is ready, we'll merge it into `trunk` and it'll appear on the Woo Developer Docs site! 7. The WooCommerce Developer Advocacy team will review your pull request and provide feedback via the comments as necessary. Once the content is ready, we'll merge it into `trunk` and it'll appear on the Woo Developer Docs site!
## Creating New Pages ## Creating New Pages
@ -127,3 +127,9 @@ These instructions presume you're currently have your `docs/` branch open and yo
If you are a non-technical contributor who isn't experienced with command line tools, we're still happy to receive your contributions. If you're unable to include an updated manifest, please ensure that you mention this in your pull request's description. If you are a non-technical contributor who isn't experienced with command line tools, we're still happy to receive your contributions. If you're unable to include an updated manifest, please ensure that you mention this in your pull request's description.
If you're a technical contributor who is able to regenerate the manifest, we request that you do so where possible. If you're a technical contributor who is able to regenerate the manifest, we request that you do so where possible.
## Caveats
* Emojis are not supported.
* Avoid copy pasting content from editors such as Google docs. For example, quotation-mark characters in these editors may not translate properly when ingested by our plugin.
* You may want to references HTML like content, however, our plugin is set up to strip non-allowlisted HTML elements. You may use an [HTML named references](https://developer.mozilla.org/en-US/docs/Glossary/Character_reference) to create an HTML like tag, by using the less-than (<) and greater-than (>) symbol named references.

View File

@ -16,7 +16,7 @@ The WooCommerce core plugin code can be found in our [monorepo](https://github.c
### Code of Conduct ### Code of Conduct
Contributing to an open source project requires cooperation amongst individuals and organziations all working to make our project a stable and safe place to build and ask questions. Please thoroughly read our [Code of Conduct](https://github.com/woocommerce/woocommerce/blob/trunk/SECURITY.md) to get familiar with our standards and processes. Contributing to an open source project requires cooperation amongst individuals and organizations all working to make our project a stable and safe place to build and ask questions. Please thoroughly read our [Code of Conduct](https://github.com/woocommerce/woocommerce/blob/trunk/SECURITY.md) to get familiar with our standards and processes.
### Contributor Guidelines ### Contributor Guidelines

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ post_title: Extensibility in blocks
These documents are all dealing with extensibility in the various WooCommerce Blocks. These documents are all dealing with extensibility in the various WooCommerce Blocks.
## Imports and dependency extration ## Imports and dependency extraction
The documentation in this section will use window globals in code examples, for example: The documentation in this section will use window globals in code examples, for example:

View File

@ -7,21 +7,27 @@ tags: reference
When developing for WordPress and WooCommerce, it's important to consider the nature and permanence of your data. This will help you decide the best way to store it. Here's a quick primer: When developing for WordPress and WooCommerce, it's important to consider the nature and permanence of your data. This will help you decide the best way to store it. Here's a quick primer:
## Transients ## Transients
If the data may not always be present (i.e., it expires), use a [transient](https://developer.wordpress.org/apis/handbook/transients/). Transients are a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted. If the data may not always be present (i.e., it expires), use a [transient](https://developer.wordpress.org/apis/handbook/transients/). Transients are a simple and standardized way of storing cached data in the database temporarily by giving it a custom name and a timeframe after which it will expire and be deleted.
## WP Cache ## WP Cache
If the data is persistent but not always present, consider using the [WP Cache](https://developer.wordpress.org/reference/classes/wp_object_cache/). The WP Cache functions allow you to cache data that is computationally expensive to regenerate, such as complex query results. If the data is persistent but not always present, consider using the [WP Cache](https://developer.wordpress.org/reference/classes/wp_object_cache/). The WP Cache functions allow you to cache data that is computationally expensive to regenerate, such as complex query results.
## wp_options Table ## wp_options Table
If the data is persistent and always present, consider the [wp_options table](https://developer.wordpress.org/apis/handbook/options/). The Options API is a simple and standardized way of storing data in the wp_options table in the WordPress database. If the data is persistent and always present, consider the [wp_options table](https://developer.wordpress.org/apis/handbook/options/). The Options API is a simple and standardized way of storing data in the wp_options table in the WordPress database.
## Post Types ## Post Types
If the data type is an entity with n units, consider a [post type](https://developer.wordpress.org/post_type/). Post types are "types" of content that are stored in the same way, but are easy to distinguish in the code and UI. If the data type is an entity with n units, consider a [post type](https://developer.wordpress.org/post_type/). Post types are "types" of content that are stored in the same way, but are easy to distinguish in the code and UI.
## Taxonomies ## Taxonomies
If the data is a means of sorting/categorizing an entity, consider a [taxonomy](https://developer.wordpress.org/taxonomy/). Taxonomies are a way of grouping things together. If the data is a means of sorting/categorizing an entity, consider a [taxonomy](https://developer.wordpress.org/taxonomy/). Taxonomies are a way of grouping things together.
## Logging ## Logging
Logs should be written to a file using the [WC_Logger](https://woocommerce.com/wc-apidocs/class-WC_Logger.html) class. This is a simple and standardized way of recording events and errors for debugging purposes. Logs should be written to a file using the [WC_Logger](https://woocommerce.com/wc-apidocs/class-WC_Logger.html) class. This is a simple and standardized way of recording events and errors for debugging purposes.
Remember, the best method of data storage depends on the nature of the data and how it will be used in your application. Remember, the best method of data storage depends on the nature of the data and how it will be used in your application.

View File

@ -26,7 +26,7 @@ Setup tasks appear on the WooCommerce Admin home screen and prompt a merchant to
To register your task as an extended task list item, you'll need to start by creating a new PHP class that extends the Task class. This class will define the properties and behavior of your custom task. To register your task as an extended task list item, you'll need to start by creating a new PHP class that extends the Task class. This class will define the properties and behavior of your custom task.
```php ```php
<?php &lt;?php
/** /**
* Custom task example. * Custom task example.
* *
@ -113,37 +113,37 @@ import {
} from '@woocommerce/onboarding'; } from '@woocommerce/onboarding';
import { registerPlugin } from '@wordpress/plugins'; import { registerPlugin } from '@wordpress/plugins';
const Task = ( { onComplete, task, query } ) => { const Task = ( { onComplete, task, query } ) =&gt; {
// Implement your task UI/feature here. // Implement your task UI/feature here.
return <div></div>; return &lt;div&gt;&lt;/div&gt;;
}; };
registerPlugin( 'add-task-content', { registerPlugin( 'add-task-content', {
render: () => ( render: () =&gt; (
<WooOnboardingTask id="my-task"> &lt;WooOnboardingTask id="my-task"&gt;
{ ( { onComplete, query, task } ) => ( { ( { onComplete, query, task } ) =&gt; (
<Task onComplete={ onComplete } task={ task } query={ query } /> &lt;Task onComplete={ onComplete } task={ task } query={ query } /&gt;
) } ) }
</WooOnboardingTask> &lt;/WooOnboardingTask&gt;
), ),
} ); } );
registerPlugin( 'add-task-list-item', { registerPlugin( 'add-task-list-item', {
scope: 'woocommerce-tasks', scope: 'woocommerce-tasks',
render: () => ( render: () =&gt; (
<WooOnboardingTaskListItem id="my-task"> &lt;WooOnboardingTaskListItem id="my-task"&gt;
{ ( { defaultTaskItem: DefaultTaskItem } ) => ( { ( { defaultTaskItem: DefaultTaskItem } ) =&gt; (
// Add a custom wrapper around the default task item. // Add a custom wrapper around the default task item.
<div &lt;div
className="woocommerce-custom-tasklist-item" className="woocommerce-custom-tasklist-item"
style={ { style={ {
border: '1px solid red', border: '1px solid red',
} } } }
> &gt;
<DefaultTaskItem /> &lt;DefaultTaskItem /&gt;
</div> &lt;/div&gt;
) } ) }
</WooOnboardingTaskListItem> &lt;/WooOnboardingTaskListItem&gt;
), ),
} ); } );
``` ```
@ -168,37 +168,37 @@ import { registerPlugin } from '@wordpress/plugins';
Next, we create a [functional component](https://reactjs.org/docs/components-and-props.html) that returns our task card. The intermixed JavaScript/HTML syntax we're using here is called JSX. If you're unfamiliar with it, you can [read more about it in the React docs](https://reactjs.org/docs/introducing-jsx.html). Next, we create a [functional component](https://reactjs.org/docs/components-and-props.html) that returns our task card. The intermixed JavaScript/HTML syntax we're using here is called JSX. If you're unfamiliar with it, you can [read more about it in the React docs](https://reactjs.org/docs/introducing-jsx.html).
```js ```js
const Task = ( { onComplete, task } ) => { const Task = ( { onComplete, task } ) =&gt; {
const { actionTask } = useDispatch( ONBOARDING_STORE_NAME ); const { actionTask } = useDispatch( ONBOARDING_STORE_NAME );
const { isActioned } = task; const { isActioned } = task;
return ( return (
<Card className="woocommerce-task-card"> &lt;Card className="woocommerce-task-card"&gt;
<CardBody> &lt;CardBody&gt;
{ __( { __(
"This task's completion status is dependent on being actioned. The action button below will action this task, while the complete button will optimistically complete the task in the task list and redirect back to the task list. Note that in this example, the task must be actioned for completion to persist.", "This task's completion status is dependent on being actioned. The action button below will action this task, while the complete button will optimistically complete the task in the task list and redirect back to the task list. Note that in this example, the task must be actioned for completion to persist.",
'plugin-domain' 'plugin-domain'
) }{ ' ' } ) }{ ' ' }
<br /> &lt;br /&gt;
<br /> &lt;br /&gt;
{ __( 'Task actioned status: ', 'plugin-domain' ) }{ ' ' } { __( 'Task actioned status: ', 'plugin-domain' ) }{ ' ' }
{ isActioned ? 'actioned' : 'not actioned' } { isActioned ? 'actioned' : 'not actioned' }
<br /> &lt;br /&gt;
<br /> &lt;br /&gt;
<div> &lt;div&gt;
<button &lt;button
onClick={ () => { onClick={ () =&gt; {
actionTask( 'my-task' ); actionTask( 'my-task' );
} } } }
> &gt;
{ __( 'Action task', 'plugin-domain' ) } { __( 'Action task', 'plugin-domain' ) }
</button> &lt;/button&gt;
<button onClick={ onComplete }> &lt;button onClick={ onComplete }&gt;
{ __( 'Complete', 'plugin-domain' ) } { __( 'Complete', 'plugin-domain' ) }
</button> &lt;/button&gt;
</div> &lt;/div&gt;
</CardBody> &lt;/CardBody&gt;
</Card> &lt;/Card&gt;
); );
}; };
``` ```
@ -211,14 +211,14 @@ Next, we register the Task component as a plugin named "add-task-content" using
```js ```js
registerPlugin( 'add-task-content', { registerPlugin( 'add-task-content', {
render: () => ( render: () =&gt; (
{ ( { { ( {
onComplete, onComplete,
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
query, query,
task, task,
} ) => } } ) =&gt; }
), ),
scope: 'woocommerce-tasks', scope: 'woocommerce-tasks',
@ -232,20 +232,20 @@ Finally, we register another plugin named "my-task-list-item-plugin." This plugi
```js ```js
registerPlugin( 'my-task-list-item-plugin', { registerPlugin( 'my-task-list-item-plugin', {
scope: 'woocommerce-tasks', scope: 'woocommerce-tasks',
render: () => ( render: () =&gt; (
<WooOnboardingTaskListItem id="my-task"> &lt;WooOnboardingTaskListItem id="my-task"&gt;
{ ( { defaultTaskItem: DefaultTaskItem } ) => ( { ( { defaultTaskItem: DefaultTaskItem } ) =&gt; (
// Add a custom wrapper around the default task item. // Add a custom wrapper around the default task item.
<div &lt;div
className="woocommerce-custom-tasklist-item" className="woocommerce-custom-tasklist-item"
style={ { style={ {
border: '1px solid red', border: '1px solid red',
} } } }
> &gt;
<DefaultTaskItem /> &lt;DefaultTaskItem /&gt;
</div> &lt;/div&gt;
) } ) }
</WooOnboardingTaskListItem> &lt;/WooOnboardingTaskListItem&gt;
), ),
} ); } );
``` ```
@ -344,7 +344,7 @@ import { addFilter } from '@wordpress/hooks';
addFilter( addFilter(
'woocommerce_admin_homescreen_quicklinks', 'woocommerce_admin_homescreen_quicklinks',
'my-extension', 'my-extension',
( quickLinks ) => { ( quickLinks ) =&gt; {
return [ return [
...quickLinks, ...quickLinks,
{ {
@ -374,7 +374,7 @@ Despite being a part of the new React-powered admin experience in WooCommerce, A
The recommended approach for using Admin Notes is to encapsulate your note within its own class that uses the [NoteTraits](https://github.com/woocommerce/woocommerce-admin/blob/831c9ff13a862f22cf53d3ae676daeabbefe90ad/src/Notes/NoteTraits.php) trait included with WooCommerce Admin. Below is a simple example of what this might look like: The recommended approach for using Admin Notes is to encapsulate your note within its own class that uses the [NoteTraits](https://github.com/woocommerce/woocommerce-admin/blob/831c9ff13a862f22cf53d3ae676daeabbefe90ad/src/Notes/NoteTraits.php) trait included with WooCommerce Admin. Below is a simple example of what this might look like:
```php ```php
<?php &lt;?php
/** /**
* Simple note provider * Simple note provider
* *
@ -423,10 +423,10 @@ class ExampleNote {
$note = new Automattic\WooCommerce\Admin\Notes\Note(); $note = new Automattic\WooCommerce\Admin\Notes\Note();
// Set our note's title. // Set our note's title.
$note->set_title( 'Getting Started' ); $note-&gt;set_title( 'Getting Started' );
// Set our note's content. // Set our note's content.
$note->set_content( $note-&gt;set_content(
sprintf( sprintf(
'Extension activated on %s.', $activated_time_formatted 'Extension activated on %s.', $activated_time_formatted
) )
@ -436,41 +436,41 @@ class ExampleNote {
// You can use this property to re-localize notes on the fly, but // You can use this property to re-localize notes on the fly, but
// that is just one use. You can store other data here too. This // that is just one use. You can store other data here too. This
// is backed by a longtext column in the database. // is backed by a longtext column in the database.
$note->set_content_data( (object) array( $note-&gt;set_content_data( (object) array(
'getting_started' => true, 'getting_started' =&gt; true,
'activated' => $activated_time, 'activated' =&gt; $activated_time,
'activated_formatted' => $activated_time_formatted 'activated_formatted' =&gt; $activated_time_formatted
) ); ) );
// Set the type of the note. Note types are defined as enum-style // Set the type of the note. Note types are defined as enum-style
// constants in the Note class. Available note types are: // constants in the Note class. Available note types are:
// error, warning, update, info, marketing. // error, warning, update, info, marketing.
$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL ); $note-&gt;set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
// Set the type of layout the note uses. Supported layout types are: // Set the type of layout the note uses. Supported layout types are:
// 'banner', 'plain', 'thumbnail' // 'banner', 'plain', 'thumbnail'
$note->set_layout( 'plain' ); $note-&gt;set_layout( 'plain' );
// Set the image for the note. This property renders as the src // Set the image for the note. This property renders as the src
// attribute for an img tag, so use a string here. // attribute for an img tag, so use a string here.
$note->set_image( '' ); $note-&gt;set_image( '' );
// Set the note name and source. You should store your extension's // Set the note name and source. You should store your extension's
// name (slug) in the source property of the note. You can use // name (slug) in the source property of the note. You can use
// the name property of the note to support multiple sub-types of // the name property of the note to support multiple sub-types of
// notes. This also gives you a handy way of namespacing your notes. // notes. This also gives you a handy way of namespacing your notes.
$note->set_source( 'inbox-note-example'); $note-&gt;set_source( 'inbox-note-example');
$note->set_name( self::NOTE_NAME ); $note-&gt;set_name( self::NOTE_NAME );
// Add action buttons to the note. A note can support 0, 1, or 2 actions. // Add action buttons to the note. A note can support 0, 1, or 2 actions.
// The first parameter is the action name, which can be used for event handling. // The first parameter is the action name, which can be used for event handling.
// The second parameter renders as the label for the button. // The second parameter renders as the label for the button.
// The third parameter is an optional URL for actions that require navigation. // The third parameter is an optional URL for actions that require navigation.
$note->add_action( $note-&gt;add_action(
'settings', 'Open Settings', '?page=wc-settings&tab=general' 'settings', 'Open Settings', '?page=wc-settings&tab=general'
); );
$note->add_action( $note-&gt;add_action(
'learn_more', 'Learn More', 'https://example.com' 'learn_more', 'Learn More', 'https://example.com'
); );
@ -559,12 +559,12 @@ Next, we'll instantiate a new `Note` object.
Once we have an instance of the Note class, we can work with its API to set its properties, starting with its title. Once we have an instance of the Note class, we can work with its API to set its properties, starting with its title.
`$note->set_title( 'Getting Started' );` `$note-&gt;set_title( 'Getting Started' );`
Then we'll use some of the timestamp data we collected above to set the note's content. Then we'll use some of the timestamp data we collected above to set the note's content.
```php ```php
$note->set_content( $note-&gt;set_content(
sprintf( sprintf(
'Extension activated on %s.', $activated_time_formatted 'Extension activated on %s.', $activated_time_formatted
) )
@ -574,41 +574,41 @@ $note->set_content(
In addition to regular content, notes also support structured content using the `content_data` property. You can use this property to re-localize notes on the fly, but that is just one use case. You can store other data here too. This is backed by a `longtext` column in the database. In addition to regular content, notes also support structured content using the `content_data` property. You can use this property to re-localize notes on the fly, but that is just one use case. You can store other data here too. This is backed by a `longtext` column in the database.
```php ```php
$note->set_content_data( (object) array( $note-&gt;set_content_data( (object) array(
'getting_started' => true, 'getting_started' =&gt; true,
'activated' => $activated_time, 'activated' =&gt; $activated_time,
'activated_formatted' => $activated_time_formatted 'activated_formatted' =&gt; $activated_time_formatted
) ); ) );
``` ```
Next, we'll set the note's `type` property. Note types are defined as enum-style class constants in the `Note` class. Available note types are _error_, _warning_, _update_, _info_, and _marketing_. When selecting a note type, be aware that the _error_ and _update_ result in the note being shown as a Store Alert, not in the Inbox. It's best to avoid using these types of notes unless you absolutely need to. Next, we'll set the note's `type` property. Note types are defined as enum-style class constants in the `Note` class. Available note types are _error_, _warning_, _update_, _info_, and _marketing_. When selecting a note type, be aware that the _error_ and _update_ result in the note being shown as a Store Alert, not in the Inbox. It's best to avoid using these types of notes unless you absolutely need to.
`$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );` `$note-&gt;set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );`
Admin Notes also support a few different layouts. You can specify `banner`, `plain`, or `thumbnail` as the layout. If you're interested in seeing the different layouts in action, take a look at [this simple plugin](https://gist.github.com/octaedro/864315edaf9c6a2a6de71d297be1ed88) that you can install to experiment with them. Admin Notes also support a few different layouts. You can specify `banner`, `plain`, or `thumbnail` as the layout. If you're interested in seeing the different layouts in action, take a look at [this simple plugin](https://gist.github.com/octaedro/864315edaf9c6a2a6de71d297be1ed88) that you can install to experiment with them.
We'll choose `plain` as our layout, but it's also the default, so we could leave this property alone and the effect would be the same. We'll choose `plain` as our layout, but it's also the default, so we could leave this property alone and the effect would be the same.
`$note->set_layout( 'plain' );` `$note-&gt;set_layout( 'plain' );`
If you have an image that you want to add to your Admin Note, you can specify it using the `set_image` function. This property ultimately renders as the `src` attribute on an `img` tag, so use a string here. If you have an image that you want to add to your Admin Note, you can specify it using the `set_image` function. This property ultimately renders as the `src` attribute on an `img` tag, so use a string here.
`$note->set_image( '' );` `$note-&gt;set_image( '' );`
Next, we'll set the values for our Admin Note's `name` and `source` properties. As a best practice, you should store your extension's name (i.e. its slug) in the `source` property of the note. You can use the `name` property to support multiple sub-types of notes. This gives you a handy way of namespacing your notes and managing them at both a high and low level. Next, we'll set the values for our Admin Note's `name` and `source` properties. As a best practice, you should store your extension's name (i.e. its slug) in the `source` property of the note. You can use the `name` property to support multiple sub-types of notes. This gives you a handy way of namespacing your notes and managing them at both a high and low level.
```php ```php
$note->set_source( 'inbox-note-example'); $note-&gt;set_source( 'inbox-note-example');
$note->set_name( self::NOTE_NAME ); $note-&gt;set_name( self::NOTE_NAME );
``` ```
Admin Notes can support 0, 1, or 2 actions (buttons). You can use these actions to capture events that trigger asynchronous processes or help the merchant navigate to a particular view to complete a step, or even simply to provide an external link for further information. The `add_action()` function takes up to three arguments. The first is the action name, which can be used for event handling, the second renders as a label for the action's button, and the third is an optional URL for actions that require navigation. Admin Notes can support 0, 1, or 2 actions (buttons). You can use these actions to capture events that trigger asynchronous processes or help the merchant navigate to a particular view to complete a step, or even simply to provide an external link for further information. The `add_action()` function takes up to three arguments. The first is the action name, which can be used for event handling, the second renders as a label for the action's button, and the third is an optional URL for actions that require navigation.
```php ```php
$note->add_action( $note-&gt;add_action(
'settings', 'Open Settings', '?page=wc-settings&tab=general' 'settings', 'Open Settings', '?page=wc-settings&tab=general'
); );
$note->add_action( $note-&gt;add_action(
'learn_more', 'Learn More', 'https://example.com' 'learn_more', 'Learn More', 'https://example.com'
); );
``` ```

View File

@ -3,7 +3,7 @@ post_title: Integrating with coming soon mode
tags: how-to, coming-soon tags: how-to, coming-soon
--- ---
This guide provides examples for third-party developers and hosting providers on how to integrate their systems with WooCommerce's coming soon mode. For more details, please read the [developer blog post](https://developer.woocommerce.com/2024/06/18/introducing-coming-soon-mode/). This guide provides examples for third-party developers and hosting providers on how to integrate their systems with WooCommerce's coming soon mode. For more details, please read the [developer blog post](https://developer.woocommerce.com/2024/06/18/introducing-coming-soon-mode/). For site visibility settings, please refer to the [admin documentation](https://woocommerce.com/document/configuring-woocommerce-settings/coming-soon-mode/).
## Introduction ## Introduction
@ -49,15 +49,15 @@ function sync_coming_soon_to_other_plugins( $old_value, $new_value, $option ) {
$is_enabled = $new_value === 'yes'; $is_enabled = $new_value === 'yes';
// Implement your logic to sync coming soon status. // Implement your logic to sync coming soon status.
if ( function_exists( 'set_your_plugin_status' ) ) { if ( function_exists( 'your_plugin_set_coming_soon' ) ) {
set_your_plugin_status( $is_enabled ); your_plugin_set_coming_soon( $is_enabled );
} }
} }
``` ```
#### Trigger from other plugins #### Trigger from other plugins
You can use the following example to enable or disable WooCommerce coming soon mode from another plugin by directy updating `woocommerce_coming_soon` option: You can use the following example to enable or disable WooCommerce coming soon mode from another plugin by directly updating `woocommerce_coming_soon` option:
```php ```php
function sync_coming_soon_from_other_plugins( $is_enabled ) { function sync_coming_soon_from_other_plugins( $is_enabled ) {
@ -84,8 +84,8 @@ function sync_coming_soon_to_other_plugins( $old_value, $new_value, $option ) {
$is_enabled = $new_value === 'yes'; $is_enabled = $new_value === 'yes';
// Implement your logic to sync coming soon status. // Implement your logic to sync coming soon status.
if ( function_exists( 'set_your_plugin_status' ) ) { if ( function_exists( 'your_plugin_set_coming_soon' ) ) {
set_your_plugin_status( $is_enabled ); your_plugin_set_coming_soon( $is_enabled );
} }
} }
@ -108,6 +108,38 @@ function sync_coming_soon_from_other_plugins( $is_enabled ) {
} }
``` ```
#### One-way binding with option override
We could also programmatically bind the coming soon option from another plugin by overriding the `woocommerce_coming_soon` option. This is advantageous since it simplifies state management and prevents possible out-of-sync issues.
In the following example, we're binding the coming soon option from another plugin by overriding the `woocommerce_coming_soon` option.
```php
add_filter( 'pre_option_woocommerce_coming_soon', 'override_option_woocommerce_coming_soon' );
function override_option_woocommerce_coming_soon( $current_value ) {
// Implement your logic to sync coming soon status.
if ( function_exists( 'your_plugin_is_coming_soon' ) ) {
return your_plugin_is_coming_soon() ? 'yes' : 'no';
}
return $current_value;
}
add_filter( 'pre_update_option_woocommerce_coming_soon', 'override_update_woocommerce_coming_soon', 10, 2 );
function override_update_woocommerce_coming_soon( $new_value, $old_value ) {
// Check user capability.
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( 'You do not have sufficient permissions to access this page.' );
}
// Implement your logic to sync coming soon status.
if ( function_exists( 'your_plugin_set_coming_soon' ) ) {
your_plugin_set_coming_soon( $new_value === 'yes' );
}
}
```
### Custom exclusions filter ### Custom exclusions filter
It is possible for developers to add custom exclusions that bypass the coming soon protection. This is useful for exclusions like always bypassing the screen on a specific IP address, or making a specific landing page available. It is possible for developers to add custom exclusions that bypass the coming soon protection. This is useful for exclusions like always bypassing the screen on a specific IP address, or making a specific landing page available.
@ -134,3 +166,35 @@ add_filter( 'woocommerce_coming_soon_exclude', function( $is_excluded ) {
return $is_excluded; return $is_excluded;
}, 10 ); }, 10 );
``` ```
#### Custom share links
The following example shows how to integrate with a custom share code. We recommend using cookies or other storage to persist the access when users navigate across the site:
```php
add_filter( 'woocommerce_coming_soon_exclude', function( $exclude ) {
// Implement your logic to get and validate share code.
if ( function_exists( 'your_plugin_get_share_code' ) && function_exists( 'your_plugin_is_valid_share_code' ) ) {
$share_code = your_plugin_get_share_code();
if ( your_plugin_is_valid_share_code( $share_code ) ) {
return true;
}
}
return $exclude;
} );
```
### Extend "Apply to store pages only" setting
When using the `Apply to store pages only` setting, you may want to add a custom page to the list of store pages which will be restricted by coming soon mode. You can use the following example to add a custom page:
```php
add_filter( 'woocommerce_store_pages', function( $pages ) {
$page = get_page_by_path( 'your-page-slug' );
if ( $page ) {
$pages[] = $page->ID;
}
return $pages;
} );
```

View File

@ -87,7 +87,7 @@ Also, we didn't see a noticeable negative performance impact when keeping synchr
### Switch to HPOS as authoritative ### Switch to HPOS as authoritative
It's time to switch to HPOS. Go to **WooCommerce > Settings > Advanced > Features** and set HPOS to be authoritative (select **Use the WooCommerce orders tables**"). It's time to switch to HPOS. Go to **WooCommerce > Settings > Advanced > Features** and set HPOS to be authoritative (select "**Use the WooCommerce orders tables**").
As mentioned above, don't turn off synchronization yet. If there are any issues, the system can be instantaneously reverted to the posts table, resulting in no downtime. As mentioned above, don't turn off synchronization yet. If there are any issues, the system can be instantaneously reverted to the posts table, resulting in no downtime.
@ -107,7 +107,7 @@ We disable sync on read first because it demands more resources. If your site is
### Switch off sync on write ### Switch off sync on write
If everything is working as expected, you can disable sync on write as well. Given sync on read was already disabled, you can disable sync altogether from the settings. As usual, go to **WooCommerce > Settings > Advanced > Features**, and uncheck **Enable compatibility mode"**. If everything is working as expected, you can disable sync on write as well. Given sync on read was already disabled, you can disable sync altogether from the settings. As usual, go to **WooCommerce > Settings > Advanced > Features**, and uncheck **"Enable compatibility mode"**.
On our high-volume site, we fully disabled sync after 1 week. We still run some manual synchronization (via `wp wc cot sync`) periodically so that we have the opportunity to fall back to posts immediately should anything happen. On our high-volume site, we fully disabled sync after 1 week. We still run some manual synchronization (via `wp wc cot sync`) periodically so that we have the opportunity to fall back to posts immediately should anything happen.
@ -118,11 +118,11 @@ Now with synchronization fully disabled, test out various critical flows, check
### Review: Phase 3 Checklist ### Review: Phase 3 Checklist
1. [ ] Plan to be online and monitoring your live site for a period of time. 1. [ ] Plan to be online and monitoring your live site for a period of time.
2. [ ] Enable synchronization with posts set as authoritative: in **WooCommerce > Settings > Advanced > Features** > select **Use the WordPress posts tables**". 2. [ ] Enable synchronization with posts set as authoritative: in **WooCommerce > Settings > Advanced > Features** > select "**Use the WordPress posts tables**".
3. [ ] Start migration via CLI using the `wp wc cot sync` command. 3. [ ] Start migration via CLI using the `wp wc cot sync` command.
4. [ ] Monitor for errors during migration; halt or resume as necessary. 4. [ ] Monitor for errors during migration; halt or resume as necessary.
5. [ ] Verify migrated data integrity using the verify command `wp wc cot verify_cot_data`. 5. [ ] Verify migrated data integrity using the verify command `wp wc cot verify_cot_data`.
6. [ ] Enable synchronization with HPOS set as authoritative: in **WooCommerce > Settings > Advanced > Features** > select Use the **WooCommerce orders tables**". 6. [ ] Enable synchronization with HPOS set as authoritative: in **WooCommerce > Settings > Advanced > Features** > select "Use the **WooCommerce orders tables**".
7. [ ] Test all critical flows, perform checkouts with multiple payment methods, and verify order data accuracy. 7. [ ] Test all critical flows, perform checkouts with multiple payment methods, and verify order data accuracy.
8. [ ] Monitor support tickets for any issues. 8. [ ] Monitor support tickets for any issues.
9. [ ] Disable synchronization on read using the provided snippet: `add_filter( 'woocommerce_hpos_enable_sync_on_read', '__return_false' );` 9. [ ] Disable synchronization on read using the provided snippet: `add_filter( 'woocommerce_hpos_enable_sync_on_read', '__return_false' );`
@ -137,4 +137,4 @@ Now with synchronization fully disabled, test out various critical flows, check
3. [ ] Regularly communicate with stakeholders regarding testing progress and outcomes. 3. [ ] Regularly communicate with stakeholders regarding testing progress and outcomes.
4. [ ] Plan for potential fallback scenarios, ensuring the ability to revert to posts if issues arise. 4. [ ] Plan for potential fallback scenarios, ensuring the ability to revert to posts if issues arise.
Did you follow this guide? Drop us a comment below to let us know how it went. Still have more questions? Reach to us on our dedicated HPOS upgrade channel in the Community Slack: [#hpos-upgrade-party](https://woocommercecommunity.slack.com/archives/C043X91E72M). If you are not yet a member of the Woo Slack Communtiy, you can join [here](https://woocommerce.com/community-slack/). Did you follow this guide? Drop us a comment below to let us know how it went. Still have more questions? Reach to us on our dedicated HPOS upgrade channel in the Community Slack: [#hpos-upgrade-party](https://woocommercecommunity.slack.com/archives/C043X91E72M). If you are not yet a member of the Woo Slack Community, you can join [here](https://woocommerce.com/community-slack/).

View File

@ -20,7 +20,7 @@ For WooCommerce extensions, performance optimization means ensuring that your co
## Benchmarking Performance ## Benchmarking Performance
Setting clear performance benchmarks is essential for development and continuous improvement of WooCommerce extensions. A recommended performance standard is achieving a Chrome Core Web Vitals "Performance" score of 90 or above on Woo Express, using tools like the [Chrome Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/). Setting clear performance benchmarks is essential for development and continuous improvement of WooCommerce extensions. A recommended performance standard is achieving a Chrome Core Web Vitals "Performance" score of 90 or above on a simple Woo site, using tools like the [Chrome Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/).
### Using Accessible Tools for Benchmarking ### Using Accessible Tools for Benchmarking

View File

@ -0,0 +1,53 @@
---
post_title: DOM Events sent from product collection block
menu_title: DOM Events
tags: how-to
---
# Product Collection - DOM Events
## `wc-blocks_product_list_rendered`
This event is triggered when Product Collection block was rendered or re-rendered (e.g. due to page change).
### `wc-blocks_product_list_rendered` - `detail` parameters
| Parameter | Type | Default value | Description |
| ------------------ | ------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collection` | string | `undefined` | Collection type. It's `undefined` for "create your own" collections as the type is not specified. For other Core collections it can be one of type: `woocommerce/product-collection/best-sellers`, `woocommerce/product-collection/featured`, `woocommerce/product-collection/new-arrivals`, `woocommerce/product-collection/on-sale`, `woocommerce/product-collection/top-rated`. For custom collections it will hold their name. |
### `wc-blocks_product_list_rendered` - Example usage
```javascript
window.document.addEventListener(
'wc-blocks_product_list_rendered',
( e ) => {
const { collection } = e.detail;
console.log( collection ) // -> collection name, e.g. woocommerce/product-collection/on-sale
}
);
```
## Event: `wc-blocks_viewed_product`
This event is triggered when some blocks are clicked in order to view product (redirect to product page).
### `wc-blocks_viewed_product` - `detail` parameters
| Parameter | Type | Default value | Description |
| ------------------ | ------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collection` | string | `undefined` | Collection type. It's `undefined` for "create your own" collections as the type is not specified. For other Core collections it can be one of type: `woocommerce/product-collection/best-sellers`, `woocommerce/product-collection/featured`, `woocommerce/product-collection/new-arrivals`, `woocommerce/product-collection/on-sale`, `woocommerce/product-collection/top-rated`. For custom collections it will hold their name. |
| `productId` | number | | Product ID |
### `wc-blocks_viewed_product` Example usage
```javascript
window.document.addEventListener(
'wc-blocks_viewed_product',
( e ) => {
const { collection, productId } = e.detail;
console.log( collection ) // -> collection name, e.g. "woocommerce/product-collection/featured" or undefined for default one
console.log( productId ) // -> product ID, e.g. 34
}
);
```

View File

@ -6,20 +6,20 @@ tags: how-to
# Register Product Collection # Register Product Collection
The `__experimentalRegisterProductCollection` function is part of the `@woocommerce/blocks-registry` package. This function allows third party developers to register a new collection. This function accepts most of the arguments that are accepted by [Block Variation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-variations/#defining-a-block-variation). The `__experimentalRegisterProductCollection` function is part of the `@woocommerce/blocks-registry` package. This function allows third party developers to register a new collection. This function accepts most of the arguments that are accepted by [Block Variation](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-variations/#defining-a-block-variation).
> [!WARNING] > [!WARNING]
> It's experimental and may change in the future. Please use it with caution. > It's experimental and may change in the future. Please use it with caution.
**There are two ways to use this function:** **There are two ways to use this function:**
1. Using `@woocommerce/dependency-extraction-webpack-plugin` in a Webpack configuration: This will allow you to import the function from the package & use it in your code. For example: 1. Using `@woocommerce/dependency-extraction-webpack-plugin` in a Webpack configuration: This will allow you to import the function from the package & use it in your code. For example:
```tsx ```tsx
import { __experimentalRegisterProductCollection } from "@woocommerce/blocks-registry"; import { __experimentalRegisterProductCollection } from "@woocommerce/blocks-registry";
``` ```
2. Using the global `wc` object: This will allow you to use the function using the global JS object without importing it. For example: 2. Using the global `wc` object: This will allow you to use the function using the global JS object without importing it. For example:
```tsx ```tsx
wc.wcBlocksRegistry.__experimentalRegisterProductCollection({ wc.wcBlocksRegistry.__experimentalRegisterProductCollection({
@ -113,7 +113,7 @@ __experimentalRegisterProductCollection({
}); });
``` ```
As you can see in the example above, we are registering a new collection with the name `woocommerce/product-collection/my-custom-collection` & title `My Custom Collection`. Here is screenshot of how it will look like: As you can see in the example above, we are registering a new collection with the name `woocommerce/product-collection/my-custom-collection` & title `My Custom Collection`. Here is screenshot of how it will look like:
![image](https://github.com/woocommerce/woocommerce/assets/16707866/7fddbc02-a6cd-494e-b2f4-13dd5ef9cf96) ![image](https://github.com/woocommerce/woocommerce/assets/16707866/7fddbc02-a6cd-494e-b2f4-13dd5ef9cf96)
### Example 2: Register a new collection with a preview ### Example 2: Register a new collection with a preview

View File

@ -6,4 +6,4 @@ post_title: Product Editor
Discover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities. Discover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities.
This handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem. This handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem.

View File

@ -20,7 +20,7 @@ add_action(
$basic_details->add_block( $basic_details->add_block(
[ [
'id' => 'example-tutorial-animal-age', 'id' => 'example-tutorial-animal-age',
// This orders the field, core fields are seperated by sums of 10. // This orders the field, core fields are separated by sums of 10.
'order' => 40, 'order' => 40,
'blockName' => 'woocommerce/product-number-field', 'blockName' => 'woocommerce/product-number-field',
'attributes' => [ 'attributes' => [

View File

@ -4,4 +4,4 @@ category_slug: quality-and-best-practices
post_title: Quality and best practices post_title: Quality and best practices
--- ---
Ensuring the quality of your WooCommerce projects is essential. This section will delve into quality exoectations, best practices, coding standards, and other methodologies to ensure your projects stand out in terms of reliability, efficiency, user experience, and more. Ensuring the quality of your WooCommerce projects is essential. This section will delve into quality expectations, best practices, coding standards, and other methodologies to ensure your projects stand out in terms of reliability, efficiency, user experience, and more.

View File

@ -56,7 +56,7 @@ These flows will continually evolve as the platform evolves with flows updated,
| Shopper | Product | Variable Product info updates depending on variation | shopper/product-variable.spec.js | | Shopper | Product | Variable Product info updates depending on variation | shopper/product-variable.spec.js |
| Shopper | Product | Add Variable Product to Cart | shopper/product-variable.spec.js | | Shopper | Product | Add Variable Product to Cart | shopper/product-variable.spec.js |
| Shopper | Product | Display up-sell product | products/product-linked-products.spec.js | | Shopper | Product | Display up-sell product | products/product-linked-products.spec.js |
| Shopper | Product | Display releated products | products/product-linked-products.spec.js | | Shopper | Product | Display related products | products/product-linked-products.spec.js |
| Shopper | Product | Display reviews | merchant/product-reviews.spec.js | | Shopper | Product | Display reviews | merchant/product-reviews.spec.js |
| Shopper | Product | Add review | merchant/product-reviews.spec.js | | Shopper | Product | Add review | merchant/product-reviews.spec.js |
| Shopper | Product | View product images | shopper/product-simple.spec.js | | Shopper | Product | View product images | shopper/product-simple.spec.js |
@ -74,7 +74,7 @@ These flows will continually evolve as the platform evolves with flows updated,
| Shopper | Cart | Display shipping options by address | shopper/calculate-shipping.spec.js | | Shopper | Cart | Display shipping options by address | shopper/calculate-shipping.spec.js |
| Shopper | Cart | View empty cart | shopper/cart.spec.js | | Shopper | Cart | View empty cart | shopper/cart.spec.js |
| Shopper | Cart | Display correct tax | shopper/cart-checkout-calculate-tax.spec.js | | Shopper | Cart | Display correct tax | shopper/cart-checkout-calculate-tax.spec.js |
| Shopper | Cart | Respect coupon usage contraints | shopper/cart-checkout-coupons.spec.js | | Shopper | Cart | Respect coupon usage constraints | shopper/cart-checkout-coupons.spec.js |
| Shopper | Cart | Display cross-sell products | products/product-linked-products.spec.js | | Shopper | Cart | Display cross-sell products | products/product-linked-products.spec.js |
| Shopper | Cart | Proceed to checkout | shopper/checkout.spec.js | | Shopper | Cart | Proceed to checkout | shopper/checkout.spec.js |
@ -92,7 +92,7 @@ These flows will continually evolve as the platform evolves with flows updated,
| Shopper | Checkout | View checkout | shopper/checkout.spec.js | | Shopper | Checkout | View checkout | shopper/checkout.spec.js |
| Shopper | Checkout | Receive warnings when form is incomplete | shopper/checkout.spec.js | | Shopper | Checkout | Receive warnings when form is incomplete | shopper/checkout.spec.js |
| Shopper | Checkout | Add billing address | shopper/checkout.spec.js | | Shopper | Checkout | Add billing address | shopper/checkout.spec.js |
| Shopper | Checkout | Respect coupon usage contraints | shopper/cart-checkout-coupons.spec.js | | Shopper | Checkout | Respect coupon usage constraints | shopper/cart-checkout-coupons.spec.js |
| Shopper | Checkout | Display correct tax in checkout | shopper/cart-checkout-calculate-tax.spec.js | | Shopper | Checkout | Display correct tax in checkout | shopper/cart-checkout-calculate-tax.spec.js |
| Shopper | Checkout | View order confirmation page | shopper/checkout.spec.js | | Shopper | Checkout | View order confirmation page | shopper/checkout.spec.js |

View File

@ -0,0 +1,19 @@
---
category_title: Review Guidelines
category_slug: review-guidelines
post_title: Review Guidelines
---
Reviews are an integral part of the online shopping experience, and people installing software pay attention to them. Prospective users of your extensions will likely consider average ratings when making software choices.
Many of today's most popular online review platforms - from Yelp business reviews, to Amazon product reviews - have a range of opinion that can be polarized, with many extremely positive and/or negative reviews, and fewer moderate opinions. This creates a "J-shaped" distribution of reviews that isn't as accurate or as helpful as could be.
WooCommerce.com and WordPress.org both feature reviews heavily, and competing extensions having a higher rating likely have the edge in user choice.
## Primary considerations around reviews
Requesting more reviews for a extension with major issues will not generate good reviews, and analyzing existing reviews will help surface areas to address before soliciting reviews.
It is extremely rare for users of WordPress plugins to leave reviews organically (.2% of users for WordPress.org leave reviews), which means that there's an untapped market of 99.8% of users of the average plugin.
These plugins are competing with other plugins on the same search terms in the WordPress.org plugin directory, and ratings are a large factor in the ranking algorithm. This is not usually a factor to the same extent on the WooCommerce Marketplace. For instance, WooCommerce's PayPal extension directly competes on all possible keywords with other PayPal extensions on the WordPress.org repository, while it does not compete with other PayPal payments extensions on the Marketplace.

View File

@ -0,0 +1,39 @@
---
post_title: How to request WooCommerce extension reviews
menu_title: Requesting reviews
---
## Methods of requesting reviews
### Admin notices
Admin notices are an industry standard method of requesting reviews, but bombarding the admin dashboard with admin notices is not effective. We recommend using restraint in the design of a notice, as well as limiting to a single notice at a time. It's very easy to overwhelm merchants with too many notices, or too intrusive notices.
#### Recommendations
* A good place for an admin notice to review an extension would be to show on the `Plugins` page and extension's settings pages.
* Include a snooze option (or multiple) on your notices with a clear expectation of when the notice will reappear.
* Admin notices should always be always be completely dismissable. They cannot only have a snooze option.
* The options presented in the notice must be phrased carefully to avoid manipulative language.
* Use consistently designed notices so the request for reviews feels like a part of your extension, and looks consistent with WooCommerce's design.
### Direct contact
#### Recommendations
* The most direct route to requesting reviews with the highest chance of being positive is to contact the customer when they are the happiest with the product.
* This can be milestone or time based, following the timing guidelines below.
* The best method for this is either an email or other direct exchange (support chat, call, etc.). This has the highest conversion rate, especially when timed properly so that the customer is happiest.
* This is also extremely effective when you are able to request feedback from specifically qualified merchants, such as merchants that have processed a certain amount with your platform, or who have shipped their first 100 orders using your fulfillment extension, or similar.
* Direct outreach is most likely to be successful if you have ways of targeting users for review requests (merchant account / usage info, etc.), as well as ways to gather the reviews, like sales or marketing teams able to email/call/chat with merchants.
## Messaging for requesting reviews
One method of requesting feedback that we recommend is using the NPS style of review solicitation. This can allow for an increase positive reviews as well as providing the opportunity to assist merchants that are struggling.
NPS-style reviews first ask the user how they rate the product (out of 5 stars), then route them based on their response:
* If they click 4 or 5 stars, ask them to leave a review.
* If they click 1, 2 or 3, tell them we're here to help & ask them to submit a support ticket.
Merchants are significantly more likely to leave a review after a positive support interaction with a support rep who explicitly asked for a review. The language "the best way to thank me is to leave a 5 star review that mentions me in it" or similar tends to work very well - people are more willing to help a person than a produc or company.

View File

@ -0,0 +1,14 @@
---
post_title: Miscellaneous guidelines and advice
menu_title: Miscellaneous guidelines
---
Contributors' names matching search terms directly will rank extremely highly on the WordPress.org plugin repo, which means that having a WordPress.org user named after your business (if that's a search term for your plugin) could tilt the scales over a competing plugin.
Constant nags and overwhelming the admin dashboard with unnecessary alerts detract from your user experience.
You can request to have reviews that are not actually feedback removed. Where this might be applicable is if the request is a simple support request, where it's obviously in the wrong spot. 1 star reviews, even if aggressive or angry, are not usually removed.
Reply to reviews! Thank the giver for offering feedback, acknowledge the issue if needed, ask for more specific feedback, or provide an update when that feedback is addressed! Your reviews are a great window into what your extension's users are actually thinking.
Having folks close to the extension's development (think developers and project managers) looking at reviews on a regular basis is a good way to ensure the customers voice is heard. 1 star reviews are among the most useful, as long as the issue is understood and addressed (if needed).

View File

@ -0,0 +1,18 @@
---
post_title: Notifying users about bug fixes and feature requests
menu_title: Notifying users about bug fixes and feature requests
---
A bug or a missing feature can be a showstopper for merchants. Bugs that pile up or popular features that are not implemented can lead to negative reviews and/or merchants churning and looking at a competitive solution.
Bugs are usually reported via support or GitHub, or you can discover them yourselves in testing.
When a critical bug is found, resolve it within a couple of days (most critical bugs should be resolved within 24 hours) and release a new plugin version promptly. Part of your release process should be to notify all stakeholders (the support team and the merchant affected) about the upcoming release.
Even though a critical bug is a great source of stress for merchants, a quick resolution makes merchants feel heard and supported - having a reliable business partner, who is keen to help in the most difficult situation, helps build a stronger relationship. Therefore, we usually ask merchants for a 5* review when we deliver a fast solution.
When you implement a new feature request and ship a new plugin version, you can follow a similar approach to bugs:
* Notify all stakeholders.
* Update the relevant request in the Feature Requests board, by sharing a public update and marking it as 'Completed'.
* For breaking releases: communicating with your marketing/relations teams to publish updates/newsletters before the release.

View File

@ -0,0 +1,33 @@
---
post_title: How to respond to negative WooCommerce extension reviews
menu_title: Responding to negative reviews
---
An unpleasant event in the merchant's journey can lead them to leave a public, negative review. These events usually are:
* a problem with the product,
* a missing product feature,
* an unhelpful reply,
* long wait times to receive a reply, or;
* combinations of the above.
When receiving a negative review, your goal should always be to turn this review around - this sounds tough, but it is really rewarding.
In the majority of cases, merchants who leave a negative review have first tried contacting support for help. This is useful knowledge, as we can read through the conversation history, understand the issue the merchant experienced and share more details with them when we reach out, even from our first reply.
The process we have seen work well is:
* Create a new response (via email, or on a public review) with subject: Regarding your recent review for xxx.
* Start by introducing yourself, for example: "Hey there, This is Andrew from the team that develops xxx".
* Use empathetic language and make it clear that this negative review had an impact on you. For example, "I read your recent review for xxx and I am worried to hear that an issue is preventing you from using this plugin as you had in mind. I'd be happy to help you resolve this!".
Compare the above sentence with: "I am sorry to hear that you experienced an issue with xxx". "I am sorry to" indicates that you are saddened by an event, but don't necessarily plan to do something about it. In comparison, in "I am worried to hear", worry indicates action. Additionally, "That you experienced an issue" can be interpreted as if the problem is mainly the merchant's fault, whereas language like "an issue is preventing you from using this plugin as you had in mind. I'd be happy to help you resolve this!" implies you and the merchant are on the same team.
* Share more details, a solution, an idea, a suggestion or an explanation.
* Urge the merchant to update the review, by highlighting how important reviews are for our team and for other merchants. Example language to do this is "We would appreciate it if you could take a couple of minutes to update your review and describe your experience with our product and support. Honest reviews are extremely helpful for other merchants who try to decide if a plugin is a right fit for them. Thank you for your contribution!".
* Include a direct link to the reviews section, so merchants can easily navigate there and change their review.
* On a follow-up communication, if the merchant has changed the review, consider saying something like: "I shared this with the rest of the team and it made everyone's day".
If the above things are true, sharing some of your procedures with merchants (highlighting how your team emphasizes and thrives on feedback) helps ensure merchants feel like you are part of their team and builds a strong relationship with them.
Even a merchant that doesn't change their review can offer a mutually beneficial discussion by learning more about their setup and offering some suggestions. These conversations help grow merchants' trust.

View File

@ -0,0 +1,31 @@
---
post_title: Utilizing WooCommerce extension feature requests
menu_title: Utilizing feature requests
---
It is important to keep track of all feature requests, and have some sort of system of record where anyone can see what kind of feedback the product is receiving over time.
We recommend a daily or bi-daily check-in, where you:
* triage new feature requests,
* celebrate positive reviews and;
* act upon negative reviews.
Carefully maintaining feature request boards (or similar system) is key, as the average board contains a lot of duplicate/spam content, requests about features that have been implemented and requests about features that will likely never be implemented. Poorly maintained boards make merchants feel unheard/neglected.
This results in more negative reviews on the premise that the product teams were not reading/listening to their feedback.
We've seen good results with the following procedures:
Starting with the most affected products, go through all open requests, reply to most/all of them and categorize them as:
* "Open", for requests that we still want more feedback,
* "Planned", for requests that we plan to implement,
* "Completed", for requests that have already been implemented and;
* "Closed", for requests that we do not plan to implement, as they are not a good fit for the product, for duplicate/spam requests and for requests that were actually support questions.
Replying to all "Open" requests is the goal, but if that's not attainable currently, make sure to reply to 100% of the requests that are closed.
For new open requests that arrive as a feature request, discuss/triage them, reply promptly, and assign a status to avoid having the board become unmanaged, and ensure merchants feel (and are) heard.
In addition to the effect a tidy board has on merchants, it also helps product teams better understand which requests are most wanted and most impactful and then plan work accordingly.

View File

@ -0,0 +1,18 @@
---
post_title: Utilizing your support team to respond to feedback
menu_title: Utilizing your support team
---
Your support team is usually the primary contact point of merchants when they contact you. Tickets and chats are the best tools we have to converse with merchants, understand pain-points about our software, listen to their feedback and analyze their feature requests. Collectively, support teams have a great understanding of the products and how people use them. This information is essential to be transferred over to product and engineering teams.
We recommend that you take the following steps to best utilize your support team:
* Create a strict internal SLA where support team requests are answered by product or engineering teams.
* Ensure you have a way for your support team to effectively report bugs to your product and engineering teams.
* When responding to your support team, avoid super-short answers, and try to explain the answer simply and concisely. This will allow the support agent to copy/paste your answer to the merchant.
* Avoid replying with statements like "no, this is not possible" or "no, this feature will not be implemented" without providing additional context about technical or product limitations.
* Regularly dedicate additional time to implement a short custom code snippets or to provide in-depth technical details about how a custom project would be implemented so that merchants can reach a solution faster if they decide to hire a dedicated WooCommerce developer. A small effort can go a long way to amaze merchants and reveal an opportunity to request a 5 star review.
* Keep support in the loop when they report a bug or request a new feature. When you release a new product version, we always consider the impact it can have on support.
* Work closely with your support team. For example, consider having a feedback hangout call every month where you can discuss product feedback and planned improvements.
With these kinds of practices in place, support teams are more willing to share feedback, issues, concerns, and questions with us. This helps maintain a closer relationship with merchants and identify pain-points early, before they become a reason for them to churn.

View File

@ -0,0 +1,24 @@
---
post_title: When to request WooCommerce extension reviews
menu_title: When to request reviews
---
The best approach to increasing our top-star reviews is to identify key moments in the merchant's journey, when they are more likely to leave a review and actively request for it.
The most distinct moments for most of our use cases are:
* When merchants feel helpless, lost, frustrated and we are able to help,
* When merchants find a bug in our code and we quickly ship a fix,
* When merchants need a feature and we notify them when it is shipped,
* When merchants feel alone and we make them feel heard and;
* When merchants contact with a question and we go out of our way to provide them with top-notch support, even if this means slightly stepping outside the official boundaries of a support policy.
Think about who is seeing the review request, and what they are doing at that time. Showing a request to a fulfillment worker just trying to ship an order isn't likely going to work well.
Outreach after a milestone works really well. Some language we've used before is "Congratulations on your xxth sale! We're delighted that WooPayments facilitated this milestone. Would you consider sharing your experience and encouraging others by reviewing our extension?".
Another way to optimally time a review request would be to setup a prompt that aligns with use patterns. For instance, if you know that most of your merchants use your extension daily, you would likely send a review request sooner than a extension that most merchants interact very sparingly with.
SaaS/Connector extensions need to be particularly careful about requesting ratings correctly, as they are the most likely to be overlooked unless there is an issue, leading to skewed ratings not representative of the actual extension.
Consider requesting feedback at the end of every single support interaction, especially in the WordPress.org support forums. One of the largest barriers to leaving a review is the requirement of a user being logged into WooCommerce.com (or WordPress.org), and the WordPress.org support forums present a good opportunity to gather these reviews. By being highly responsive in the public support forum and solving issues there, users are already logged in and able to immediately leave a review (after being requested to!).

View File

@ -23,7 +23,7 @@ cd woocommerce-admin
npm run build npm run build
``` ```
Once thats working, we can setup the extension folder ready for JavaScript development. Once that's working, we can setup the extension folder ready for JavaScript development.
```sh ```sh
npm run create-wc-extension npm run create-wc-extension

View File

@ -49,7 +49,7 @@ Insomnia is almost identical to Postman; fill in the same fields and again use b
![Insomnia](https://developer.woocommerce.com/wp-content/uploads/2023/12/insomnia.png) ![Insomnia](https://developer.woocommerce.com/wp-content/uploads/2023/12/insomnia.png)
Thats it! The API is working. That's it! The API is working.
If you have problems connecting, you may need to disable SSL verification - see the connection issues section below. If you have problems connecting, you may need to disable SSL verification - see the connection issues section below.

View File

@ -1,9 +1,9 @@
--- ---
category_title: Theme Development category_title: Classic Theme Development
category_slug: theme-development category_slug: theme-development
post_title: Theme Development post_title: Classic theme development
--- ---
Learn to design and integrate custom themes in WooCommerce, focusing on responsive design and ecommerce optimization. Learn to design and integrate custom themes in WooCommerce, focusing on responsive design and ecommerce optimization.
This document was created for use when developing classic themes. Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md). For blocks themes, see our [block theme documentation](/docs/category/block-theme-development).

View File

@ -4,120 +4,148 @@ post_title: Template structure & Overriding templates via a theme
--- ---
**Note:** this document is geared toward template development for classic themes. Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md). **NOTE** This document makes reference to classic themes which use PHP templates. If you are working on a block theme with HTML templates, [please check the Theming docs for block themes](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/docs/designers/theming/README.md).
We are unable to provide support for customizations under our [Support Policy](http://woocommerce.com/support-policy/). If you Overview
need to further customize a snippet, or extend its functionality, we highly
recommend [Codeable](https://codeable.io/?ref=z4Hnp), or a [Certified WooExpert](https://woocommerce.com/experts/).
--- ---
## Overview ## Overview
--- WooCommerce template files contain the markup and template structure for the frontend and HTML emails of your store.
Below is video walkthrough showing how one may go about updating the template files.
WooCommerce template files contain the **markup** and **template structure** for **frontend and HTML emails** of your
store.
[![Documentation for Template structure & Overriding templates via a theme](https://embed-ssl.wistia.com/deliveries/a2f57c5896505b39952aa8411a474066.jpg?image_play_button_size=2x&amp;image_crop_resized=960x540&amp;image_play_button=1&amp;image_play_button_color=694397e0)](https://woocommerce.com/document/template-structure/?wvideo=8mvl4bro0g) [![Documentation for Template structure & Overriding templates via a theme](https://embed-ssl.wistia.com/deliveries/a2f57c5896505b39952aa8411a474066.jpg?image_play_button_size=2x&amp;image_crop_resized=960x540&amp;image_play_button=1&amp;image_play_button_color=694397e0)](https://woocommerce.com/document/template-structure/?wvideo=8mvl4bro0g)
When you open these files, you will notice they all contain **hooks** that allow you to add/move content without needing
to edit template files themselves. This method protects against upgrade issues, as the template files can be left
completely untouched.
## Template List ## Template list
The various template files on your WooCommerce site can be found via an FTP client or your hosts file manager, in `/wp-content/plugins/woocommerce/templates/`. Below are links to the current and earlier versions of the WooCommerce template files on Github, where you can view the code exactly as it appears in those files:
| Latest Version | Files |
| -------------- | ----- |
| 8.9 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.9.0/plugins/woocommerce/templates) |
Below are the links to the files of all major previous WooCommerce versions:
| Version | Files |
| -------------- | ----- |
| 8.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.8.0/plugins/woocommerce/templates) |
| 8.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.7.0/plugins/woocommerce/templates) |
| 8.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.6.0/plugins/woocommerce/templates) |
| 8.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.5.0/plugins/woocommerce/templates) |
| 8.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.4.0/plugins/woocommerce/templates) |
| 8.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.3.0/plugins/woocommerce/templates) |
| 8.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.2.0/plugins/woocommerce/templates) |
| 8.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.1.0/plugins/woocommerce/templates) |
| 8.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.0.0/plugins/woocommerce/templates) |
| 7.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.9.0/plugins/woocommerce/templates) |
| 7.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.8.0/plugins/woocommerce/templates) |
| 7.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.7.0/plugins/woocommerce/templates) |
| 7.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.6.0/plugins/woocommerce/templates) |
| 7.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.5.0/plugins/woocommerce/templates) |
| 7.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.4.0/plugins/woocommerce/templates) |
| 7.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.3.0/plugins/woocommerce/templates) |
| 7.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.2.0/plugins/woocommerce/templates) |
| 7.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.1.0/plugins/woocommerce/templates) |
| 7.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.0.0/plugins/woocommerce/templates) |
| 6.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.9.0/plugins/woocommerce/templates) |
| 6.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.8.0/plugins/woocommerce/templates) |
| 6.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.7.0/plugins/woocommerce/templates) |
| 6.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.6.0/plugins/woocommerce/templates) |
| 6.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.5.0/plugins/woocommerce/templates) |
| 6.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.4.0/plugins/woocommerce/templates) |
| 6.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.3.0/plugins/woocommerce/templates) |
| 6.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.2.0/plugins/woocommerce/templates) |
| 6.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.1.0/plugins/woocommerce/templates) |
| 6.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.0.0/plugins/woocommerce/templates) |
| 5.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.9.0/templates) |
| 5.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.8.0/templates) |
| 5.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.7.0/templates) |
| 5.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.6.0/templates) |
| 5.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.5.0/templates) |
| 5.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.4.0/templates) |
| 5.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.3.0/templates) |
| 5.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.2.0/templates) |
| 5.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.1.0/templates) |
| 5.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.0.0/templates) |
| 4.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.9.0/templates) |
| 4.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.8.0/templates) |
| 4.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.7.0/templates) |
| 4.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.6.0/templates) |
| 4.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.5.0/templates) |
| 4.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.4.0/templates) |
| 4.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.3.0/templates) |
| 4.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.2.0/templates) |
| 4.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.1.0/templates) |
| 4.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.0.0/templates) |
| 3.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.9.0/templates) |
| 3.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.8.0/templates) |
| 3.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.7.0/templates) |
| 3.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.6.0/templates) |
| 3.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.5.0/templates) |
| 3.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.4.0/templates) |
| 3.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.3.0/templates) |
| 3.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.2.0/templates) |
| 3.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.1.0/templates) |
| 3.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.0.0/templates) |
| 2.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/2.6.0/templates) |
## Changing Templates via Hooks
When you open a template file, you will notice they all contain _hooks_ that allow you to add/move content without needing to edit template files themselves. Hooks are a way for one piece of code to interact/modify another piece of code at specific, pre-defined spots. This method allows implementing a code snippet that "hooks" into a particular a theme location. It avoids upgrade issues, as the template files can be left completely untouched and doesn't require a child theme to be configured.
Let's take a look at [/wp-content/plugins/woocommerce/templates/emails/admin-new-order.php](https://github.com/woocommerce/woocommerce/blob/8.9.0/plugins/woocommerce/templates/emails/admin-new-order.php) and see what a hook looks like. Starting on line 30, we see the following code, which is responsible for producing the order details section of the New Order email.
```php
/*
* @hooked WC_Emails::order_details() Shows the order details table.
* @hooked WC_Structured_Data::generate_order_data() Generates structured data.
* @hooked WC_Structured_Data::output_structured_data() Outputs structured data.
* @since 2.5.0
*/
do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email );
```
The code above outputs the block highlighted in red in the image below, which is the New Order email a shop manager receives following a successful order on their site:
![image](https://woocommerce.com/wp-content/uploads/2020/05/templating-using-hooks.webp)
A code below can be used as a starting point to build out desired functionality. It can then be added to a code snippets plugin to modify the output at that particular location in the template, without having to edit the template itself. The same goes for other hooks, wherever in the templates they may appear.
```php
add_action( 'woocommerce_email_order_details', 'my_custom_woo_function');
function my_custom_woo_function() {
/* Your code goes here */
}
```
## Changing Templates by Editing the Files
Editing files directly in a plugin or a parent theme creates the risk of causing errors that could bring a site to a grinding halt. But more importantly, any changes made in this way will disappear when the plugin or theme updates itself; a process that entirely deletes the old version and replaces it with a fresh, updated copy.
Instead, the recommended approach is to [set up a child theme](https://developer.woocommerce.com/docs/how-to-set-up-and-use-a-child-theme/), which creates a safe directory where to make overriding changes that will not be automatically updated.
For this example, let's call our child theme `storefront-child`. With `storefront-child` in place, edits can be made in an upgrade-safe way by using overrides. Copy the template into a directory within your child theme named `/storefront-child/woocommerce/` keeping the same file structure but removing the `/templates/` subdirectory.
To override the admin order notification in our example, copy `wp-content/plugins/woocommerce/templates/emails/admin-new-order.php` to `wp-content/themes/storefront-child/woocommerce/emails/admin-new-order.php`
The copied file will now override the WooCommerce default template file, so you can make any changes you wish to the copied file, and see it reflected in the resulting output.
--- ---
Template files can be found within the **/woocommerce/templates/** directory: **Note** A (desirable) side-effect of your templates being upgrade-safe is that WooCommerce core templates will update, but your custom overrides will not. You may occassionally see notices in your System Status report that says, e.g. "version 3.5.0 is out of date. The core version is 3.7.0". Should that happen, follow the Fixing Outdated WooCommerce Templates guide to bring them in line.
| Latest version | Files |
|:---------------|:-----------------------------------------------------------------------------------------------------------|
| v8.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.4.0/plugins/woocommerce/templates) |
---
<!-- markdownlint-disable MD033 -->
<details>
<summary>Expand to view files of all major previous versions</summary>
| Version | Files |
|---------|------------------------------------------------------------------------------------------------------------|
| v8.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.3.0/plugins/woocommerce/templates) |
| v8.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.2.0/plugins/woocommerce/templates) |
| v.8.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.1.0/plugins/woocommerce/templates) |
| v8.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/8.0.0/plugins/woocommerce/templates) |
| v7.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.9.0/plugins/woocommerce/templates) |
| v7.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.8.0/plugins/woocommerce/templates) |
| v7.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.7.0/plugins/woocommerce/templates) |
| v7.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.6.0/plugins/woocommerce/templates) |
| v7.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.5.0/plugins/woocommerce/templates) |
| v7.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.4.0/plugins/woocommerce/templates) |
| v7.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.3.0/plugins/woocommerce/templates) |
| v7.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.2.0/plugins/woocommerce/templates) |
| v7.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.1.0/plugins/woocommerce/templates) |
| v7.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/7.0.0/plugins/woocommerce/templates) |
| v6.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.9.0/plugins/woocommerce/templates) |
| v6.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.8.0/plugins/woocommerce/templates) |
| v6.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.7.0/plugins/woocommerce/templates) |
| v6.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.6.0/plugins/woocommerce/templates) |
| v6.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.5.0/plugins/woocommerce/templates) |
| v6.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.4.0/plugins/woocommerce/templates) |
| v6.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.3.0/plugins/woocommerce/templates) |
| v6.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.2.0/plugins/woocommerce/templates) |
| v6.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.1.0/plugins/woocommerce/templates) |
| v6.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/6.0.0/plugins/woocommerce/templates) |
| v5.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.9.0/templates) |
| v5.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.8.0/templates) |
| v5.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.7.0/templates) |
| v5.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.6.0/templates) |
| v5.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.5.0/templates) |
| v5.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.4.0/templates) |
| v5.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.3.0/templates) |
| v5.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.2.0/templates) |
| v5.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.1.0/templates) |
| v5.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/5.0.0/templates) |
| v4.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.9.0/templates) |
| v4.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.8.0/templates) |
| v4.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.7.0/templates) |
| v4.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.6.0/templates) |
| v4.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.5.0/templates) |
| v4.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.4.0/templates) |
| v4.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.3.0/templates) |
| v4.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.2.0/templates) |
| v4.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.1.0/templates) |
| v4.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/4.0.0/templates) |
| v3.9.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.9.0/templates) |
| v3.8.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.8.0/templates) |
| v3.7.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.9.0/templates) |
| v3.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.6.0/templates) |
| v3.5.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.5.0/templates) |
| v3.4.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.4.0/templates) |
| v3.3.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.3.0/templates) |
| v3.2.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.2.0/templates) |
| v3.1.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.1.0/templates) |
| v3.0.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/3.0.0/templates) |
| v2.6.0 | [View template files](https://github.com/woocommerce/woocommerce/tree/2.6.0/templates) |
</details>
<!-- markdownlint-enable MD033 -->
--- ---
## How to Edit Files ## Declare Theme Support for Custom Templates
---
Edit files in an **upgrade-safe** way using **overrides**. Copy the template into a directory within your theme named `/woocommerce` keeping the same file structure but removing the `/templates/` subdirectory.
Example: To override the admin order notification, copy: `wp-content/plugins/woocommerce/templates/emails/admin-new-order.php` to `wp-content/themes/yourtheme/woocommerce/emails/admin-new-order.php`.
The copied file will now override the WooCommerce default template file.
**Warning:** Do not edit these files within the core plugin itself as they are overwritten during the upgrade process and any customizations will be lost. For more detailed information, see [Fixing Outdated WooCommerce Templates](https://woocommerce.com/document/fix-outdated-templates-woocommerce/).
## For Custom Templates
If you are a theme developer or using a theme with custom templates, you must declare WooCommerce theme support using the `add_theme_support` function. See [Declaring WooCommerce Support in Themes](https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes) at GitHub. If you are a theme developer or using a theme with custom templates, you must declare WooCommerce theme support using the `add_theme_support` function. See [Declaring WooCommerce Support in Themes](https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes) at GitHub.
If your theme has a `woocommerce.php` file, you will be unable to override the `woocommerce/archive-product.php` custom template in your theme, as `woocommerce.php` has priority over other template files. This is intended to prevent display issues. If your theme has `woocommerce.php`, you will be unable to override `woocommerce/archive-product.php` custom template in your theme, as `woocommerce.php` has priority over other template files. This is intended to prevent display issues.
--- ---

View File

@ -7,10 +7,7 @@ menu_title: Navigation
Examples: Examples:
- If your extension is extending a component within WooCommerce, it should live within either the Extensions navigation drawer (in Woo Express stores), or directly within that category's section. - If your extension is extending a component within WooCommerce, it should live directly within that category's section.
Extensions drawer (Woo Express)
![Navigation extensions drawer](https://developer.woocommerce.com/docs/wp-content/uploads/sites/3/2024/01/Image-1224x572-1.png)
![Navigation category](https://developer.woocommerce.com/docs/wp-content/uploads/sites/3/2024/01/Image-1242x764-1.png) ![Navigation category](https://developer.woocommerce.com/docs/wp-content/uploads/sites/3/2024/01/Image-1242x764-1.png)

View File

@ -6,7 +6,7 @@
"packageManager": "pnpm@9.1.3", "packageManager": "pnpm@9.1.3",
"engines": { "engines": {
"node": "^20.11.1", "node": "^20.11.1",
"pnpm": "^9.1.0" "pnpm": "9.1.3"
}, },
"private": true, "private": true,
"repository": { "repository": {

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Fix pnpm version to 9.1.3 to avoid dependency installation issues.

View File

@ -6,7 +6,7 @@
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/admin-e2e-tests/README.md", "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/admin-e2e-tests/README.md",
"engines": { "engines": {
"node": "^20.11.1", "node": "^20.11.1",
"pnpm": "^9.1.0" "pnpm": "9.1.3"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"engines": { "engines": {
"node": "^20.11.1", "node": "^20.11.1",
"pnpm": "^9.1.0" "pnpm": "9.1.3"
}, },
"scripts": { "scripts": {
"e2e": "jest", "e2e": "jest",

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Fix pnpm version to 9.1.3 to avoid dependency installation issues.

View File

@ -6,7 +6,7 @@
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md", "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md",
"engines": { "engines": {
"node": "^20.11.1", "node": "^20.11.1",
"pnpm": "^9.1.0" "pnpm": "9.1.3"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add AnalyticsError component.

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Fix pnpm version to 9.1.3 to avoid dependency installation issues.

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Comment: Fix some comment typos.

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Add optional onclick to Plugins component

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Mark props with defaults as not required 

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Fixed missing styles on TreeSelectControl by copying from @wordpress/components/CheckboxControl and importing @wordpress/base-styles

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Update storybook file format in support with Storybook 7 story indexer.

View File

@ -6,7 +6,7 @@
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"engines": { "engines": {
"node": "^20.11.1", "node": "^20.11.1",
"pnpm": "^9.1.0" "pnpm": "9.1.3"
}, },
"keywords": [ "keywords": [
"wordpress", "wordpress",
@ -132,18 +132,10 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.5", "@babel/core": "^7.23.5",
"@babel/runtime": "^7.23.5", "@babel/runtime": "^7.23.5",
"@storybook/addon-actions": "6.5.17-alpha.0",
"@storybook/addon-console": "^1.2.3", "@storybook/addon-console": "^1.2.3",
"@storybook/addon-controls": "6.5.17-alpha.0", "@storybook/addon-docs": "7.6.19",
"@storybook/addon-docs": "6.5.17-alpha.0", "@storybook/addon-links": "7.6.19",
"@storybook/addon-knobs": "^6.4.0",
"@storybook/addon-links": "6.5.17-alpha.0",
"@storybook/addons": "6.5.17-alpha.0",
"@storybook/api": "6.5.17-alpha.0",
"@storybook/components": "6.5.17-alpha.0",
"@storybook/core-events": "6.5.17-alpha.0",
"@storybook/react": "6.5.17-alpha.0", "@storybook/react": "6.5.17-alpha.0",
"@storybook/theming": "6.5.17-alpha.0",
"@testing-library/dom": "8.11.3", "@testing-library/dom": "8.11.3",
"@testing-library/jest-dom": "5.16.2", "@testing-library/jest-dom": "5.16.2",
"@testing-library/react": "12.1.3", "@testing-library/react": "12.1.3",

View File

@ -0,0 +1,15 @@
# AnalyticsError
Standard error message with reload action used in Analytics pages.
## Usage
```jsx
<AnalyticsError />
```
### Props
Name | Type | Default | Description
--- | --- | --- | ---
`className` | String | `null` | Additional CSS classes

View File

@ -0,0 +1,47 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import PropTypes from 'prop-types';
import { createElement } from '@wordpress/element';
/**
* Internal dependencies
*/
import EmptyContent from '../../empty-content';
/**
* Component to render when there is an error in an analytics component due to data
* not being loaded or being invalid.
*
* @param {Object} props React props.
* @param {string} [props.className] Additional class name to style the component.
*/
function AnalyticsError( { className } ) {
const title = __(
'There was an error getting your stats. Please try again.',
'woocommerce'
);
const actionLabel = __( 'Reload', 'woocommerce' );
const actionCallback = () => {
// @todo Add tracking for how often an error is displayed, and the reload action is clicked.
window.location.reload();
};
return (
<EmptyContent
className={ className }
title={ title }
actionLabel={ actionLabel }
actionCallback={ actionCallback }
/>
);
}
AnalyticsError.propTypes = {
/**
* Additional class name to style the component.
*/
className: PropTypes.string,
};
export default AnalyticsError;

View File

@ -0,0 +1,19 @@
/**
* External dependencies
*/
import { createElement } from '@wordpress/element';
import { Story } from '@storybook/react';
/**
* Internal dependencies
*/
import AnalyticsError from '../';
const Template: Story = ( args ) => <AnalyticsError { ...args } />;
export const Basic = Template.bind( {} );
export default {
title: 'WooCommerce Admin/components/analytics/AnalyticsError',
component: AnalyticsError,
};

View File

@ -0,0 +1,31 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AnalyticsError should match snapshot 1`] = `
<div>
<div
class="woocommerce-empty-content"
>
<img
alt=""
class="woocommerce-empty-content__illustration"
src="data:image/svg+xml;utf8,%3Csvg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 400 400\\"%3E%3Cpath d=\\"M226.153073,88.3099993 L355.380187,301.446227 C363.970299,315.614028 359.448689,334.062961 345.280888,342.653073 C340.591108,345.496544 335.21158,347 329.727115,347 L71.2728854,347 C54.7043429,347 41.2728854,333.568542 41.2728854,317 C41.2728854,311.515534 42.7763415,306.136007 45.6198127,301.446227 L174.846927,88.3099993 C183.437039,74.1421985 201.885972,69.6205881 216.053773,78.2106999 C220.184157,80.7150022 223.64877,84.1796157 226.153073,88.3099993 Z M184.370159,153 L186.899684,255.024156 L213.459691,255.024156 L215.989216,153 L184.370159,153 Z M200.179688,307.722584 C209.770801,307.722584 217.359375,300.450201 217.359375,291.175278 C217.359375,281.900355 209.770801,274.627972 200.179688,274.627972 C190.588574,274.627972 183,281.900355 183,291.175278 C183,300.450201 190.588574,307.722584 200.179688,307.722584 Z\\" id=\\"Combined-Shape\\" stroke=\\"%23c0c0c0\\" fill=\\"%23c0c0c0\\" fill-rule=\\"nonzero\\"%3E%3C/path%3E%3C/svg%3E"
width="100"
/>
<h2
class="woocommerce-empty-content__title"
>
There was an error getting your stats. Please try again.
</h2>
<div
class="woocommerce-empty-content__actions"
>
<button
class="components-button woocommerce-empty-content__action is-primary"
type="button"
>
Reload
</button>
</div>
</div>
</div>
`;

View File

@ -0,0 +1,62 @@
/**
* External dependencies
*/
import { createElement } from '@wordpress/element';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
/**
* Internal dependencies
*/
import AnalyticsError from '..';
describe( 'AnalyticsError', () => {
// Mock window.location.reload by using a global variable
const originalLocation = window.location;
beforeAll( () => {
delete window.location;
window.location = { reload: jest.fn() };
} );
afterAll( () => {
window.location = originalLocation;
} );
it( 'displays an error message', () => {
render( <AnalyticsError /> );
expect(
screen.getByText(
'There was an error getting your stats. Please try again.'
)
).toBeInTheDocument();
} );
it( 'shows reload button', () => {
render( <AnalyticsError /> );
expect(
screen.getByRole( 'button', { name: 'Reload' } )
).toBeInTheDocument();
} );
it( 'refreshes the page when Reload Page button is clicked', () => {
const reloadMock = jest.fn();
Object.defineProperty( window.location, 'reload', {
configurable: true,
value: reloadMock,
} );
render( <AnalyticsError /> );
userEvent.click( screen.getByText( 'Reload' ) );
expect( reloadMock ).toHaveBeenCalled();
} );
it( 'should match snapshot', () => {
const { container } = render( <AnalyticsError /> );
expect( container ).toMatchSnapshot();
} );
} );

View File

@ -0,0 +1 @@
export { default as AnalyticsError } from './error';

View File

@ -7,7 +7,7 @@ import { createElement } from '@wordpress/element';
/** /**
* Internal dependencies * Internal dependencies
*/ */
import { Basic } from '../stories/index'; import { Basic } from '../stories/compare-filter.story';
import { CompareFilter } from '../index'; import { CompareFilter } from '../index';
import Search from '../../search'; import Search from '../../search';
import productAutocompleter from '../../search/autocompleters/product'; import productAutocompleter from '../../search/autocompleters/product';

Some files were not shown because too many files have changed in this diff Show More