Skip to content

Rewrite product attribute helper using new filter#222

Open
Ninos wants to merge 1 commit intovendidero:masterfrom
Ninos:feature/woocommerce-rewrite-62572
Open

Rewrite product attribute helper using new filter#222
Ninos wants to merge 1 commit intovendidero:masterfrom
Ninos:feature/woocommerce-rewrite-62572

Conversation

@Ninos
Copy link
Copy Markdown

@Ninos Ninos commented Feb 1, 2026

After following woocommerce PR (woocommerce/woocommerce#62572) it's "now" (in WC >= 10.6) easier to update product attributes.

So thx for your crazy workaround here, but following quote in your code is (happily) no longer valid :D

// This is the only nice way to update attributes after Woo has updated product attributes

TODO

The helper class includes following function get_attribute(), which is using WC_GZD_Product_Attribute, I'm not sure if it's possible to remove this part without breaking anything. In my opinion the whole WC_GZD_Product_Attribute class should be removed (also used somewhere in importer script).

PS: WC 10.6 is still not released & this would also break compatibility with instances updating germanized but not woocommerce. So we may should wait a while before merging... :'D

@dennisnissle
Copy link
Copy Markdown
Collaborator

Hi @Ninos,

thanks for your work on making this easier to achieve :) We will definitely need a backwards compatibility here for WooCommerce < 10.6 so we might need to add some checks whether the current version already has those changes implemented or not and leave the original implementation in tact for some time.

Best,
Dennis

@Ninos Ninos force-pushed the feature/woocommerce-rewrite-62572 branch 2 times, most recently from e71c21e to adff655 Compare February 4, 2026 17:11
@Ninos
Copy link
Copy Markdown
Author

Ninos commented Feb 4, 2026

@dennisnissle yeah good point! Added some fallback to the static instance() function & also removed the unnessessary get_attribute() method (still in use by the deprecated helper class).

Tested this PR in combination with my patched woocommerce version, seems working fine. Haven't tested following:

  • deprecated routine (still working fine with wc < 10.6.0?)
  • product import/export

@Ninos Ninos force-pushed the feature/woocommerce-rewrite-62572 branch from adff655 to 4b1c719 Compare February 4, 2026 17:28
@Ninos Ninos force-pushed the feature/woocommerce-rewrite-62572 branch from 4b1c719 to 140d7bc Compare February 4, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants