Product Custom Validation Sales Schedule required

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 WCFM – Ultimate Product Custom Validation Sales Schedule required

Viewing 3 reply threads
  • Author
    Posts
    • #56088
      hnoble
      Participant

      In the Product Custom Validation I wish to configure the sales schedule as required, but it is not in the list to enable. Where an i set is as required.

    • #56187
      WCFM Forum
      Keymaster

      Hi,

      Please use this code snippet for the purpose –

      add_filter( 'wcfm_product_manage_fields_pricing', function( $pricing_fields, $product_id, $product_type ) {
      	if( isset( $pricing_fields['sale_date_from'] ) ) {
      		$pricing_fields['sale_date_from']['custom_attributes'] = array( 'required' => true );
      	}
      	if( isset( $pricing_fields['sale_date_upto'] ) ) {
      		$pricing_fields['sale_date_upto']['custom_attributes'] = array( 'required' => true );
      	}
      	
      	return $pricing_fields;
      }, 50, 3 );

      Thank You

    • #56237
      hnoble
      Participant

      Works thanks

    • #56241
      WCFM Forum
      Keymaster

      Great … you are welcome 🙂

Viewing 3 reply threads
  • The topic ‘Product Custom Validation Sales Schedule required’ is closed to new replies.