google-listings-and-ads
google-listings-and-ads copied to clipboard
Hide `GTIN` field for new installs make readonly for existing installs
Changes proposed in this Pull Request:
Adds restrictions to the GTIN
field in Google for WooCommerce depending on the version of WooCommerce installed and what version of Google for WooCommerce was first installed.
The following conditions apply:
- If WooCommerce
9.2.0
or higher is installed and Google for WooCommerce is installed for the first time theGTIN
field in G4W is hidden - If WooCommerce
9.2.0
or higher is installed and Google for WooCommerce had already been installed on a website then theGTIN
field in G4W is read-only - If any version of WooCommerce lower than
9.2.0
is installed then theGTIN
field in G4W continues to function as it previously did
Additionally, a new option is added called INSTALL_VERSION
for tracking what version of Google for WooCommerce was first installed on a website 43a76c3.
Closes #2615
Screenshots:
Detailed test instructions:
- Checkout
update/2615-hide-gtin-for-new-users-make-readonly-for-exisitng
on a site with WC9.1.0
installed that has already onboarded with Google for WooCommerce - Add or edit a product and confirm that the
GTIN
field is available on theGoogle for WooCommerce
tab - Update WooCommerce to version
9.2.0
or higher - Add or edit a product and confirm that the
GTIN
field is read-only and the tooltip directs merchants to theInventory
tab - Install the extension from this branch on a new test site and go through onboarding
- Alternatively, run the following WP Cli command to simulate the first install
wp option update gla_install_version 2.8.4
- Alternatively, run the following WP Cli command to simulate the first install
- Confirm that the
GTIN
field is not displayed on theGoogle for WooCommerce
tab when editing a product
Changelog entry
Update - Restrict the GTIN field based on the version of WooCommerce installed and the initial version of G4W installed