Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
Additional context
There is wrong ordering in seo-by-rank-math>includes>modules>schema>snippets>class-product.php
function get_category( $product_id, $taxonomy )
get_ancestors() of currentCategory retrieves parent categories in reverse order, then you add currentCategory at the end. Should be opposite.
Describe the bug Wrong category hierarchy in Product Schema Actual product category structure: Parent1 > Parent2> Parent3 > currentCategory
in schema: [@type] Product ... [category] => Parent3> Parent2> Parent1 > currentCategory
Expected behavior [category] => Parent1> Parent2> Parent3 > currentCategory
Additional context There is wrong ordering in seo-by-rank-math>includes>modules>schema>snippets>class-product.php function get_category( $product_id, $taxonomy )
get_ancestors() of currentCategory retrieves parent categories in reverse order, then you add currentCategory at the end. Should be opposite.