BuddyBoss Home – Web › Support Forums › Themes › OneSocial theme › The heart button/function
Tagged: favourite, heart button, like
- This topic has 5 replies, 4 contibutors, and was last updated 8 years, 7 months ago by Anve S..
Question
April 12, 2016 at 5:21 am #67784@omarobaidHi there,
Is there a way to make the heart “Favourite” button display for logged out users too? I have changed the CSS so that it displays without the hover for now for logged in users.
So when logged out users click on it, it would ask them to login or register. As no one knows that they can like products unless they register.
Also, would it be possible to make it so that when they click on it, the login/register pops up rather than redirect to the “My Account” page?
Finally, would it be possible to have a like counter for this heart button? It would be more interactive to see that some people liked a product and how popular it is etc?
Answers
April 15, 2016 at 11:53 am #68461@
AnonymousHi @omarobaid, It will need to modify those template files which contain fav button and wrap this one with conditional logic to link it back to login/register page when user is not logged in.
You can use your developers to make those edits, I can help to guide which tempalte files need to be modified.
Regards
Varun DubeyApril 15, 2016 at 12:15 pm #68467@omarobaidSure, please let me know the templates that need to be amended.
Also, as I am the developer here. Could you guide me (or show me a simple code) that I can use to achieve this?
These are the main things I am looking for:
– The heart (favourite) button display at all time (logged in or logged out)
– If the user is logged out and click on it, it pops up the log/register form.
– Add a counter of how many likes the product got.Finally, I would like to add the words “Add to favourite” next to the heart button on a single product page. How can I do this?
April 16, 2016 at 3:19 am #68548@
AnonymousHi @omarobaid
you can remove these to actions and add yours
it’s defined inside
/buddyboss-marketplace/includes/main-class.phpadd_action('woocommerce_after_shop_loop_item', array( $this, 'bm_product_to_favorites' ), 9 ); add_action('woocommerce_after_add_to_cart_form', array( $this, 'bm_product_to_favorites' ) );
bm_product_to_favorites is also defined inside same file, you can use this as reference to define your own function.
Regards
Varun DubeyApril 22, 2016 at 12:08 am #69271@conscious-craftiesI would have thought this would be built in functionality for non logged in users.
It’s functionality that every shop owner would like to see because:
1. Customers see a benefit to creating an account on our sites
2. Encourages customers to favourite items to then add to basketPlease can this be added to the list of things to add in future please rather than each of us developing ourselves?
I previously disabled my wishlist plug in as I hadn’t realised the heart did not appear for logged out users till I saw this thread!
Thank you,
Karen
April 23, 2016 at 12:19 pm #69593@anveThanks for the suggestion , we’ll add this in our suggestion list .
Regards
Anve
- You must be logged in to reply to this question.