Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WC Lovers

    (@wclovers)

    I tried to use the shortcode [wcfm_store_info id=”” data=”store_url “] but I could not get it to work for this application.

    – Well, this shortcode return static store page url.

    But for your case you have to generate this URL dynamically depending upon customer’s cart product.

    Thread Starter ftanger

    (@ftanger)

    Yes, I have added the following code to my functions.php to try and see if I could generate a link to the vendor shop homepage. You can see the result at https://unitosports.ga/clubshops/mzc11/ when clicking on any product.

    This function code seems to work but:
    1) It shows a link on a single product page only.
    2) The link label is the “shop name” for example: “S.V. MZC’11” but I need it to be named “Home” for the visitor to understand what it is for.
    3) When clicked on it opens a new browser window. It needs to stay the same window.
    4) I need this link to be visible on every page. Is it possible to add the output of this function to the standard menubar?

    Thanks in advance for your advice, ftanger

    Thread Starter ftanger

    (@ftanger)

    I forgot to add the code snippet, it is:

    add_action( ‘woocommerce_before_single_product’, ‘wc_print_storeinfo’, 10 );

    function wc_print_storeinfo() {
    global $product, $WCFM;
    $id = $product->get_id();
    $vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $id );
    echo do_shortcode( “[wcfm_store_info id='”.$vendor_id.”‘ data=’store_url’]” );
    }

    Plugin Author WC Lovers

    (@wclovers)

    Why are you adding this at single product page when single product page by default shows sold by information – https://ibb.co/cQZQPLD

    3) When clicked on it opens a new browser window. It needs to stay the same window.

    – Add this snippet for this purpose-

    add_filter( 'wcfm_shop_permalink_open_by', '__return_false' );

    4) I need this link to be visible on every page. Is it possible to add the output of this function to the standard menubar?

    – That’s why I told you, “you have to generate this dynamically depending upon cart items.”

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘link back to vendor store url’ is closed to new replies.