Website in social area for vendors

Tagged: , ,

This topic contains 5 replies, has 3 voices, and was last updated by WCFM Forum WCFM Forum 22 hours, 42 minutes ago.

  • Author
    Posts
  • #93628
    Avatar
    xximinabandxx
    Participant

    Can we add a link for vendors to list their website in the social area of their profile?

  • #94034
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    Please add this code to your site for the purpose-

    add_action( 'end_wcfm_vendor_settings', function( $vendor_id ) {
    	global $WCFM;
    	$wcfm_vendor_website = get_user_meta( $vendor_id, 'wcfm_vendor_website', true );	
    	
    	?>                                
    	<!-- collapsible -->
    	<div class="page_collapsible" id="wcfm_settings_form_additional_head">
    		<label class="fa fa-certificate"></label>
    		<?php _e('Additional Info', 'wc-multivendor-marketplace'); ?><span></span>
    	</div>
    	<div class="wcfm-container">
    		<div id="wcfm_settings_form_additional_expander" class="wcfm-content">
    			<h2><?php _e('Additional Setting', 'wc-multivendor-marketplace'); ?></h2>
    			<div class="wcfm_clearfix"></div>
    			
    			<?php
    				$WCFM->wcfm_fields->wcfm_generate_form_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 ),
    																													 ) );
    			?>
    		</div>
    	</div>
    	<!-- end collapsible -->
    	<?php
    }, 50, 1 );
    
    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 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/

    Thank You

  • #94049
    Avatar
    xximinabandxx
    Participant
    This reply has been marked as private.
  • #96522
    WCFM Forum
    WCFM Forum
    Keymaster

    Well, it added a new setting tab “Additional Info” and added this field there.

    Use this short code to show this – [wcfm_store_info data="wcfm_vendor_website"]

    Thank You

  • #97049
    Avatar
    Ivan Black
    Participant

    Hello,

    1) How can I automatically output the website on product pages alongside the vendors telephone and email with an icon. That is in the store info section. Using the shortcode [wcfm_store_info data=”store_website”] means the link is not clickable.

    2) Instead of showing this in a separate collapsible section called “additional info”, how can it be moved to vendors >> /store-manager/settings/ under the ‘store phone’ field?

    3) Using this code adds the website field for vendors >> /store-manager/settings/ but not admin edit vendors screen. How can it be added for admin also to see / edit?

    Thank you

  • #97244
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    1) How can I automatically output the website on product pages alongside the vendors telephone and email with an icon. That is in the store info section. Using the shortcode [wcfm_store_info data=”store_website”] means the link is not clickable.

    – Add this code to your site for the purpose-

    add_action( 'wcfmmp_store_after_phone', function( $store_id ) {
    	$site_url = get_user_meta( $store_id, 'wcfm_vendor_website', true );
      if( $site_url ) {
        $site_url_href = $site_url;
    	  if (strpos( $site_url_href, 'http') === false) {
    	  	$site_url_href = "http://" . $site_url_href;
    	  }
    	  ?>
    	  <div class="store_info_parallal" style="margin-right: 10px;"><i class="wcfmfa fa-globe" aria-hidden="true"></i><span><a href="<?php echo $site_url_href; ?>"><?php echo $site_url; ?></a></span></div>
    	  <?php
      }
    });

    Thank You

You must be logged in to reply to this topic.