• jiestevez

    (@jiestevez)


    Hi! I need to made like required inputs Logo Store and Shop Description, when the vendor is editing this fields in the store settings. It is possible?
    I’m sorry because my english is bad.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • fgkeka

    (@fgkeka)

    Yp ta.bien ando en bsuqueda de lo mismo

    Probe con varios ganchos sin solucion

    fgkeka

    (@fgkeka)

    Hola Mira esto tengo no se si podemos llegar a algo mejor

    add_filter( 
    'wcfmmp_store_about', function( $wcfm_shop_description) {
    	if( isset( $wcfm_shop_description ['shop_description'] ) ) {
    		$wcfm_shop_description ['shop_description']['custom_attributes'] = array( 'required' => 1 );
    	}	
    	return $wcfm_shop_description;
    }, 50 );

    ya que aun no me funciona

    Plugin Author WC Lovers

    (@wclovers)

    Use this snippet –

    add_filter( 'wcfm_marketplace_settings_fields_brand', function( $brand_fields, $vendor_id ) {
    	if( isset( $brand_fields['gravatar'] ) ) { 
    	  $brand_fields['gravatar']['custom_attributes'] = array( 'required' => 1 );
    	}
    	if( isset( $brand_fields['shop_description'] ) ) { 
    	  $brand_fields['shop_description']['custom_attributes'] = array( 'required' => 1 );
    	}
    	return $brand_fields;
    }, 50, 2 );
    fgkeka

    (@fgkeka)

    @wclovers el codigo no funciona correctamente

    en la configuracion de la tienda la descripcion desaparece, y si no cargo un Avatar o logo me permite igual pasar a la siguiente etapa

    seria posible verificarlo
    https://ibb.co/Kb52vLr

    muchas gracias siempre por tu ayuda

    fgkeka

    (@fgkeka)

    Me acabo de dar cuenta que si agrego el codigo de agregar URL desaparese el campo descripción

    add_filter( 'wcfm_marketplace_settings_fields_general', function( $setting_fields, $vendor_id ) {
    	$wcfm_vendor_website     = get_user_meta( $vendor_id, 'wcfm_vendor_website', true );
    	if( isset( $setting_fields['store_name'] ) ) {
    		if( isset( $_GET['store-setup'] ) ) {
    			$wcfm_vendor_website_field = array(
    																					"wcfm_vendor_website" => array( 'label' => __( 'Website', 'wc-multivendor-marketplace'), 'in_table' => 'yes', 'name' => 'wcfm_vendor_website', 'type' => 'text', 'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $wcfm_vendor_website ),
    																				 );
    		} else {
    			$wcfm_vendor_website_field = array(
    																					"wcfm_vendor_website" => array( 'label' => __( 'Website', 'wc-multivendor-marketplace'), 'name' => 'wcfm_vendor_website', 'type' => 'text', 'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $wcfm_vendor_website ),
    																				 );
    		}
    	}
    	$setting_fields = array_merge( $wcfm_vendor_website_field, $setting_fields );
    	return $setting_fields;
    }, 50, 2 );
    add_action( 'wcfm_vendor_settings_update', function( $vendor_id, $wcfm_settings_form ) {
    	global $WCFM, $_POST;
    	if( isset( $wcfm_settings_form['wcfm_vendor_website'] ) ) {
    		update_user_meta( $vendor_id, 'wcfm_vendor_website', $wcfm_settings_form['wcfm_vendor_website'] );
    	}
    }, 50, 2 );
    add_action( 'wcfmmp_store_list_after_store_info', function( $vendor_id, $store_info ) {
    	global $WCFM;
    	$site_url = get_user_meta( $vendor_id, 'wcfm_vendor_website', true );
      if( $site_url ) {
        $site_url_href = $site_url;
    	  if (strpos( $site_url_href, 'http') === false) {
    	  	$site_url_href = "https://" . $site_url_href;
    	  }
    		?>
    		<p class="store-phone">
    			<i class="wcfmfa fa-globe" aria-hidden="true"></i>
    			&nbsp;<a href="<?php echo $site_url_href; ?>"><?php echo $site_url; ?></a>
    		</p>
    		<?php
    	}
    }, 10, 2 );
    add_action( 'after_wcfmmp_store_header_info', function( $vendor_id ) {
    	global $WCFM;
    	$site_url = get_user_meta( $vendor_id, 'wcfm_vendor_website', true );
      if( $site_url ) {
        $site_url_href = $site_url;
    	  if (strpos( $site_url_href, 'http') === false) {
    	  	$site_url_href = "https://" . $site_url_href;
    	  }
    		?>
    		<div class="store_info_parallal">
    			<i class="wcfmfa fa-globe" aria-hidden="true"></i>
    			<span>
    				<a href="<?php echo $site_url_href; ?>"><?php echo $site_url; ?></a>
    			</span>
    		</div>
    		<div class="spacer"></div>  
    		<?php
    	}
    }, 10 );
    

    Sin embargo el codigo

    add_filter( 'wcfm_marketplace_settings_fields_brand', function( $brand_fields, $vendor_id ) {
    	if( isset( $brand_fields['gravatar'] ) ) { 
    	  $brand_fields['gravatar']['custom_attributes'] = array( 'required' => 1 );
    	}
    	if( isset( $brand_fields['shop_description'] ) ) { 
    	  $brand_fields['shop_description']['custom_attributes'] = array( 'required' => 1 );
    	}
    	return $brand_fields;
    }, 50, 2 );
    

    No obliga a rellenar la descripción ni agregar el logo

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Store logo and Shop description required’ is closed to new replies.