Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › Preferred Payment Method Select Field on Payments
- This topic has 1 reply, 2 voices, and was last updated 5 years, 9 months ago by WCFM Forum.
Viewing 1 reply thread
- AuthorPosts
- July 21, 2018 at 5:06 am #26675M MParticipant
Hi, I am using WC Vendors along with WooCommerce Frontend Manager – Ultimate & WooCommerce Frontend Manager – Groups & Staffs. I need to add a select field that will indicate the vendor’s preferred payment method. I could not find any option regarding this. Can you guys help?
Thanks
- July 29, 2018 at 7:12 am #27099WCFM ForumKeymaster
Hi,
Thanks for get in touch with us.
I am sorry for delayed response.
Here is your code for the purpose –
function wcfm_wcvendors_settings_fields_custom_billing( $billing_fields ) { global $WCFM; $vendor_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() ); $prefered_payment_option = get_user_meta( $vendor_id, 'prefered_payment_option', true ); $custom_billig_fields = array( "prefered_payment_option" => array( 'label' => __('Prefered Payment Option', 'wc-frontend-manager') , 'type' => 'select', 'options' => array( 'paypal' => 'PayPal', 'bank' => 'Bank Transfer' ), 'class' => 'wcfm-select wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $prefered_payment_option, 'hints' => __( 'Set your prefered payment mode.', 'wc-frontend-manager' ) ), ); $billing_fields = array_merge( $custom_billig_fields, $billing_fields ); return $billing_fields; } add_filter( 'wcfm_wcvendors_settings_fields_billing', 'wcfm_wcvendors_settings_fields_custom_billing' ); function wcfm_wcvendors_settings_custom_update( $vendor_id, $wcfm_settings_form ) { if( isset( $wcfm_settings_form['prefered_payment_option'] ) ) { update_user_meta( $vendor_id, 'prefered_payment_option', $wcfm_settings_form['prefered_payment_option'] ); } } add_action( 'wcfm_wcvendors_settings_update', 'wcfm_wcvendors_settings_custom_update', 10, 2 );
Thank You
- AuthorPosts
Viewing 1 reply thread
- The topic ‘Preferred Payment Method Select Field on Payments’ is closed to new replies.