Import Yotpo Bottomline Ratings for WooCommerce Plugin

Import Yotpo Bottomline Ratings for WooCommerce plugin connects to the Yotpo API to import the average rating and the number of reviews to custom fields on your WooCommerce products.

The names of custom fields that are created on each product and populated are yotpo_product_score and yotpo_total_reviews.

To keep your ratings in sync with Yotpo, the importer can be ran automatically on a schedule of daily, twice-daily, or hourly. You can also run the importer on-demand.

Nice. What can I do with it?

With the added custom fields you can perform custom queries to determine which products are highly rated or which products have the most reviews. You could use these queries for custom widgets or carousels to showcase your best products.

For example...

Get products with a 4 star or better rating:

$args = array(
  'post_type'  => 'product',
  'meta_query' => array(
    array( 
      'key'     => 'yotpo_product_score',
      'value'   => 4,
      'compare' => '>='
    )
 );

$top_rated_products = new WP_Query( $args );

Get products with a 4 star or better rating and sort by review count:

$args = array(
  'post_type'  => 'product',
  'meta_query' => array(
    'relation' => 'AND',
    'product_score_clause' => array( 
      'key'     => 'yotpo_product_score',
      'value'   => 4,
      'compare' => '>='
    ),
    'review_count_clause' => array(
      'key'     => 'yotpo_total_reviews',
      'compare' => 'EXISTS'
    )
  ),
  'orderby' => array(
    'product_score_clause' => 'DESC',
    'review_count_clause'  => 'DESC'
  )
);

$top_rated_products_by_review_count = new WP_Query( $args );

See the code

Buy me a coffee

I enjoyed building this plugin. If you found it useful, consider buying me a coffee.

Feature? Question?

Have an idea for the plugin or need some help? Send me a message.

Feature? Question?

Have a feature idea for the plugin or need some help? Send me a message.