Add vendors Website Address

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!

Viewing 13 reply threads
  • Author
    Posts
    • #73092
      sdel_nevo
      Participant

      Hi Guys

      is it possible to add a vendors website to there store page? perhaps have this entered in the store details settings

      would it also be possible to allow vendors to hide this as they can the e-mail address and phone number

      Steve

    • #73253
      WCFM Forum
      Member

      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_action( 'wcfmmp_store_before_phone', function( $store_id ) {
      	$site_url = get_user_meta( $store_id, 'wcfm_vendor_website', true );
      	if (strpos( $site_url, 'http') === false) {
      		$site_url = "http://" . $site_url;
      	}
      	?>
      	<div class="store_info_parallal"><i class="wcfmfa fa-globe" aria-hidden="true"></i><span><a href="<?php echo $site_url; ?>"><?php echo $site_url; ?></a></span></div>
      	<?php
      });

      Thank You

    • #73260
      sdel_nevo
      Participant

      Hi guys

      That’s great, will add this code and let you know how it goes

      Steve

    • #73269
      WCFM Forum
      Member

      Sure, please know me.

    • #73277
      sdel_nevo
      Participant

      Hi Guys

      that’s great 🙂

      I changed this line
      add_action( ‘wcfmmp_store_after_phone’, function( $store_id ) {

      and its put the web address nicely between the phone number and the e-mail address

      but is it possible to place a space between the last URL character and the icon for the e-mail address?

      Steve

      Attachments:
      You must be logged in to view attached files.
    • #73279
      sdel_nevo
      Participant

      also

      if nothing is entered in the web address this is shown

      HTTP:// on the store page, if this is clicked it goes to a webpage with an error

      is it possible to only show this field if a value is entered?

      Steve

    • #73307
      WCFM Forum
      Member

      HI,

      add_action( ‘wcfmmp_store_after_phone’, function( $store_id ) {

      Use this revised function for this –

      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

    • #73313
      sdel_nevo
      Participant

      Hi guys

      That’s brilliant, will test when I’m in the office shortly and let you know how it goes

      Steve

    • #73387
      WCFM Forum
      Member

      Sure, please know me.

    • #73411
      sdel_nevo
      Participant

      Hi Guys

      that code works brilliantly 🙂

      Many Many thanks

      Steve

    • #73540
      WCFM Forum
      Member

      Glad to here 🙂

    • #121737
      tgl
      Participant

      Has the functionality for a website address been added to the plugin yet?

      I tried this snippet on a brand new install tonight and I don’t see any added options in the store settings.

    • #122623
      paul-8288
      Participant

      HI @Sdel_nev, Steve.
      There doesnt seem to be a way to contact other users on this forum, but any chance I can ping you an email about your Stripe implementation? Ive been struggling with a few aspects and see you have been through it on here. Maybe a private reply?

      Thanks

    • #122711
      tgl
      Participant

      @paul-8288 I just put up a FB group for WC users, I will try to drop all the info in there I come across while building my marketplace with WC also:

      https://www.facebook.com/groups/users.of.wcfm.marketplace/

      Feel free to join in there, I see a lot of great potential in the plugin, but not much of a community of users talking yet, hopefully this can help out.

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