Support » Plugin: WooCommerce » Integrating with Custom Post Types

Viewing 4 replies - 1 through 4 (of 4 total)
  • Products are a custom post type themselves, and the categories/tags are custom taxonomies. I’m not sure exactly what your ultimate goal is, so I’m not sure how to suggest linking these all together.

    Did you find a solution? I’m attempting to do the same thing. I’ve spent days and days trying to figure out how to do this.

    1. I added a custom field to the Woocommerce CPT: shop_order.
    2. I then added a new field to the checkout form using action hook ‘woocommerce_after_order_notes’. This field is a select (dropdown) of all custom post types… that the logged in user is the “author” of.
    3. I then made the new field on the checkout form required using action hook ‘woocommerce_checkout_process’.
    4. Then I update_post_meta(), on the shop_order Custom Post Type. So it now has the ID of the linked Service_Profile (CPT).
    5. I’m now building fields on the Service_Profile CPT to display things like: Subscription Status, Subscription ID, Amount, etc…

    I will be using action hooks from the subscriptions plugin, like ‘subscriptions_activated_for_order’, in order to update post_meta on my CPT’s.

    The last step will be to only display the CPT (Service Profiles) on the front of the site if the custom_field showing subscription status is “Active”.

    It would be great if someone could explain to me how to just turn my CPT into products, so I could just have everything built into 1 custom post type… instead of 2 linked ones.

    Does anyone else have a suggestion on how to do this better?

    GideonKimani, nuResponse,

    Did either or you ever resolve this? I’m in the same boat now, trying to link WooCommerce products to a data set of external serial numbers stored as a CPT.


    This sounds useful to me, as well. I need to link my product (a subscription) to an array of products (meals) which are grouped through a custom post type (weekly changing menu).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Integrating with Custom Post Types’ is closed to new replies.