Skip Navigation

[Resolved] WooCommerce products related to CPT products via attributes (related products)

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2533153

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

#2533693

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