How can i HIDE unnecessary FIELDS in product-publishing page and PRESET values?

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 How can i HIDE unnecessary FIELDS in product-publishing page and PRESET values?

Viewing 8 reply threads
  • Author
    Posts
    • #34619
      Lwifunyo Mangula
      Participant

      Hello! Hi!
      Thanks for the good work and great customer support you are providing. its great.

      I want to soon use Woocommerce Booking and accomodations to offer booking service from my vendors.

      But
      I have found the product publishing form has many fields and too technical for very normal user to set and publish his/her booking product!

      I want to
      – preset some fields to all vendors so that they can go without worrying and miss-setting
      – I want to hide some fields and some selections (hide some checkbox and dropdown values in selections boxes). I have tried CSS but i have seen css hide many fields which others i want to be seen. Maybe how can i overide with theme template and hide and rename other fields

      Thanks very much ij advance

    • #34775
      WCFM Forum
      Member

      Hi,

      Just relax, but don’t use CSS for the purpose.
      All these are possible using PHP code.

      Please know me your requirement, I will help you accordingly for the purpose.

      Thank You

    • #34920
      Lwifunyo Mangula
      Participant

      SIR THANKS FOR YOUR TIME. THESE ARE MY REQUESTS.

      FIELDS TO BE PRE-SETS
      ==general product settings
      – has persons
      – has resources
      – virtual product

      ==booking options
      – booking duration==>customer defined
      – time unity==>days
      – minimum duration==>1 day
      – maximum duration==>30 days
      – enable calendar range picker==>yes
      – Calendar display mode==>always visible

      ==persons tab
      – enable person types
      – min persons==>20
      – max persons ==>50
      – multiply all costs by person count==yes
      – count persons as bookings==yes
      – person type 1 name CONSULTANT. ==base-cost 5000. ==block cost 5000. ==min 20. ==max 50. ==description xxxxxxxxxxxxx.
      – person type 2 name DRIVER. ==base-cost 3000. ==block cost 3000. ==min 20. ==max 40. ==description yyyyyyyyyyyy.

      ==availability tab
      – maximum booking per block==>100
      – minimum block bookable ==>1 day
      – maximum block bookable ==> 30 days
      – First block starts at…==> 0100 hours
      – availability rule==> range days. ==from monday. ==to sunday. ==bookable YES. ==priority 10.

      ==resource tab
      – Resource label name==>ADDITIONAL SERVICES
      – resource are==>customer selected

      ==cost tab
      – base costs==5000
      – block costs==3000
      display costs==5000
      – cost rule type==range of days. ==from monday-sunday. ==base-cost (x) 3000. ==block cost (x) 5000.

      FIELDS TO HIDE IN VENDOR BOOKING PUBLISHING FORM
      == general product settings
      – catalog
      – downloadable

      ==booking option tab
      -requires confirmation
      -can be cancelled

      == availability tab
      -require a buffer period of
      -adjacent buffering
      -restrict start days
      -restricted days
      – hide block additional plus button (vendor can not add more block)

      1. your html function code at first for me to solve the problem.
      2. Since this plugin is THE NEXT THING IN WOOCOMMERCE and many people are in need of these functionality in our plugin, then I personally I advice to add an intensive module which maybe can be a table form which will
      – list all plugin fields, text, words, sentenses, placeholders, default values
      – enable admin to hide and unhide some of fields and values to vendor
      – enable admin to pre-set default value
      – enable admin to pre-set fields and vendor can not change them
      – set minmum and maximum field values. set interval value
      – enable admin to make them required or optional fields
      – enable admin to change text, descriptions, sentences to his own words

    • #34938
      WCFM Forum
      Member

      Hi,

      Thanks for all the details.

      Are you comfortable in WP hook/filter coding?

      If yes, then here is sample plugin for such purpose – https://drive.google.com/file/d/16a1OuGUHmbZLW9Io9fyaHE8-LpOcifNo/view?usp=sharing

      Please install this and check.
      then you have to modify this a bit as per your requirement.

      Thank You

    • #35142
      Lwifunyo Mangula
      Participant

      Hello again sir!
      thanks for the sample plugin you have provided for me!
      – it has been so helpful. i have done a lot well with it!
      Thank you!

      There are few things i need help from you!
      1. in person block there are ready predefines input blocks! I want also to add pre-defined input blocks with data, but i have failed. below are codes
      =======> the person types you have provided is

      function wcfmbi_wcbokings_person_types_fields( $person_fields, $product_id ) {
      global $WCFM, $WCFMbi;

      if( !$product_id ) {
      if( isset( $person_fields[‘_wc_booking_min_persons_group’] ) ) {
      $person_fields[‘_wc_booking_min_persons_group’][‘value’] = 1;
      }

      if( isset( $person_fields[‘_wc_booking_max_persons_group’] ) ) {
      $person_fields[‘_wc_booking_max_persons_group’][‘value’] = 1;
      }
      }

      if( isset( $person_fields[‘_wc_booking_person_cost_multiplier’] ) ) {
      $person_fields[‘_wc_booking_person_cost_multiplier’][‘class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_person_cost_multiplier’][‘label_class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_person_cost_multiplier’][‘dfvalue’] = ‘no’;
      }

      if( isset( $person_fields[‘_wc_booking_person_qty_multiplier’] ) ) {
      $person_fields[‘_wc_booking_person_qty_multiplier’][‘class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_person_qty_multiplier’][‘label_class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_person_qty_multiplier’][‘dfvalue’] = ‘yes’;
      }

      if( isset( $person_fields[‘_wc_booking_has_person_types’] ) ) {
      $person_fields[‘_wc_booking_has_person_types’][‘class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_has_person_types’][‘label_class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_has_person_types’][‘dfvalue’] = ‘yes’;
      }

      if( !$product_id ) {
      if( isset( $person_fields[‘_wc_booking_person_types’] ) ) {
      $default_person_types = array( 0 => array(‘person_id’ => 0,
      ‘person_name’ => ‘Normal Ads Posts’,
      ‘person_description’ => ”,
      ‘person_cost’ => ”,
      ‘person_block_cost’ => 2500,
      ‘person_min’ => 0,
      ‘person_max’ => ‘100’
      ),
      1 => array(‘person_id’ => 0,
      ‘person_name’ => ‘Top Cover Photo’,
      ‘person_description’ => ”,
      ‘person_cost’ => ”,
      ‘person_block_cost’ => 50000,
      ‘person_min’ => ‘0’,
      ‘person_max’ => ‘1’
      ),
      2 => array(‘person_id’ => 0,
      ‘person_name’ => ‘Pin Ad at the Top’,
      ‘person_description’ => ”,
      ‘person_cost’ => ”,
      ‘person_block_cost’ => 30000,
      ‘person_min’ => ‘0’,
      ‘person_max’ => ‘2’
      ),
      3 => array(‘person_id’ => 0,
      ‘person_name’ => ‘Admin Promo and Mention’,
      ‘person_description’ => ”,
      ‘person_cost’ => ”,
      ‘person_block_cost’ => 25000,
      ‘person_min’ => ‘0’,
      ‘person_max’ => ‘5’
      ),
      );
      $person_fields[‘_wc_booking_person_types’][‘value’] = $default_person_types;
      $person_fields[‘_wc_booking_person_types’][‘options’][‘person_cost’][‘class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_person_types’][‘options’][‘person_cost’][‘label_class’] = ‘wcfm_custom_hide’;
      $person_fields[‘_wc_booking_person_types’][‘options’][‘person_block_cost’][‘label’] = ‘Cost’;
      }
      }

      return $person_fields;
      }

      ———————————this is person type codes from sample plugin and it is working well——————————

      From it i have derived my codes for RESOURCES, but unfortunately no blocks are added

      ==========>
      function wcfmbi_wcbokings_resource_fields( $resource_fields, $product_id ) {
      global $WCFM, $WCFMbi;

      if( !$product_id ) {
      if( isset( $resource_fields[‘_wc_booking_resources’] ) ) {
      $default_resources = array( 0 => array(‘resource_id’ => 0,
      ‘resource_title’ => ‘i love my wife’,
      ‘resource_base_cost’ => ‘11111’,
      ‘resource_block_cost’ => ‘22222’,
      ),
      1 => array(‘resource_id’ => 0,
      ‘resource_title’ => ‘i love my children’,
      ‘resource_base_cost’ => ‘33333’,
      ‘resource_block_cost’ => ‘44444’,
      ),
      2 => array(‘resource_id’ => 0,
      ‘resource_title’ => ‘i love my family’,
      ‘resource_base_cost’ => ‘55555’,
      ‘resource_block_cost’ => ‘66666’,
      ),
      3 => array(‘resource_id’ => 0,
      ‘resource_title’ => ‘i love my people’,
      ‘resource_base_cost’ => ‘77777’,
      ‘resource_block_cost’ => ‘88888’,
      ),
      );
      $resource_fields[‘_wc_booking_resources’][‘value’] = $default_resources;
      $resource_fields[‘_wc_booking_resources’][‘options’][‘resource_base_cost’][‘class’] = ‘wcfm_custom_hide’;
      $resource_fields[‘_wc_booking_resources’][‘options’][‘resource_base_cost’][‘label_class’] = ‘wcfm_custom_hide’;
      $resource_fields[‘_wc_booking_resources’][‘options’][‘resource_block_cost’][‘label’] = ‘Cost’;
      }
      }

      return $resource_fields;
      }

      ———————————- i need some modifications sir from you —————————————

      2. How can i remove ADD and REMOVE buttons (right bottom buttons) in person and resource form so that vendors can not add or remove any block i have provided by the codes above; i want them only to fill them.

      thanks in advance for my two questions.

    • #35241
      WCFM Forum
      Member

      HI,

      Just relax, I will write this code for you.

      Well, we normally do such work as paid customization.
      But I am not asking anything to you, it will be good if you donate us anything.

      Between, I will give you this code by tomorrow.

      Thank Yoou

    • #35259
      Lwifunyo Mangula
      Participant

      okey. thanks.
      few weeks to come
      i will do something to you sir.

      thanks in advance

    • #35365
      WCFM Forum
      Member

      Hi,

      It’s OK.

      I will send your code in few hours.

      Thank You

    • #35600
      WCFM Forum
      Member

      Hi,

      Sorry for a bit delay.

      Here is your custom plugin – https://drive.google.com/file/d/1GtKUEo2PhADerxlqbH8Z7DLufLmy0lXE/view?usp=sharing

      Use this and delete previous one.

      Thank You

Viewing 8 reply threads
  • The topic ‘How can i HIDE unnecessary FIELDS in product-publishing page and PRESET values?’ is closed to new replies.