Getting "Favorite" button to work in {descriptionfield}

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 Ernest Marcinko 1 year, 8 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #30124
    clopez37
    clopez37
    Participant

    Getting “Favorite” button to work in {descriptionfield}. Is it possible?

    #30126
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #30128
    clopez37
    clopez37
    Participant

    Yes 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.
    #30136
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I’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 :)


    #30141
    clopez37
    clopez37
    Participant

    Do you think a plugin like this could work instead? https://codeboxr.com/product/cbx-wordpress-bookmark/

    #30143
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I 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 :)


    #30158
    clopez37
    clopez37
    Participant

    I’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.

    #30161
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sure, it is this one: wp-content/plugins/ajax-search-pro/js/nomin/jquery.ajaxsearchpro.js
    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #30162
    clopez37
    clopez37
    Participant

    I 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.
    #30165
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Unfortunately 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 :)


    #30166
    clopez37
    clopez37
    Participant

    Thanks, 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?

    #30167
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Yes, that is probably the reason.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #30184
    clopez37
    clopez37
    Participant

    It’s working on mobile iOS

    #30189
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That 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 :)


    #30237
    clopez37
    clopez37
    Participant

    Hi 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?

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.