Forum Replies Created
- AuthorPosts
- August 5, 2019 at 6:48 am in reply to: Field '_wcfmmp_shipping' is reset on 'wcfm_vendor_settings_update' #75272jannis.von.albedyllParticipant
WCFM Marketplace: Version 3.1.6
WCFM – WooCommerce Frontend Manager: Version 6.2.5July 5, 2019 at 11:28 am in reply to: [Bug?] Custom field for vendor settings – uncheck a checkbox #71189jannis.von.albedyllParticipantSorry, I meant a bug on ‘type’ => ‘checkbox’.
July 5, 2019 at 8:38 am in reply to: [Bug?] Custom field for vendor settings – uncheck a checkbox #71164jannis.von.albedyllParticipantBy the way: following custom-field works perfectly:
function add_allow_invoice($settings_fields_general, $vendor_id){ if( isset( $settings_fields_general['store_name'] ) ) { $allow_invoice = get_user_meta( $vendor_id, 'allow_invoice', true ); $settings_fields_general['allow_invoice'] = array( 'label' => __( 'Rechnung erlauben', 'ddwoo' ), 'type' => 'text', 'priority' => 50, 'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $allow_invoice ); } return $settings_fields_general; }
The value gets always updated and is persisted correctly. That’s why I guess it’s a bug on the
'type' => 'text'
.July 5, 2019 at 8:13 am in reply to: [Bug?] Custom field for vendor settings – uncheck a checkbox #71161jannis.von.albedyllParticipantOther fields of
$wcfm_settings_form
get updated properly in the add_action. So if I change something about the address for instance, in debugging the new value is submitted.July 5, 2019 at 8:11 am in reply to: [Bug?] Custom field for vendor settings – uncheck a checkbox #71158jannis.von.albedyllParticipant$allow_invoice = get_user_meta( $vendor_id, 'allow_invoice', true );
always gives me yes, after I checked the checkbox once.Even if I UNcheck the box, the code evaluates ‘yes’ (see screenshot attached).
So the connection between the checkbox and the
add_action('wcfm_vendor_settings_update', array($this, 'save_custom_vendor_settings'), 16, 2);
does not work properly as the code always evaluates ‘yes’ for$wcfm_settings_form['allow_invoice']
.Attachments:
You must be logged in to view attached files.July 1, 2019 at 11:42 am in reply to: [Bug?] Custom field for vendor settings – uncheck a checkbox #70502jannis.von.albedyllParticipantThank you for your answer, but this does not work :(. The behaviour is still the same:
Once I checked the checkbox,
$wcfm_settings_form['allow_invoice']
is ALWAYS yes (no matter if I uncheck the box or not).If I uncheck it and save the settings, I do not enter the else path
else { update_user_meta( $vendor_id, 'allow_invoice', 'no' ); }
Do you have any other idea?
June 24, 2019 at 5:55 am in reply to: [Bug?] Custom field for vendor settings – uncheck a checkbox #69232jannis.von.albedyllParticipantIs there no one who can help me with that?
- AuthorPosts