In a recent Business Bloomer Club Slack thread, a developer was struggling to retrieve attribute IDs from WooCommerce product variations—something made more complex by the use of WPML and the Show Single Variations plugin by Iconic.
While getting the attribute slug was straightforward, converting that into a term ID or accessing the actual attribute ID for translated products wasn’t working as expected.
With multiple workarounds tested and a fair amount of debugging, the solution ended up being a mix of PHP functions and a deeper understanding of how WPML interacts with variable products and their translations. Here’s how it all unfolded.
Continue reading WooCommerce Get Product Attribute IDs with WPML