Displaying User's Store URL

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 6 reply threads
  • Author
    Posts
    • #62467
      Andrei Laurentiu Popescu
      Guest

      Hi,

      I was wondering how the User Store URL is generated? Is it stored anywhere?

      How may I retrieve/display on a page the Store URL for the Current User?

    • #62663
      WCFM Forum
      Keymaster

      Hi,

      You may get a vendor’s store URL using this method – wcfmmp_get_store_url( $vendor_id );

      $vendor_id – it’s user id

      Thank You

    • #63016
      Andrei Laurentiu Popescu
      Guest

      Thank you!!

    • #63094
      Andrei Laurentiu Popescu
      Guest

      Hi, I still have an issue.

      What I am trying to do is displaying a Main Menu Link for the user to go directly to his shop page, not to the store manager.

      I have created a shortcode to generate the url with the function you have provided.

      function getuserstoreurlfunction() {
        return wcfmmp_get_store_url( $vendor_id );
      }
      add_shortcode('getuserstoreurl', 'getuserstoreurlfunction');  

      But that takes the user to http://www.website.com/store, not to the shop page.

      Would you please help?

      Thank you very much!!

    • #63102
      WCFM Forum
      Keymaster

      Hi,

      Your code missing $vendor_id, then how this will return Store URL for a vendor.

      Use this revised code –

      function getuserstoreurlfunction() {
        if( !is_user_logged_in() ) return '';
        $vendor_id   = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
        if( !wcfm_is_vendor( $vendor_id ) ) return '';
        return wcfmmp_get_store_url( $vendor_id );
      }
      add_shortcode('getuserstoreurl', 'getuserstoreurlfunction'); 

      Thank You

    • #63204
      Andrei
      Guest

      That makes sense now. Thanks!!

    • #63343
      WCFM Forum
      Keymaster

      You are welcome 🙂

Viewing 6 reply threads
  • The topic ‘Displaying User's Store URL’ is closed to new replies.