Automatically mark Appointable products as Virtual

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

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

Viewing 2 reply threads
  • Author
    Posts
    • #113149
      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
      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
      cocioale
      Participant

      thanks

Viewing 2 reply threads
  • You must be logged in to reply to this topic.