Integrating with Custom Post Types (5 posts)

  1. GideonKimani
    Posted 3 years ago #

    Is it possible to integrate WooCommerce with CPTs?
    I'm using Event Manager to create events and locations as cutom post types and I'd like to link these with categories and products in WooCommerce.
    Any ideas?


  2. Patrick Garman
    Posted 3 years ago #

    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.

  3. nuResponse
    Posted 3 years ago #

    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?

  4. Pat Gilmour
    Posted 2 years ago #

    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.


  5. aleks1217
    Posted 2 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic