Home Forums WC Vendors Pro Support change sold by name and link.

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 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #11203
    Laurie
    Participant

    Hi,

    I have the wc vendors store embedded in the profile pages of a user. I was wondering if its possible to change the link and the title of the link. to redirect to the profile without changing the function directly?

    Could I do it the same way your function does it below, but rename the function and change the contents to fetch username of vendor (if there is a function for this?) and fetch profile url?

    Any help greatly appreciated!

    link as I’m not sure if I can embed git hub gist

    #11208
    Laurie
    Participant
    #11210
    WC Vendors Support
    Participant

    It was hard understanding what you’re looking for, so I think this is right…… If you provide the user ID, to get their store URL for that user ID, use:

    WCVendors_Pro_Vendor_Controller::get_vendor_store_url( $user_id) ;

    #11211
    Laurie
    Participant

    Hi!

    Sorry I wrote it a bit quickly.

    My PHP knowledge isn’t great but I’m trying to change the url and the name of the store. to the name of the user who owns it, and change the link to their buddypress profile.

    do you have a function that fetches the username or ID of the store owner? using that I could also construct a url that links to their buddypress profile.

    Also can I use a similar structure to the product_sold_by() and the loop_sold_by() functions?

    Thanks again.

    #11624
    WC Vendors Support
    Participant

    Fetching the user ID varies per page you are on.


    @digitalchild
    for more input

    #11625
    Laurie
    Participant

    What would the function be to fetch the username in the product page and the product loop?

    #11630
    WC Vendors Support
    Participant

    It depends on your site and your theme.

    The vendors user id of a product is the same as the products post_author. If the post_author is 1, then the user id of the vendor is 1, and from that, you can get any data you wish. So get the post_author and you have all you need to customize the hell out of things. 🙂

    #11638
    Jamie
    Keymaster

    Hello,

    Are you just trying to change the “Sold By” text to be the username instead of the store id and the URL to go to their buddypress profile instead of their store?

    Firstly change the following in the backend :

    WooCommerce > WC Vendors > General
    Vendor Display Name: User Login

    To change the link to go to the buddypress profile use the following code in your themes function.

    https://gist.github.com/digitalchild/badabf867eaff01a9fb0

    Just a side note, while writing this and testing it I noticed that there was a duplicate filter name in the source code so this will only work in the loop page until next release, unless you feel like editing the source code to fix the typo.

    If you do you would need to change line 611 in public/class-wcvendors-pro-store-controller.php

    change wcv_loop_sold_by to wcv_product_sold_by

    cheers,

    Jamie.

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