Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Appointment › Automatically mark Appointable products as Virtual
- This topic has 2 replies, 3 voices, and was last updated 4 years ago by cocioale.
- AuthorPosts
- March 25, 2020 at 7:42 pm #113149Erin SooParticipant
Hi,
When creating an Appointment product at WordPress backend, the WC Appointments plugin automatically mark the product as “Virtual” as explained in this documentation.https://bookingwp.com/help/setup/woocommerce-appointments/creating-appointable-product/
But this feature is yet to be available in WCFM. Can it be added? Or is there a code snippet that I could use?
Thanks in advance!
Regards,
Erin - April 2, 2020 at 9:18 pm #114798WCFM ForumKeymaster
Hi,
Please add this code snippet to your site for the purpose –
add_filter( 'wcfm_product_manage_fields_general', function( $general_fields, $product_id, $product_type ) { if( isset( $general_fields['is_virtual'] ) ) { $general_fields['is_virtual']['dfvalue'] = 'enable'; } $general_fields = wcfm_hide_field( 'is_downloadable', $general_fields ); return $general_fields; }, 50, 3 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- April 2, 2020 at 11:34 pm #114850cocioaleParticipant
thanks
- AuthorPosts
- You must be logged in to reply to this topic.