Hide fields in shipping options

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!

Viewing 5 reply threads
  • Author
    Posts
    • #30784
      Ed
      Participant

      I disabled these options in WC Vendor Pro, but they are still shown in add product option in WCFM (Ultimate). How do I remove it?

      Attachments:
      You must be logged in to view attached files.
    • #30796
      WCFM Forum
      Keymaster

      Hi,

      How yo have disabled these from WC Vendors Pro?
      Do you have OFF vendor shipping option?

      Thank You

    • #30887
      Ed
      Participant

      I disabled on: WC Vendors -> Settings -> Forms -> Settings (and Product)

      If I disable shipping in WCfM options, it will not be possible for seller to set mandatory information for my marketplace: weight, fixed freight and free).

    • #30896
      WCFM Forum
      Keymaster

      Hi,

      Kindly add this code for hide those options –

      function wc_vendor_shipping_option_hide( $sbipping_fields ) {
      	return array();
      }
      add_filter( 'wcfm_vendors_settings_fields_shipping_national_flat', 'wc_vendor_shipping_option_hide', 50 );
      add_filter( 'wcfm_vendors_settings_fields_shipping_international_flat', 'wc_vendor_shipping_option_hide', 50 );
      add_filter( 'wcfm_vendors_settings_fields_shipping_rates', 'wc_vendor_shipping_option_hide', 50 );
      add_filter( 'wcfm_vendors_settings_fields_shipping', 'wc_vendor_shipping_option_hide', 50 );
      
      function wcfmgs_wcmp_vendor_register_groups_field_hide( $shipping_fields, $product_id ) {
      	global $WCFM, $WCFMu;
      	if( $WCFMu ) {
      		remove_action( 'wcfm_product_manage_fields_shipping', array( &$WCFMu->wcfmu_marketplace, 'wcvendors_product_manage_fields_shipping' ), 10, 2 );
      	}
      	return $shipping_fields;
      }
      add_action( 'wcfm_product_manage_fields_shipping', 'wcfmgs_wcmp_vendor_register_groups_field_hide', 9, 2 );

      Thank You

    • #31001
      Ed
      Participant

      Thank you! But some fields have disappeared that I need :/

      In fact I need to hide almost everything in shipping options and show ONLY “Free National Shipping” choice option on the “Add New Product” page. All other fields must be hidden because all products that will be added have the same weight.

      In Shipping Settings Vendor Account I want to show only the store address (From Address) option.

      In this way only when you will post a product will Seller determine if they will offer free shipping.

    • #31011
      WCFM Forum
      Keymaster

      Hi,

      Ok, I understand your point and hope “In Shipping Settings Vendor Account I want to show only the store address (From Address) option.” this already working, if not then please update WCFM to the latest version and take a look.

      And product part remove old custom code and use this –

      function wcvendors_product_manage_fields_shipping_custom_79( $shipping_fields, $product_id ) {
      	if( isset( $shipping_fields['national'] ) ) {
      		$shipping_fields['national']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['national']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['national_qty_override'] ) ) {
      		$shipping_fields['national_qty_override']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['national_qty_override']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['national_disable'] ) ) {
      		$shipping_fields['national_disable']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['national_disable']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['international'] ) ) {
      		$shipping_fields['international']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['international']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['international_free'] ) ) {
      		$shipping_fields['international_free']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['international_free']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['international_qty_override'] ) ) {
      		$shipping_fields['international_qty_override']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['international_qty_override']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['international_disable'] ) ) {
      		$shipping_fields['international_disable']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['international_disable']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['handling_fee'] ) ) {
      		$shipping_fields['handling_fee']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['handling_fee']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['max_charge_product'] ) ) {
      		$shipping_fields['max_charge_product']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['max_charge_product']['label_class'] = 'wcfm_custom_hide';
      	}
      	if( isset( $shipping_fields['free_shipping_product'] ) ) {
      		$shipping_fields['free_shipping_product']['class'] = 'wcfm_custom_hide';
      		$shipping_fields['free_shipping_product']['label_class'] = 'wcfm_custom_hide';
      	}
      	return $shipping_fields;
      }
      add_filter( 'wcfm_product_manage_fields_shipping', 'wcvendors_product_manage_fields_shipping_custom_79', 60, 2 );

      Between, did you checked WCFM own Marketplace module – https://wordpress.org/plugins/wc-multivendor-marketplace/

      Thank You

Viewing 5 reply threads
  • The topic ‘Hide fields in shipping options’ is closed to new replies.