Per a discussion with JJJ, this was working at one point but is no longer fully-functional.
A great scenario is using a WooCommerce shop for free/paid events, where the products are the events. This is already working with the following code:
/**
* Allows WooCommerce Products to work as Sugar Calendar Events.
* Registers Event Categories to Products.
*
* @return void
*/
add_action( 'init', function() {
// Throws errors.
// unregister_post_type( 'sc_event' );
// Enable events on products.
add_post_type_support( 'product', 'events' );
// Enable event categories to products.
register_taxonomy_for_object_type( 'sc_event_category', 'product' );
}, 999 );
This gives us 2 issues:
Custom taxonomy archives (calendars taxonomy, product categories, etc.) all show 0 events/products. The main calendar view does work correctly.
Feeds via the Custom Feeds add-on are all empty. There are no events in them.
After some digging, it looks like the post_type is hard-coded in sugar_calendar_get_event_post_type_id() function. Calendar Feeds add-on uses get_ical_url() function as the core function when generating all feeds, and that function uses sugar_calendar_get_event_post_type_id() to build the feeds from the post type data.
I hard-coded sugar_calendar_get_event_post_type_id() to return product and it didn’t fully work either, though I only tested briefly.
This would be an extremely powerful feature IMO and possibly a nice add-on for full Woo compatibility. It opens a huge door for a powerful paid event management system.
Per a discussion with JJJ, this was working at one point but is no longer fully-functional.
A great scenario is using a WooCommerce shop for free/paid events, where the products are the events. This is already working with the following code:
This gives us 2 issues:
After some digging, it looks like the post_type is hard-coded in
sugar_calendar_get_event_post_type_id()
function. Calendar Feeds add-on usesget_ical_url()
function as the core function when generating all feeds, and that function usessugar_calendar_get_event_post_type_id()
to build the feeds from the post type data.I hard-coded
sugar_calendar_get_event_post_type_id()
to returnproduct
and it didn’t fully work either, though I only tested briefly.This would be an extremely powerful feature IMO and possibly a nice add-on for full Woo compatibility. It opens a huge door for a powerful paid event management system.