Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/205
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter authored Sep 18, 2024
2 parents dc5f405 + ccd4ebf commit afab547
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 38 deletions.
13 changes: 12 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions includes/Admin/Product_Editor_Compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
59 changes: 47 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 13 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/config/env-post-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 13 additions & 15 deletions tests/e2e/specs/d6.woo-sor.spec-with-inventory-new-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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&section' );
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(
Expand Down Expand Up @@ -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&section=update' );

const result = await new Promise( ( resolve ) => {
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/specs/f1.pre-orders.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
selectPaymentMethod,
placeCashAppPayOrder,
savePaymentGatewaySettings,
runWpCliCommand,
} from '../utils/helper';
const iPhone = devices['iPhone 14 Pro Max'];

Expand All @@ -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 ({
Expand Down
9 changes: 6 additions & 3 deletions tests/e2e/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,19 @@ export async function createProduct( page, product, save = true, newEditor = fal
if ( newEditor ) {
await page.goto( '/wp-admin/admin.php?page=wc-settings&tab=advanced&section=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' );

await page.locator( '#woocommerce-product-tab__general' ).click();

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();
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-square.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' ) ) {
Expand Down

0 comments on commit afab547

Please sign in to comment.