Field '_wcfmmp_shipping' is reset on 'wcfm_vendor_settings_update'

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 Vendors Field '_wcfmmp_shipping' is reset on 'wcfm_vendor_settings_update'

Viewing 4 reply threads
  • Author
    Posts
    • #74736

      1. I have a vendor with activated shipping. The database field looks as follows:
      _wcfmmp_shipping = a:3:{s:28:"_wcfmmp_user_shipping_enable";s:3:"yes";s:10:"_wcfmmp_pt";s:0:"";s:26:"_wcfmmp_user_shipping_type";s:7:"by_zone";}

      2. Now I hit ‘update’ somewhere in the vendor settings, means I submit following HTML-button:
      <input name="save-data" value="Aktualisieren" id="wcfm_store_address_setting_save_button" class="wcfm_submit_button" type="submit">
      In PHP it triggers the action wcfm_vendor_settings_update.

      3. This magically resets my value for _wcfmmp_shipping. The database field now looks as follows:
      a:3:{s:10:"_wcfmmp_pt";s:0:"";s:26:"_wcfmmp_user_shipping_type";s:0:"";s:28:"_wcfmmp_user_shipping_enable";s:2:"no";}

      Is there a fix for this mean bug?

    • #74958
      WCFM Forum
      Keymaster

      Hi,

      What is your WCFM and WCFM Marketplace plugins’ versions?

      Thank You

    • #75272

      WCFM Marketplace: Version 3.1.6
      WCFM – WooCommerce Frontend Manager: Version 6.2.5

    • #75784
      WCFM Forum
      Keymaster

      Hi,

      Do yo have disabled vendor’s Shipping setting capability?

      Please go to WCFM Admin Setting -> Shipping Setting -> Be sure it’s ON

      Also check capability setting.

      Thank You

    • #135361
      EliIT
      Participant

      I’ve the same issue and WCFM Admin Setting -> Shipping Setting -> it’s ON
      Saving general settings clean the shipping setting

      WCFM – WooCommerce Frontend Manager – Ultimate 6.5
      WCFM – WooCommerce Multivendor Marketplace 3.4
      WooCommerce 4.1.1

      I thought it could be this code in my functions.php but deleting it the problem persists

      add_filter( 'wcfm_marketplace_settings_fields_general', function( $setting_fields, $vendor_id ) {
      	
      	if( !wcfm_is_vendor() ) {
      		
      		if( !isset( $setting_fields['banner'] ) ) {//with this I exclude that it is entering the banner settings, otherwise it repeats the field
      			$wcfm_min_order_amt     = get_user_meta( $vendor_id, '_wcfm_min_order_amt', true );
      			$setting_fields['_wcfm_min_order_amt'] = array(
      				'label' => __('Importo minimo per l\'ordine', 'wc-frontend-manager'), 
      				'type' => 'select', 
      				'options' => array( '' => 0, '19' => '19', '29' => '29', '39' => '39', '49' => '49', '99' => '99' ), 
      				'class' => 'wcfm-select wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 
      				'value' => $wcfm_min_order_amt );
      		
      
      			$wcfm_min_order_qty     = get_user_meta( $vendor_id, '_wcfm_min_order_qty', true );
      			$setting_fields['_wcfm_min_order_qty'] = array(
      				'label' => __('La quantità minima per l\'ordine', 'wc-frontend-manager'), 
      				'type' => 'text', 
      				'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 
      				'value' => $wcfm_min_order_qty );
      
      		}
      	}
      	return $setting_fields;
      }, 20, 2 );
      
      add_action( 'wcfm_vendor_settings_update', function( $vendor_id, $wcfm_settings_form ) {
      	global $WCFM, $WCFMmp;
      	if( isset( $wcfm_settings_form['_wcfm_min_order_amt'] ) ) {
      		$wcfm_min_order_amt = $wcfm_settings_form['_wcfm_min_order_amt'];
      		update_user_meta( $vendor_id, '_wcfm_min_order_amt',  $wcfm_min_order_amt );
      	}
      	if( isset( $wcfm_settings_form['_wcfm_min_order_qty'] ) ) {
      		$wcfm_min_order_qty = $wcfm_settings_form['_wcfm_min_order_qty'];
      		update_user_meta( $vendor_id, '_wcfm_min_order_qty',  $wcfm_min_order_qty );
      	}
      }, 500, 2 );
Viewing 4 reply threads
  • You must be logged in to reply to this topic.