Hi @robertvdijk,
Is it possible to import a average review score and review count?
Yes, you can use these instructions to import the count and average rating into the ‘_wc_review_count’ and ‘_wc_average_rating’ fields: http://www.wpallimport.com/documentation/custom-fields/theme-plugin-fields/.
You’ll also need to import the ‘_wc_rating_count’ field, which is a serialized array of each rating number. It would be easiest to pass the count and average to a PHP function to generate that: https://www.wpallimport.com/documentation/developers/custom-code/inline-php/.
Here is an example function that you can test and modify as needed:
function my_output_rating( $count, $average ) {
$rating = array();
for ( $i = 1; $i <= $count; $i++ ) {
$rating[] = (int) $average;
}
return serialize( $rating );
}
Hi @robertvdijk,
I’m going to go ahead and mark this as resolved since it’s been a while. Let us know if you still have questions.
Anyone else with questions, please open a new topic.