Celebrating 20K+ active installs! Enjoy upto35% off on our addons!

CLAIM OFFER
01Day 16Hour 02Min 59Sec

Automatically mark Appointable products as Virtual

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WC Appointment Automatically mark Appointable products as Virtual

This topic contains 2 replies, has 3 voices, and was last updated by Avatar cocioale 3 days, 19 hours ago.

  • Author
    Posts
  • #113149
    Avatar
    Erin Soo
    Participant

    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

  • #114798
    WCFM Forum
    WCFM Forum
    Keymaster

    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

  • #114850
    Avatar
    cocioale
    Participant

    thanks

You must be logged in to reply to this topic.