MyCRED badges..

This topic contains 14 replies, has 2 voices, and was last updated by  Alex Rollin 5 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #471783

    Rodney Chatman
    Expired Member
    Post count: 89

    Hello,

    I have worked with the good folks over and MyCRED and they have created a custom hook to assign points based on the star rating left in the review. I would like for the badges to be assigned to the listing instead of the user. The user still get the points but the badge will go to the listing. Is this a thing to custom code in the GeoDirectory plug-in or MyCRED?

    #471802

    Alex Rollin
    Moderator
    Post count: 27815
    #471894

    Rodney Chatman
    Expired Member
    Post count: 89

    This can work for me. Is there a place where key values and options are documented? I’d like to use # of ratings left by users and average star rating to assign badges.

    #471922

    Rodney Chatman
    Expired Member
    Post count: 89

    Hello,

    This is the code I am using for ‘Featured’ and ‘New Listing’ (less than 30 days old) the Featured badge is showing but not using the font awesome icons. The ‘New Listing’ badge isn’t showing at all.

    
    
    [gd_archive_item_section type='open' position='left']
    [gd_post_images type='image' ajax_load='true' link_to='post' show_logo='true'][gd_archive_item_section type='close' position='left']
    [gd_archive_item_section type='open' position='right']
    [gd_post_title tag='h2']
    
    <em>[gd_post_badge key="post_date" condition="is_less_than" match="+30" <i class="fas fa-star" aria-hidden="true"></i>New Listing' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="new"]
    
    [gd_post_badge key="featured" condition="is_not_empty" <i class="fas fa-star" aria-hidden="true"></i>Featured' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="featured"]</em>
    
    [gd_author_actions author_page_only='1']
    [gd_post_distance]
    [gd_post_rating alignment='left' ]
    
    [gd_post_fav show='' alignment='right' ]
    [gd_post_meta key='business_hours' location='listing']
    [gd_output_location location='listing']
    [gd_post_meta key='post_content' show='value-strip']
    [gd_archive_item_section type='close' position='right']
    #471925

    Rodney Chatman
    Expired Member
    Post count: 89

    Badges aren’t cooperating. The Feature badge shows but it doesn’t have the font awesome icons attached. The New Listing badge doesn’t show at all.

    [gd_archive_item_section type='open' position='left']
    [gd_post_images type='image' ajax_load='true' link_to='post'show_logo='true' ]
    [gd_archive_item_section type='close' position='left'][gd_archive_item_section type='open' position='right']
    [gd_post_title tag='h2']
    
    [gd_post_badge key="post_date" condition="is_less_than" match="+30" <i class="fas fa-star" aria-hidden="true"></i>New Listing' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="new"]
    
    [gd_post_badge key="featured" condition="is_not_empty" <i class="fas fa-star" aria-hidden="true"></i>Featured' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="featured"]
    
    [gd_author_actions author_page_only='1']
    [gd_post_distance]
    [gd_post_rating alignment='left' ]
    [gd_post_fav show='' alignment='right' ]
    [gd_post_meta key='business_hours' location='listing'][gd_output_location location='listing']
    [gd_post_meta key='post_content' show='value-strip'][gd_archive_item_section type='close' position='right']
    #471933

    Alex Rollin
    Moderator
    Post count: 27815

    You can add additional HTML into the badge to show whatever you like, including icons.
    Badges don’t have the same options as GD Post Meta for icon, label, value.

    For HTML make sure to enclose the html like:

    
    
    
    badge='<i class="fas fa-star" aria-hidden="true"></i>New Listing'
    

    You can find some examples here: https://wpgeodirectory.com/docs-v2/faq/common-examples/#gd_post_badge

    #471934

    Rodney Chatman
    Expired Member
    Post count: 89

    Here’s what I currently have, see attached screenshot

    [gd_post_badge key="post_date" condition="is_less_than" match="+30" badge='<i class="fas fa-check-circle"></i>New Listing' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="new"]
    
    [gd_post_badge key="featured" condition="is_not_empty" badge='<i class="fas fa-certificate"></i>Featured' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="featured"]
    
    [gd_post_badge key="claimed" condition="is_not_empty" badge='<i class="fas fa-check-circle"></i>Verified' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="verified"]
    
    [gd_post_badge key="claimed" condition="is_empty" badge='<i class="far fa-question-circle"></i>Unclaimed' bg_color="#ff8040" txt_color="#ffffff" size="small" alignment="right" css_class="unverified"]
    #471937

    Rodney Chatman
    Expired Member
    Post count: 89

    Do I have to create a custom field in the CPT and create a Field Key in order for the badges to work?

    #471945

    Alex Rollin
    Moderator
    Post count: 27815

    The key is the field key for the specific field.
    Are you using shortcode builder to create them?
    That will show you which keys are available on your site.

    #471973

    Rodney Chatman
    Expired Member
    Post count: 89

    Thanks for you assistance. I was able to get things right using the shortcode builder, very handy tool. Is there a way to reference a listings overall or average star rating via a key?

    #471988

    Alex Rollin
    Moderator
    Post count: 27815

    No, but there is the gd_ratings element that shows stars.
    What are you after, exactly?

    #471994

    Rodney Chatman
    Expired Member
    Post count: 89

    I want to assign a “verified” badge to all listings with 5 or more reviews. I want to assign a “trusted provider” badge to all listings with an average of 4 stars for all reviews given.

    #472000

    Rodney Chatman
    Expired Member
    Post count: 89

    Seeing as how I’ve been messing around with

    overall_rating

    I think it bears on this current conversation. Not sure what I did, I am sure that I did it! This error happens with every review submitted for a listing and overall ratings stars don’t light up. Any idea?

    [02-Mar-2019 04:27:23 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query SELECT ratings, rating_count, overall_rating FROM aa8_geodir_gd_business_detail WHERE post_id = 13672 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/kleo/page.php'), get_template_part, locate_template, load_template, require('/themes/kleo/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, GeoDir_Template_Loader::setup_singular_page, do_shortcode, preg_replace_callback, do_shortcode_tag, WP_Super_Duper->shortcode_output, GeoDir_Widget_Single_Tabs->output, GeoDir_Widget_Single_Tabs->tab_content, comments_template, require('/plugins/geodirectory/templates/reviews.php'), do_action('geodir_after_review_list_title'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Review_Rating_Manager_Public->show_overall_multiratings, geodir_reviewrating_get_post_rating
    [02-Mar-2019 04:28:56 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query UPDATE 
    aa8_geodir_gd_business_detail

    SET

    overall_rating

    = 2.973684,

    rating_count

    = 38 WHERE

    post_id

    = 13672 made by wp_handle_comment_submission, wp_new_comment, do_action('comment_post'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Comments::save_rating, GeoDir_Comments::update_post_rating
    [02-Mar-2019 04:28:56 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query UPDATE

    aa8_geodir_gd_business_detail

    SET

    overall_rating

    = 2.973684,

    rating_count

    = 38 WHERE

    post_id

    = 13672 made by wp_handle_comment_submission, wp_new_comment, do_action('comment_post'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Review_Rating_Manager_Public->geodir_reviewrating_save_rating, geodir_reviewrating_update_postrating, geodir_reviewrating_update_postrating_all, geodir_update_postrating, GeoDir_Comments::update_post_rating
    [02-Mar-2019 04:28:56 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query UPDATE

    aa8_geodir_gd_business_detail

    SET

    overall_rating

    = 2.973684,

    rating_count

    = 38 WHERE

    post_id

    = 13672 made by wp_handle_comment_submission, wp_new_comment, do_action('comment_post'), WP_Hook->do_action, WP_Hook->apply_filters, geodir_reviewrating_save_rating_func, geodir_reviewrating_update_postrating, geodir_reviewrating_update_postrating_all, geodir_update_postrating, GeoDir_Comments::update_post_rating
    [02-Mar-2019 04:28:58 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query SELECT ratings, rating_count, overall_rating FROM aa8_geodir_gd_business_detail WHERE post_id = 13672 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/kleo/page.php'), get_template_part, locate_template, load_template, require('/themes/kleo/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, GeoDir_Template_Loader::setup_singular_page, do_shortcode, preg_replace_callback, do_shortcode_tag, WP_Super_Duper->shortcode_output, GeoDir_Widget_Single_Tabs->output, GeoDir_Widget_Single_Tabs->tab_content, comments_template, require('/plugins/geodirectory/templates/reviews.php'), do_action('geodir_after_review_list_title'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Review_Rating_Manager_Public->show_overall_multiratings, geodir_reviewrating_get_post_rating

    #472001

    Rodney Chatman
    Expired Member
    Post count: 89

    Not sure what I did, I am sure that I did it. This error happens with every review submitted for a listing and overall ratings stars don’t light up. I’ve been playing with the “overall_rating” variable but I’m certain I have done anything with the database.

    [02-Mar-2019 04:27:23 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query SELECT ratings, rating_count, overall_rating FROM aa8_geodir_gd_business_detail WHERE post_id = 13672 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/kleo/page.php'), get_template_part, locate_template, load_template, require('/themes/kleo/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, GeoDir_Template_Loader::setup_singular_page, do_shortcode, preg_replace_callback, do_shortcode_tag, WP_Super_Duper->shortcode_output, GeoDir_Widget_Single_Tabs->output, GeoDir_Widget_Single_Tabs->tab_content, comments_template, require('/plugins/geodirectory/templates/reviews.php'), do_action('geodir_after_review_list_title'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Review_Rating_Manager_Public->show_overall_multiratings, geodir_reviewrating_get_post_rating
    [02-Mar-2019 04:28:56 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query UPDATE 
    aa8_geodir_gd_business_detail

    SET

    overall_rating

    = 2.973684,

    rating_count

    = 38 WHERE

    post_id

    = 13672 made by wp_handle_comment_submission, wp_new_comment, do_action('comment_post'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Comments::save_rating, GeoDir_Comments::update_post_rating
    [02-Mar-2019 04:28:56 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query UPDATE

    aa8_geodir_gd_business_detail

    SET

    overall_rating

    = 2.973684,

    rating_count

    = 38 WHERE

    post_id

    = 13672 made by wp_handle_comment_submission, wp_new_comment, do_action('comment_post'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Review_Rating_Manager_Public->geodir_reviewrating_save_rating, geodir_reviewrating_update_postrating, geodir_reviewrating_update_postrating_all, geodir_update_postrating, GeoDir_Comments::update_post_rating
    [02-Mar-2019 04:28:56 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query UPDATE

    aa8_geodir_gd_business_detail

    SET

    overall_rating

    = 2.973684,

    rating_count

    = 38 WHERE

    post_id

    = 13672 made by wp_handle_comment_submission, wp_new_comment, do_action('comment_post'), WP_Hook->do_action, WP_Hook->apply_filters, geodir_reviewrating_save_rating_func, geodir_reviewrating_update_postrating, geodir_reviewrating_update_postrating_all, geodir_update_postrating, GeoDir_Comments::update_post_rating
    [02-Mar-2019 04:28:58 UTC] WordPress database error Unknown column 'overall_rating' in 'field list' for query SELECT ratings, rating_count, overall_rating FROM aa8_geodir_gd_business_detail WHERE post_id = 13672 made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/kleo/page.php'), get_template_part, locate_template, load_template, require('/themes/kleo/content-page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, GeoDir_Template_Loader::setup_singular_page, do_shortcode, preg_replace_callback, do_shortcode_tag, WP_Super_Duper->shortcode_output, GeoDir_Widget_Single_Tabs->output, GeoDir_Widget_Single_Tabs->tab_content, comments_template, require('/plugins/geodirectory/templates/reviews.php'), do_action('geodir_after_review_list_title'), WP_Hook->do_action, WP_Hook->apply_filters, GeoDir_Review_Rating_Manager_Public->show_overall_multiratings, geodir_reviewrating_get_post_rating

    #472566

    Alex Rollin
    Moderator
    Post count: 27815

    Looks like you tried to add a badge calling on overall_rating, so, try removing that one.

    I will add your idea to the list for features

    Allow GD Badge to search/query the overall rating , ie equal to 5

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket