Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Automatically use store banner as mobile banner and store list banner
Tagged: Mobile Banner, store banner, store list banner
- This topic has 2 replies, 2 voices, and was last updated 4 years, 5 months ago by wiz.sas.project.
- AuthorPosts
- May 26, 2020 at 6:58 pm #135428wiz.sas.projectParticipant
Hi everyone,
In order to simplify the configuration of the store by sellers, is it possible to automatically use the store banner as a mobile banner and store list banner?
This would allow choosing only one image.Thank you in advance for your help and have a great day!
- May 26, 2020 at 8:01 pm #135450Sarmistha ChakrabortyMember
Hello,
It’s feasible only if “Banner type” is set as “Static image”.
So, to achieve this you can hide all other fields “Store Banner Type”,”Mobile Banner”,”Store List Banner” ect.
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets//****hide fields****/ add_filter('wcfm_marketplace_settings_fields_brand', 'wcfm_marketplace_settings_fields_general_custom2605', 50, 2 ); add_filter('wcfm_marketplace_settings_fields_general', 'wcfm_marketplace_settings_fields_general_custom2605', 50, 2 ); function wcfm_marketplace_settings_fields_general_custom2605($general_fields,$vendor_id) { unset($general_fields['banner_type']); unset($general_fields['banner_video']); unset($general_fields['banner_slider']); unset($general_fields['mobile_banner']); unset($general_fields['list_banner_type']); unset($general_fields['list_banner']); unset($general_fields['list_banner_video']); return $general_fields; } /****save banner image to mobile and list banner mage****/ add_action( 'wcfm_wcfmmp_settings_update','fn_wcfm_vendor_settings_custom_update_2605', 30, 2); add_action( 'wcfm_vendor_settings_update','fn_wcfm_vendor_settings_custom_update_2605', 30, 2); function fn_wcfm_vendor_settings_custom_update_2605($user_id, $wcfm_settings_form ){ global $WCFM; $wcfm_settings_form_data_new = array(); parse_str($_POST['wcfm_settings_form'], $wcfm_settings_form_data_new); $wcfm_settings_form_data_mobilelistdata = array(); if( isset($wcfm_settings_form_data_new['banner']) ) { if( !empty($wcfm_settings_form['banner']) ) { $wcfm_settings_form_data_mobilelistdata['mobile_banner'] = $WCFM->wcfm_get_attachment_id($wcfm_settings_form_data_new['banner']); $wcfm_settings_form_data_mobilelistdata['list_banner'] = $WCFM->wcfm_get_attachment_id($wcfm_settings_form_data_new['banner']); } else { $wcfm_settings_form_data_mobilelistdata['mobile_banner'] = ''; $wcfm_settings_form_data_mobilelistdata['list_banner'] = ''; } } $wcfm_settings_form = array_merge( $wcfm_settings_form, $wcfm_settings_form_data_mobilelistdata ); update_user_meta( $user_id, 'wcfmmp_profile_settings', $wcfm_settings_form ); }
Thanks.
- May 27, 2020 at 12:20 pm #135654wiz.sas.projectParticipant
Thank you very much, it works well !
have a nice day
- AuthorPosts
- You must be logged in to reply to this topic.