Tell us what you are trying to do?
Is it possible to add the WooCommerce attributes taxonomy to CPTs?
I'm trying to see if I can display custom product types on a WooCommerce variable product page. When a user selects the WC product variation the CPT view will show custom products created in Toolset with those same attributes.
What is the link to your site?
dev.omrto.com/product/chicken-coop
Hi,
Thank you for contacting us and I'd be happy to assist.
WooCommerce doesn't store the attributes defined for the product variations through a single taxonomy. Instead, each attribute that is defined is treated as a separate taxonomy of its own.
For example, when WooCommerce's sample product data is imported, it comes with two attributes 'Color' and 'Size'. In the backend, two separate hidden/private taxonomies are registered for each of those attributes; 'pa_color' and 'pa_size'.
Even if you manage to attach these variation attribute taxonomies to your custom post type(s), editing them would be a challenge because they are registered as hidden/private taxonomies and so there will be no interface in the admin area to manage them for that custom post type.
Is there any specific requirement where you have to register a separate custom post type for some products? Would it be possible to add them all into the default 'Products' post type from WooCommerce and then categorized them differently, through product categories or even a separate custom taxonomy?
And as for showing the products with the same attribute taxonomies, when a product variation is selected, there is no built-in feature for this in either WooCommerce or Toolset. For this, you'll either need code customization or a third-party WooCommerce extension.
regards,
Waqar