-
Hi rankmath team,
thank’s for your great product.
We encountered a strange problem on a website.
In this website, Rankmath and EDD are used with the Iranian RIAL currency.then added this code to rank-math.php in child theme to fix the problem(kkstar used as aggregateRating):
add_filter( “rank_math/snippet/rich_snippet_product_entity”, “custom_kksr_rating”);function custom_kksr_rating ( $entity ) {
$id = get_the_ID();
$temprend = get_post_meta($id, ‘kksr_sd’, true);
//var_dump($temprend);$i = get_post_meta($id, ‘_kksr_count_default’, true );
$sumstar = get_post_meta($id, ‘_kksr_ratings_default’, true );
$star = round($sumstar / $i);
$entity[‘offers’][‘priceCurrency’] = ‘IRR’;
$entity[‘aggregateRating’] = [
“@type” => “AggregateRating”,
“ratingValue” => “$star”,
“reviewCount” => “$i”,
];
//var_dump($entity);
return $entity;
}
?>The problem was solved, but 2 schemas were created for each product, one of which has error 4217 and the other is correct.
is there any way to remove the incorrect schema?
The ticket ‘EDD Duplicated Schema problem’ is closed to new replies.