Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Displaying User's Store URL
- This topic has 6 replies, 2 voices, and was last updated 4 years, 11 months ago by WCFM Forum.
- AuthorPosts
- May 16, 2019 at 1:21 pm #62467Andrei Laurentiu PopescuGuest
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?
- May 17, 2019 at 3:48 pm #62663WCFM ForumKeymaster
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
- May 20, 2019 at 10:12 am #63016Andrei Laurentiu PopescuGuest
Thank you!!
- May 21, 2019 at 3:53 am #63094Andrei Laurentiu PopescuGuest
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!!
- May 21, 2019 at 4:43 am #63102WCFM ForumKeymaster
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
- May 21, 2019 at 8:13 pm #63204AndreiGuest
That makes sense now. Thanks!!
- May 22, 2019 at 12:53 pm #63343WCFM ForumKeymaster
You are welcome 🙂
- AuthorPosts
- The topic ‘Displaying User's Store URL’ is closed to new replies.