Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Vendors › Field '_wcfmmp_shipping' is reset on 'wcfm_vendor_settings_update'
Tagged: Shipping settings, vendor settings, vendors
- This topic has 4 replies, 3 voices, and was last updated 4 years, 7 months ago by EliIT.
- AuthorPosts
- August 1, 2019 at 1:27 pm #74736jannis.von.albedyllParticipant
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 actionwcfm_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?
- August 3, 2019 at 7:00 am #74958WCFM ForumMember
Hi,
What is your WCFM and WCFM Marketplace plugins’ versions?
Thank You
- August 5, 2019 at 6:48 am #75272jannis.von.albedyllParticipant
WCFM Marketplace: Version 3.1.6
WCFM – WooCommerce Frontend Manager: Version 6.2.5 - August 8, 2019 at 3:51 pm #75784WCFM ForumMember
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
- May 26, 2020 at 3:23 pm #135361EliITParticipant
I’ve the same issue and WCFM Admin Setting -> Shipping Setting -> it’s ON
Saving general settings clean the shipping settingWCFM – WooCommerce Frontend Manager – Ultimate 6.5
WCFM – WooCommerce Multivendor Marketplace 3.4
WooCommerce 4.1.1I 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 );
- AuthorPosts
- You must be logged in to reply to this topic.