Adjusts WCProductAdapter.php to map the GTIN field from WooCommerce core if it's available. This is checked after the attribute mapping rules and Google for WooCommerce attributes as we want to prioritise the core field.
We return early if the product does not have a get_global_unique_id method to maintain backwards compatibility.
Changes proposed in this Pull Request:
Closes #2614
Adjusts
WCProductAdapter.php
to map the GTIN field from WooCommerce core if it's available. This is checked after the attribute mapping rules and Google for WooCommerce attributes as we want to prioritise the core field.We return early if the product does not have a
get_global_unique_id
method to maintain backwards compatibility.Screenshots:
Detailed test instructions:
update/2614-prioritise-core-gtin-field-in-product-adapter
GTIN
field on theInventory
tabGTIN
field on theGoogle for WooCommerce
tabwp-admin/admin.php?page=connection-test-admin-page
and sync the product to GoogleInventory
tabInventory
tabGoogle for WooCommerce
tabGoogle for WooCommerce
tabChangelog entry