Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Fooevents – Product Type Specific Category Setup
Tagged: fooevents
- This topic has 8 replies, 2 voices, and was last updated 3 years, 6 months ago by
kaloomee.
- AuthorPosts
- September 16, 2019 at 3:50 pm #81942
kaloomee
ParticipantHI
1 – With Woocommerce subscriptions I am able to set Product Type Specific Categories in ‘Product Type Specific Category Setup’
Example – Set to :- Any product listed as a ‘Product type’ ‘subscription’ can only be located in custom category ‘Subscriptions’.How is this achievable with events? – I would like so that if a listing is an event, it can only be listed in category ‘Events’
- September 19, 2019 at 4:13 pm #82437
WCFM Forum
KeymasterHi,
Well, certainly “Event” is not a product type. It’s just a product specific option.
So, this is not possible for this!
Thank You
- September 19, 2019 at 7:51 pm #82532
kaloomee
ParticipantOKay,
So….Is their any code you can supply to achieve this pleaseWould not want an event to be mislocated or placed in shirts for example
I would like so that if a listing is an event, it can only be listed in category ‘Events’ - September 21, 2019 at 9:24 pm #82824
WCFM Forum
KeymasterHi,
I would like so that if a listing is an event, it can only be listed in category ‘Events’
– Well, we can handle this other way!
On save we can check whether it’s an even product or not and associate with right category or not?
Kindly know me your site’s “Event” category ID for the purpose.
Thank You
- September 21, 2019 at 11:11 pm #82849
kaloomee
ParticipantExcellent news
Events category ID is – 367
Thank you
- September 22, 2019 at 3:38 pm #82947
WCFM Forum
KeymasterHi,
Please add this code to your site –
add_action( 'after_wcfm_products_manage_meta_save', function( $new_product_id, $wcfm_products_manage_form_data ) { if(isset($wcfm_products_manage_form_data['WooCommerceEventsEvent'])) { $WooCommerceEventsEvent = $wcfm_products_manage_form_data['WooCommerceEventsEvent']; if( $WooCommerceEventsEvent == 'Event' ) { wp_set_object_terms( $new_product_id, 367, 'product_cat' ); } } }, 60, 2 );
Thank You
- September 22, 2019 at 4:33 pm #82954
kaloomee
ParticipantThank you
Can you briefly explain how What this does
I have added the code
Then started to create a new events
Add new product > event tab = yes but still see the categories tab
I am sure that this works but would like to be able to explain to vendors in the’How to create an event’ help doc that I am creating. - September 24, 2019 at 9:20 am #83311
WCFM Forum
KeymasterHi,
This code will ensure if a product added as “Event” then it will definitely associated with “Event” category.
Vendor may select any category by mistake, but this will discard those and added only Event category to the product.
Thank You
- September 24, 2019 at 3:17 pm #83391
kaloomee
ParticipantThank you for explanation – Much appreciated
- AuthorPosts
- You must be logged in to reply to this topic.