• Help us and get rewarded with 15% discount coupon. Learn how

Vendors Store

This topic contains 19 replies, has 2 voices, and was last updated by WCfM Forum WCfM Forum 1 month ago.

  • Author
    Posts
  • #67017
    Avatar
    r_guayaquil
    Participant

    Hi,

    How can i show the url of the vendors online store in his profile?

    Thanks

    Attachments:
    You must be logged in to view attached files.
  • #67072
    WCfM Forum
    WCfM Forum
    Keymaster

    HI,

    How you have added this field for vendors?

    Well, use this code to display this –

    add_action( 'wcfmmp_store_before_phone', function( $store_id ) {
    	$site_url = 'http://gogle.com';
    	?>
    	<div class="store_info_parallal"><i class="wcfmfa fa-globe" aria-hidden="true"></i><span><a href="#"><?php echo $site_url; ?></a></span></div>
    	<?php
    });

    Fetch vendor’s site url using $store_id

    Thank You

  • #67112
    Avatar
    r_guayaquil
    Participant

    Hi,

    I added it in the registration form. Or where do i have to add it?

    Thanks!

  • #67121
    WCfM Forum
    WCfM Forum
    Keymaster

    OK, that’s fine.

    So, you have to fetch that using get_user_meta function.

    Can you check from database using which meta_key it store that field ?

    Thank You

  • #67224
    Avatar
    r_guayaquil
    Participant

    Hi,

    I dont know much about coding. Can you please guide me?

    Thanks!

  • #67464
    WCfM Forum
    WCfM Forum
    Keymaster

    HI,

    Do you have added “website url” custom field under vendor’s registration form?

    Please show me screenshot for that.

    Thank You

  • #67489
    Avatar
    r_guayaquil
    Participant

    Hi,

    I attached the screenshot

    Attachments:
    You must be logged in to view attached files.
  • #67839
    WCfM Forum
    WCfM Forum
    Keymaster

    Thanks, use this revised code –

    add_action( 'wcfmmp_store_before_phone', function( $store_id ) {
    	$site_url = get_user_meta( $store_id, 'url-de-tienda-online', true );
    	?>
    	<div class="store_info_parallal"><i class="wcfmfa fa-globe" aria-hidden="true"></i><span><a href="#"><?php echo $site_url; ?></a></span></div>
    	<?php
    });
  • #71598
    Avatar
    r_guayaquil
    Participant

    Hi,

    Thanks a lot for the code. It works!

    But what can i do when a user clicks in the url, the link will redirect to the vendors online store?

    Thanks!

  • #72233
    WCfM Forum
    WCfM Forum
    Keymaster

    HI,

    OK, use this revised code –

    add_action( 'wcfmmp_store_before_phone', function( $store_id ) {
    	$site_url = get_user_meta( $store_id, 'url-de-tienda-online', true );
    	?>
    	<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

  • #72480
    Avatar
    r_guayaquil
    Participant

    Hi,

    I added the code but i dont go to the vendors online store. I get the not found page. Please see images attached.

    Thanks!

    Attachments:
    You must be logged in to view attached files.
  • #72671
    WCfM Forum
    WCfM Forum
    Keymaster

    HI,

    What URL it’s opening in browser? I can not see that in screenshot!

    Thank You

  • #72677
    Avatar
    r_guayaquil
    Participant
  • #72760
    WCfM Forum
    WCfM Forum
    Keymaster

    http://www.amazon.com
    Ummm … problem is here. You have added URL without “https/http”

    Should I add this checking to that code?

    Thank You

  • #72835
    Avatar
    r_guayaquil
    Participant

    Hi,

    Should I add this checking to that code?

    Yes, please!

    Thanks a lot!

  • #72840
    WCfM Forum
    WCfM Forum
    Keymaster

    Hi,

    Please use this revised code –

    add_action( 'wcfmmp_store_before_phone', function( $store_id ) {
    	$site_url = get_user_meta( $store_id, 'url-de-tienda-online', 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

  • #72858
    Avatar
    r_guayaquil
    Participant

    Hi,

    Thanks a lot! 🙂

  • #72951
    WCfM Forum
    WCfM Forum
    Keymaster

    You are welcome 🙂

    Let me know if there’s anything else we can help you with.
    Can we ask for a favor John? Would you mind taking a few minutes to review our plugin at WordPress and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter @wcfmmp for more exciting news, important updates, and irresistible offers.

  • #73144
    Avatar
    r_guayaquil
    Participant

    Hi,

    Yes, I would love to do it.

    Thanks a lot for all the help!

  • #73154
    WCfM Forum
    WCfM Forum
    Keymaster

    My pleasure!

    Have a great weekend 🙂

You must be logged in to reply to this topic.