Automatically use store banner as mobile banner and store list banner

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 WCFM – Feature Request Automatically use store banner as mobile banner and store list banner

Viewing 2 reply threads
  • Author
    Posts
    • #135428
      wiz.sas.project
      Participant

      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!

    • #135450

      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.

    • #135654
      wiz.sas.project
      Participant

      Thank you very much, it works well !
      have a nice day

Viewing 2 reply threads
  • You must be logged in to reply to this topic.