Force the vendor to put opening hours

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 Marketplace Force the vendor to put opening hours

Viewing 2 reply threads
  • Author
    Posts
    • #119912
      HERMES ALVES SOUZA
      Participant

      Is it possible to make it require for the seller to specify opening hours?

      https://wclovers.com/knowledgebase/wcfm-marketplace-store-hours/

    • #121814
      Sushobhan
      Keymaster

      Hi,
      Use the following snippet-

      add_filter('wcfm_vendors_settings_fields_store_hours_time_slots', function($store_hr_fields) {
          foreach( $store_hr_fields as $key => $field_options ) {
             if(isset($store_hr_fields[$key]['options']['start'])) {
                 $store_hr_fields[$key]['options']['start']['custom_attributes']['required'] = 1;
             }
             if(isset($store_hr_fields[$key]['options']['end'])) {
                 $store_hr_fields[$key]['options']['end']['custom_attributes']['required'] = 1;
             }    
          }
          return $store_hr_fields;
      });
      
      add_filter('wcfm_vendors_settings_fields_store_hours', function($fields) {
          if(isset($fields['wcfm_store_hours'])) {
              $fields['wcfm_store_hours']['dfvalue'] = 'yes';
               $fields['wcfm_store_hours']['custom_attributes']['required'] = 1;
          }
          return $fields;
      });

      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/
      Let me know how it goes.
      Thanks!

    • #121848
      HERMES ALVES SOUZA
      Participant

      Perfect!

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