Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Any way to add "Follow button" on Single Product page?
- This topic has 13 replies, 3 voices, and was last updated 5 years ago by Sarmistha Chakraborty.
- AuthorPosts
- October 14, 2019 at 11:30 am #86763Luke LeeParticipant
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.
- October 16, 2019 at 12:01 pm #87075WCFM ForumMember
Hi,
Please use this short code –
[wcfm_follow]
Thank You
- October 16, 2019 at 11:40 pm #87289Luke LeeParticipant
Hi, I added this short code and it’s not working, nothing showing up.
Can you elaborate more?
Thanks.
- October 16, 2019 at 11:44 pm #87290Luke LeeParticipant
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?
- October 17, 2019 at 5:33 pm #87382WCFM ForumMember
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
- October 17, 2019 at 10:13 pm #87425Luke LeeParticipant
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/484fb5c6bf1aa28559023041ced1abb9As 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/97a63a8d003eb2fa3905a86ea43be221If that’s possible? thank you.
- October 20, 2019 at 10:29 am #87772WCFM ForumMember
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
- October 20, 2019 at 10:56 am #87778Luke LeeParticipant
Thanks so much! Will try this when I got around my computer, will let you know if it works!
- October 21, 2019 at 10:34 am #87926Luke LeeParticipant
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.
- October 23, 2019 at 10:00 am #88371WCFM ForumMember
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
- October 23, 2019 at 1:15 pm #88492Luke LeeParticipant
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.
- November 5, 2019 at 3:57 pm #90749WCFM ForumMember
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
- November 5, 2019 at 11:56 pm #90920Luke LeeParticipant
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.
- November 6, 2019 at 4:14 pm #91090Sarmistha ChakrabortyMember
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.
- AuthorPosts
- The topic ‘Any way to add "Follow button" on Single Product page?’ is closed to new replies.