Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Getting "Favorite" button to work in {descriptionfield}
This topic contains 16 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 6 months ago.
- AuthorPosts
- November 3, 2020 at 3:00 pm #30124
Getting “Favorite” button to work in {descriptionfield}. Is it possible?
November 3, 2020 at 4:07 pm #30126Hi,
I will need a bit more information on this one. Is this button added by a shortcode? Or is it something else? Can I see it somewhere? Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 3, 2020 at 4:28 pm #30128Yes shortcode – [favorite_button post_id=”” site_id=””]
You can check it on this post, as well as the main search on the public home page – https://casebites.com/sales-home (see screenshot):
https://casebites.com/knott-v-state/-Carlos
Attachments:
You must be logged in to view attached files.November 4, 2020 at 11:02 am #30136I’m afraid that is probably not possible. I am seeing some missing attributes on the buttons (missing post IDs etc..), and I suspect that the event handler is not connected either. It was probably meant to work within the single post pages only.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 4, 2020 at 1:17 pm #30141Do you think a plugin like this could work instead? https://codeboxr.com/product/cbx-wordpress-bookmark/
November 4, 2020 at 1:46 pm #30143I really don’t think so. Usually these plugins are made to work on the single content pages, and not within custom result containers. I think in almost all cases you will have to do a custom coding to attach the event handlers/styling to the favorite button.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 12:32 am #30158I’m ok with doing some custom coding, would you be able to point me to the file where the class name “hovered” is being added to the outside single result div?
I think this is possible since I see the right attributes being applied as they are in single post.
November 6, 2020 at 9:33 am #30161Sure, it is this one: wp-content/plugins/ajax-search-pro/js/nomin/jquery.ajaxsearchpro.js
Best,
However I am not sure I recommend making direct changes to core plugin files, as during an update they are automatically replaced with the originals.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 9:57 am #30162I really appreciate your help Ernest. Are you available to assist with this feature for an hourly cost? I’ve attached two screenshots of how the code looks on both the results section as well as on the single post. If I have to add/edit a snippet of code on every plugin update then I don’t mind if it means getting this feature working. Thanks again for your assistance.
Attachments:
You must be logged in to view attached files.November 6, 2020 at 10:08 am #30165Unfortunately we are not available for custom jobs.
You could make use of the advanced title and content fields, it allows using some variables (like the post ID), to print the button HTML to the results content. From the button source, it should look something like this:
<a class="simplefavorite-button" data-postid="{__id}" data-siteid="1" data-groupid="1" data-favoritecount="1" style="box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;"> Add Favorite <i class="sf-icon-star-empty"></i> </a>
However you will still need to add the javascript event handlers in order to make it work, I very highly doubt it will do it automatically.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 10:29 am #30166Thanks, yeah if you refresh, that seems to be working! If you now see below, I am able to favorite on the same page but in the Fresh Bites below. Do you think that link being inside the search result live result is what causing the javascript event handler not to execute?
November 6, 2020 at 10:53 am #30167Yes, that is probably the reason.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 6, 2020 at 3:55 pm #30184It’s working on mobile iOS
November 7, 2020 at 3:24 pm #30189That is great, it means that probably only a minor changes is required somewhere.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 10, 2020 at 1:58 pm #30237Hi Ernest, I’m still having trouble so I submitted a job with wpkraken.io. A separate question, is there a way to link the categories that appear on the search result to their individual category archive page?
- AuthorPosts
You must be logged in to reply to this topic.