Any way to add "Follow button" on Single Product page?

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!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Any way to add "Follow button" on Single Product page?

Viewing 12 reply threads
  • Author
    Posts
    • #86763
      Luke Lee
      Participant

      Hi, using WCFM ultimate, have this question:

      Is there a way for me to add the follow button in the single product page?

      Something that looks like Grailed: https://gyazo.com/e310fd7bdebf6cc6b37473437be9aef8

      Have been looking for a way to add this, like shortcode or something but no luck.

      Looking forward for suggestions.

    • #87075
      WCFM Forum
      Member

      Hi,

      Please use this short code – [wcfm_follow]

      Thank You

    • #87289
      Luke Lee
      Participant

      Hi, I added this short code and it’s not working, nothing showing up.

      Can you elaborate more?

      Thanks.

    • #87290
      Luke Lee
      Participant

      Also, if there are ways to just grab the vendor info card as short code? I want to display the vendor information on single product pages that are separate with product meta itself.

      I found these shortcode from your documentation:

      [wcfm_store_info id=”” data=””]
      [wcfm_follow store=””]

      However, these shortcode accepting the id, which is not what i want. (On single product page, i want it to determine this product belongs to which vendor, and then display this vendor’s information, I will say like Dynamic data)

      How do I achieve this?

    • #87382
      WCFM Forum
      Member

      HI,

      [wcfm_store_info id=”” data=””] – you may use this short code to show vendor’s information.

      [wcfm_follow] – it’s does not support any attribute. Where you have added this, please show me screenshot.

      Thank You

    • #87425
      Luke Lee
      Participant

      Hi,

      Looks like we are not on the same page.

      This short code ” [wcfm_store_info id=”” data=””] ” requires me to put a specific id for it to show a specific vendor info, I don’t want it.

      What I want is to show it dynamically, like this in the single product page that is built with your WCFM ultimate:
      https://gyazo.com/484fb5c6bf1aa28559023041ced1abb9

      As you see, your default Vendor info card is there, but I also want to add a follow button within this info card, something that looks like this on grailed.com:
      https://gyazo.com/97a63a8d003eb2fa3905a86ea43be221

      If that’s possible? thank you.

    • #87772
      WCFM Forum
      Member

      HI,

      This short code ” [wcfm_store_info id=”” data=””] ” requires me to put a specific id for it to show a specific vendor info, I don’t want it.

      – No, if you are using this shortcode at single product page or at store page then no require to specify id. It will auto-detect id. Just specify data attribute.

      Please add this code to your site –

      add_action( 'wcfmmp_sold_by_label_product_page_after', function( $vendor_id ) {
      	echo do_shortcode( '[wcfm_follow label="Follow" store="'.$vendor_id.'"]' );
      });

      Add this code to your child theme’s functions.php
      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

      Thank You

    • #87778
      Luke Lee
      Participant

      Thanks so much! Will try this when I got around my computer, will let you know if it works!

    • #87926
      Luke Lee
      Participant

      Hi, so I got a chance to try these codes, and none of them works unfortunately…

      I use Flatsome theme, and using UX Block to create custom product templates.

      I added the snippet you provided into my child theme function.php, and nothing shows up.

      I added the shortcode you provided into my UX builder, and nothing shows up as well.

      Any advice?

      Thanks.

    • #88371
      WCFM Forum
      Member

      Hi,

      I added the snippet you provided into my child theme function.php, and nothing shows up.

      – Is this “Sold By” block in your custom template?

      If yes, then how you have added that in your template?

      Thank You

    • #88492
      Luke Lee
      Participant

      Hi,

      I assume your “Sold By” block is talking about the vendor info card?

      For that, from Flatsome UX Block, they have a module that is called “Product Hooks”, and I select “WooCommerce Single Product Summary” which I believe they just grab all the datas of the single product from the product and shows it.

      Since WCFM Vendor info card is showing within the “WooCommerce Single Product Summary”, which means there must have a way to show the info card itself without pulling all the WooCommerce Single Product Summary.

      What I was trying to do is just actually either separate the vendor info card from the single product summary, or just add a Follow button into vendor info card, if that makes sense.

    • #90749
      WCFM Forum
      Member

      Hi,

      Add this code to your site –

      add_action( 'wcfmmp_sold_by_label_product_page_after', function( $vendor_id ) {
      	echo do_shortcode( '[wcfm_follow label="Follow" store="'.$vendor_id.'"]' );
      });

      Thank You

    • #90920
      Luke Lee
      Participant

      Hi WCFM team,

      Thanks for the help, the code isn’t working because looks like the location hook isn’t right?

      "wcfmmp_sold_by_label_product_page_after"

      So I have changed the hook myself to this:

      add_action( 'woocommerce_product_meta_start', function( $vendor_id ) {
      	echo '<div class="product-follow">', do_shortcode( '[wcfm_follow label="Follow" store="'.$vendor_id.'"]' ), '</div>';
       
      });

      I have then successfully placed the echo shortcode before the product meta.
      Then with this css to make it line up with the vendor info block:

      .product-follow{
          display: inline-block;
          position: relative;
          float: right;
          top: 118px;
      }

      Hope this helps, even tho I still want to have a correct location hook of your wcfm vendor’s info block on the single product page.

      • #91090

        Hello,

        To “add a Follow button into vendor info card” to single product page try this code,

        add_action( 'after_wcfmmp_sold_by_label_single_product', function( $vendor_id ) {
          echo do_shortcode( '[wcfm_follow label="Follow" store="'.$vendor_id.'"]' );
        });

        Thanks.

Viewing 12 reply threads
  • The topic ‘Any way to add "Follow button" on Single Product page?’ is closed to new replies.