Home Forums WC Vendors Pro Support "View Profile" Button on Product Pages. Broken code?

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.ย  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #56133
    Beth
    Participant

    Hi WC Vendors team,
    First…Happy Valentine’s Day.

    I am having an issue with the View Profile button used along with buddypress that you can see on the top of vendor shop pages and vendor product pages. This button (as seen in screenshots) takes users to the vendor profile page. The strange thing is that on the vendor shop pages, the View Profile Button works just fine. However, on vendor product pages, the View Profile Button does not work and is sent to an error page. Please see screenshots. Looks like codes are different.Any reason why these two codes are different?

    I am using the theme Flatsome and have been in contact with them but they claim that this is not an issue with the theme. Their best guess was that “WC Vendors may use some hooks to insert them into product and archive pages. But looks like there is something wrong with the codes which create that buttons.”

    Is this an issue that WC Vendors has had before and is there a possible solution? Buddypress support was unable to replicate the problem either.

    Let me know your thoughts at your next convenience. Thanks so much! We are stuck.

    Sincerely,
    Beth

    #56181
    Anna
    Member

    @Bethkrav7
    Please show me the code you are using for each of those. I’ll try to get it fixed for you.

    #56184
    Anna
    Member

    Oh- and Happy Valentine’s Day to you, too. ๐Ÿ˜€ Thank you!

    #56257
    Beth
    Participant

    Hi Anna,
    Sorry, did you mean the code from the element inspection in the screenshots? This is what I was referring to below for the code. My computer vocabulary isn’t the best, my apologies. :/

    This is from the view shop page, View Profile button, highlighted line in element inspection:
    <a href="https://www.pantryhound.com/account/members/thornburgandcompany//profile/">View Profile</a>

    This is the actual link to this particular shop page:
    https://www.pantryhound.com/vendors/thornburg-and-company/

    This is the from the individual vendor product page, View Profile button, highlighted line in element inspection:
    <a href="/profile/">View Profile</a>

    This is the actual link to the product page:
    https://www.pantryhound.com/browse/products/preserves/bartlett-pear-with-vanilla-bean-riesling/

    This does occur with every shop page and every product page with the broken button. I can give you access if you wish.

    If you would like access to the site admin I have absolutely no problem letting you take a look. Just let me know. Thanks, Anna!

    #56279
    Anna
    Member

    @Bethkrav7
    Hi Beth,
    Thank you. I actually meant the code that you had put in your functions.php to make the button show up.
    However, if you give me the admin login & password in a private reply, I can login and see what you have put in your functions.php .. so that may be easier. I can then copy that code snip and check it elsewhere are see what may be the issue. ๐Ÿ™‚

    #56317
    Beth
    Participant

    Hi Anna!
    Thank you so much for offering to take a look on the site. Here is your login information.

    http://www.pantryhound.com

    USER:Annawcvendors
    PASS:Thanksanna123

    Let me know if you are able to find anything interesting with our button issue. Appreciate your time so very much. Thanks.

    Beth Kravitz

    #56331
    Anna
    Member

    Beth-
    ok– so I was wrong, and I could not access the functions.php in your child theme. I used to be able to– maybe they disable that with the theme.

    Is this code that you added form our kb?
    If so– I think I see the issue.
    One of the codes (the one that is for the top of the product page) needs to call the profile from the product author:
    $wcv_profile_id = get_the_author_meta('ID');

    The other (for the store page) needs to call the profile from the STORE owner/vendor:

    $vendor_shop            = urldecode( get_query_var( 'vendor_shop' ) );
            $wcv_profile_id = WCV_Vendors::get_vendor_id( $vendor_shop );

    Since you have the banner showing on the product pages, this also shows the view profile link that is calling the store owner’s info on the product page. However, unless you are in the store– it will not work.
    You need to use only the code for the product page “view profile” link on the product pages.

    We can prevent the “view profile” button form showing on the product pages just by adding an if statement:
    if ( is_shop() ) {

    So…. If you put these two code snippets in your child theme functions.php, that will remove the non-working button from the top of the product page / banner area, but leave it on the actual store page banner. The link for “view my profile” will still be in the product meta area of the product page.
    Change the code in your child theme functions.php to look like this now:
    https://gist.github.com/fervous/a7e6bddc1f7d89b3395d3e09f11031fe

    I’ll also update the kb article. ๐Ÿ™‚

    Let me know if this works.

    Your site looks great!

    #56361
    Beth
    Participant

    Hi Anna,
    This has been SO helpful. Thank you so very much for taking the time today and looking around. I am glad you like the site too. Definitely a labor of love haha but I do enjoy using WC vendors very much with it!

    Sorry you weren’t able to get into the functions.php. Must be disabled, darn! I think the code may have been from the kb a while back when we added some in for the look of the store banners…perhaps this is where it all came from.

    HOWEVER I think taking the “view profile” button off of the product page but keeping the “view profile” button on the shop page would be a great idea and would totally resolve the problem.

    I am going to pass these 2 snippets of code to the wordpress specialist that I work with and we will try this out. I will get back to you shortly!

    Thank you Anna, truly. ๐Ÿ™‚

    -Beth Kravitz

    #56362
    Anna
    Member

    You’re welcome! ๐Ÿ™‚

    #57688
    Beth
    Participant

    Hi Anna,
    Thanks so much for your patience! SO, we got to test the code for the profile button and unfortunately there were some problems. But maybe you have another solution!

    Just to review from our last convo, this is what the code you provided was supposed to do: “Soโ€ฆ. If you put these two code snippets in your child theme functions.php, that will remove the non-working button from the top of the product page / banner area, but leave it on the actual store page banner. The link for โ€œview my profileโ€ will still be in the product meta area of the product page.”

    Here is what actually happened:
    1) The first piece just adds a second “View Profile” button to the vendor’s store header (store page) which was actually working just fine already. My associate believes that we need a piece of code to create that same button on the product page. See screenshot.

    2) The second piece does not actually fix the “View Profile” button, but instead adds another copy of the link in the meta information. This link was already working as well. The button still points to a non-existent location. (Oops page). See screenshot. I have included arrows to show where each of the buttons is pointing.

    To sum up, It looks like we need a code for the “View Profile” button in the header of the product page to work exactly like the View Profile button in the header of the Vendor page (store page).

    Is there any possible solution for this? Thanks so much Anna!

    #57739
    Anna
    Member

    Hello,
    Your dev did not remove the previous code?
    If you replace the code you did have to that which I gave you, the result should be:
    the view profile button in the store banner region on the vendor’s store page
    the view profile link in the product meta on the product page.

    #57824
    Beth
    Participant

    Hi Anna,

    Thanks so much for your quick reply. Also, did I mention that I am really liking the new look of the WCVendors website. Very nice!

    We are having some trouble locating where the previous code would be so we can disable it. Then I think as you say, the code will work! Might you have any idea? Feel free to have another look around. Pantryhound.com

    USER:Annawcvendors
    PASS:Thanksanna123

    Thank you for your time, Anna. Your assistance means SO much to me.

    -Beth

    #57841
    Anna
    Member

    Beth,
    I still cannot access the functions.php or any files to the theme– normally if you go to: wp admin > appearance there is a menu link called “editor”. but it is not there for your site/theme.
    That would be where the code *should* be located. Now I do not know if that’s where your dev put it- but that is where it is intended to be placed. The theme/child theme functions.php file.

    #58392
    Beth
    Participant

    Hi Anna,
    Hope you had a nice weekend. We are still having some issues. The functions.php is now open for you with editor if you would like. Is there anyway that you would be willing to go in to try the code to remove the View Profile button from product pages? It seems for us, the code duplicates the buttons but maybe you could take a look for yourself if you have minute. We would be truly grateful. Let me know your thoughts, Anna. Thank you for your time!

    Your login:
    USER:Annawcvendors
    PASS:Thanksanna123

    Beth

    #58488
    Anna
    Member

    Beth,
    OK- I logged in and took a look at your functions.php. The code in your functions.php is fine.
    BUT you are also using the plugin BP WC Vendors. The same function(must be declared differently) is in that plugin- so now you are seeing it twice.
    So, either remove the code form us, or remove the BP WC Vendors plugin.
    You can also talk to the author of the BP WC Vendors plugin, he is typically quite helpful. He could help you write a functions in your functions.php to change the button for your shop header if needed; direct him to this thread and the conversation we had above so he can see your dilemma with the button.

    #58496
    Beth
    Participant

    Hey Anna, Thanks so much for this reply. I will pass it on to my dev and see what we can find out. I will be in touch shortly. Have a great day.

Viewing 16 posts - 1 through 16 (of 16 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.