diff --git a/changelog.txt b/changelog.txt index f5b4dd1a..2bb5e2af 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,17 @@ *** WooCommerce Square Changelog *** -= 4.7.3 - 2024-08-13 = += 4.8.0 - 2024-09-16 = +* Add - Support for the WooCommerce Product Block Editor. +* Fix - Address a potential infinite loop issue with the `pull_inventory` step when running a manual synchronization. +* Fix - Cancelling Google Pay on checkout shows validation errors. +* Fix - Missing gift card order item meta during re-order. +* Fix - Ensure we don't hardcode the database prefix in queries we run. +* Fix - Replace the use of deprecated hook `wcs_renewal_order_meta` with `wc_subscriptions_renewal_order_data`. +* Update - Change the business location button text based on the location count. +* Dev - Bump WooCommerce "tested up to" version 9.2. +* Dev - Bump WooCommerce minimum supported version to 9.0. + += 4.7.3 - 2024-08-19 = * Fix - Inconsistency in the height of Express Payment Button and compliance with the new Woo Express Payment Method Styling API. * Fix - Ensure the "Uncaught TypeError" JavaScript console error does not occur for out-of-stock products. * Fix - Ensure compatibility with WooPayments extension. diff --git a/includes/Admin/Product_Editor_Compatibility.php b/includes/Admin/Product_Editor_Compatibility.php index f4e2eeba..56314507 100644 --- a/includes/Admin/Product_Editor_Compatibility.php +++ b/includes/Admin/Product_Editor_Compatibility.php @@ -43,8 +43,8 @@ public function __construct() { ); add_action( - 'woocommerce_block_template_area_product-form_after_add_block_product-sku-field', - array( $this, 'add_inventory_control' ) + 'woocommerce_block_template_area_product-form_after_add_block_product-track-stock', + array( $this, 'add_inventory_control' ), ); add_action( diff --git a/package-lock.json b/package-lock.json index e5af2940..50926d38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "woocommerce-square", - "version": "4.7.3", + "version": "4.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "woocommerce-square", - "version": "4.7.3", + "version": "4.8.0", "license": "GPL-3.0-or-later", "dependencies": { "@codeamp/block-components": "^0.0.1-beta.13", diff --git a/package.json b/package.json index d776cbdc..f614e53e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "git://github.com/woocommerce/woocommerce-square.git" }, "title": "WooCommerce Square", - "version": "4.7.3", + "version": "4.8.0", "homepage": "https://woocommerce.com/products/woocommerce-square/", "scripts": { "build": "composer install --no-dev && npm run build:webpack && npm run makepot && npm run archive", diff --git a/readme.txt b/readme.txt index 4d110d7c..728042b8 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: credit card, square, woocommerce, inventory sync Requires at least: 6.4 Tested up to: 6.6 Requires PHP: 7.4 -Stable tag: 4.7.3 +Stable tag: 4.8.0 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -72,7 +72,18 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o == Changelog == -= 4.7.3 - 2024-08-13 = += 4.8.0 - 2024-09-16 = +* Add - Support for the WooCommerce Product Block Editor. +* Fix - Address a potential infinite loop issue with the `pull_inventory` step when running a manual synchronization. +* Fix - Cancelling Google Pay on checkout shows validation errors. +* Fix - Missing gift card order item meta during re-order. +* Fix - Ensure we don't hardcode the database prefix in queries we run. +* Fix - Replace the use of deprecated hook `wcs_renewal_order_meta` with `wc_subscriptions_renewal_order_data`. +* Update - Change the business location button text based on the location count. +* Dev - Bump WooCommerce "tested up to" version 9.2. +* Dev - Bump WooCommerce minimum supported version to 9.0. + += 4.7.3 - 2024-08-19 = * Fix - Inconsistency in the height of Express Payment Button and compliance with the new Woo Express Payment Method Styling API. * Fix - Ensure the "Uncaught TypeError" JavaScript console error does not occur for out-of-stock products. * Fix - Ensure compatibility with WooPayments extension. diff --git a/tests/e2e/config/env-post-setup.sh b/tests/e2e/config/env-post-setup.sh index eea6b370..4533ec1c 100755 --- a/tests/e2e/config/env-post-setup.sh +++ b/tests/e2e/config/env-post-setup.sh @@ -12,3 +12,6 @@ wp-env run tests-cli wp theme activate storefront # Enable the Square gateway. wp-env run tests-cli wp wc payment_gateway update square_credit_card --user=1 --enabled=1 wp-env run tests-cli wp transient delete --all + +# Keep using old product editor. +wp-env run tests-cli wp option update woocommerce_feature_product_block_editor_enabled no --user=1 diff --git a/tests/e2e/specs/d6.woo-sor.spec-with-inventory-new-editor.spec.js b/tests/e2e/specs/d6.woo-sor.spec-with-inventory-new-editor.spec.js index 69f35082..42c76a89 100644 --- a/tests/e2e/specs/d6.woo-sor.spec-with-inventory-new-editor.spec.js +++ b/tests/e2e/specs/d6.woo-sor.spec-with-inventory-new-editor.spec.js @@ -18,11 +18,20 @@ test.beforeAll( 'Setup', async ( { baseURL } ) => { const page = await browser.newPage(); await clearSync( page ); + + await browser.close(); +} ); + +test( 'OnePlus 8 pushed to Square with inventory', async ( { page, baseURL } ) => { + test.slow(); + await deleteAllCatalogItems(); await page.goto( '/wp-admin/admin.php?page=wc-settings&tab=square§ion' ); - await page.locator( '#wc_square_system_of_record' ).selectOption( { label: 'WooCommerce' } ); - await page.locator( '#wc_square_enable_inventory_sync' ).check(); - await page.locator( '.woocommerce-save-button' ).click(); + await page.getByTestId( 'sync-settings-field' ).selectOption( { label: 'WooCommerce' } ); + await page.getByTestId( 'push-inventory-field' ).check(); + await page.getByTestId( 'square-settings-save-button' ).click(); + + await expect( await page.getByText( 'Changes Saved!' ) ).toBeVisible(); if ( ! ( await doesProductExist( baseURL, 'oneplus-8' ) ) ) { await createProduct( @@ -50,20 +59,9 @@ test.beforeAll( 'Setup', async ( { baseURL } ) => { .filter( { hasText: 'Publish' } ) .click(); - await page - .locator( '.woocommerce-product-publish-panel__header .components-button' ) - .filter( { hasText: 'Publish' } ) - .click(); - - await expect( await page.getByText( 'OnePlus 8 is now live.' ) ).toBeVisible(); + await expect( await page.getByText( 'Product published.' ).first() ).toBeVisible(); } - await browser.close(); -} ); - -test( 'OnePlus 8 pushed to Square with inventory', async ( { page } ) => { - test.slow(); - await page.goto( '/wp-admin/admin.php?page=wc-settings&tab=square§ion=update' ); const result = await new Promise( ( resolve ) => { diff --git a/tests/e2e/specs/f1.pre-orders.spec.js b/tests/e2e/specs/f1.pre-orders.spec.js index d1498174..51a15349 100644 --- a/tests/e2e/specs/f1.pre-orders.spec.js +++ b/tests/e2e/specs/f1.pre-orders.spec.js @@ -18,6 +18,7 @@ import { selectPaymentMethod, placeCashAppPayOrder, savePaymentGatewaySettings, + runWpCliCommand, } from '../utils/helper'; const iPhone = devices['iPhone 14 Pro Max']; @@ -43,6 +44,10 @@ test.describe('Pre-Orders Tests', () => { await saveCashAppPaySettings(page, { transactionType: 'charge', }); + + await runWpCliCommand( + 'wp option update woocommerce_feature_product_block_editor_enabled "no"' + ); }); test('[Charge upon release] Square Credit Card should work with Pre-Orders', async ({ diff --git a/tests/e2e/utils/helper.js b/tests/e2e/utils/helper.js index d5d6429c..2cdbefed 100644 --- a/tests/e2e/utils/helper.js +++ b/tests/e2e/utils/helper.js @@ -63,8 +63,12 @@ export async function createProduct( page, product, save = true, newEditor = fal if ( newEditor ) { await page.goto( '/wp-admin/admin.php?page=wc-settings&tab=advanced§ion=features' ); await page.locator( '#woocommerce_feature_product_block_editor_enabled' ).check(); - await page.locator( '.woocommerce-save-button' ).click(); - await expect( await page.getByText( 'Your settings have been saved' ) ).toBeVisible(); + + const saveButton = await page.locator( '.woocommerce-save-button' ); + if ( ! await saveButton.isDisabled() ) { + saveButton.click(); + await expect( await page.getByText( 'Your settings have been saved' ) ).toBeVisible(); + } await page.goto( '/wp-admin/admin.php?page=wc-admin&path=%2Fadd-product' ); @@ -72,7 +76,6 @@ export async function createProduct( page, product, save = true, newEditor = fal await page.locator( '[data-template-block-id="product-name"] input[name="name"]' ).fill( product.name ); - await page.locator( '#woocommerce-product-tab__pricing' ).click(); await page.locator( 'input[name="regular_price"]' ).fill( product.regularPrice ); await page.locator( '#woocommerce-product-tab__inventory' ).click(); diff --git a/woocommerce-square.php b/woocommerce-square.php index 634fe475..63414e25 100644 --- a/woocommerce-square.php +++ b/woocommerce-square.php @@ -2,7 +2,7 @@ /** * Plugin Name: WooCommerce Square * Requires Plugins: woocommerce - * Version: 4.7.3 + * Version: 4.8.0 * Plugin URI: https://woocommerce.com/products/square/ * Requires at least: 6.4 * Tested up to: 6.6 @@ -29,7 +29,7 @@ defined( 'ABSPATH' ) || exit; if ( ! defined( 'WC_SQUARE_PLUGIN_VERSION' ) ) { - define( 'WC_SQUARE_PLUGIN_VERSION', '4.7.3' ); // WRCS: DEFINED_VERSION. + define( 'WC_SQUARE_PLUGIN_VERSION', '4.8.0' ); // WRCS: DEFINED_VERSION. } if ( ! defined( 'WC_SQUARE_PLUGIN_URL' ) ) {