Hello,
Thank you for contacting Rank Math for help with your custom product schema.
I created a schema variable for price without currency symbol. Please use add the following code snippet to your child theme functions.php file and replace %wc_price%
with %rm_price_nosymbol%
add_action( 'rank_math/vars/register_extra_replacements', function(){
rank_math_register_var_replacement(
'rm_price_nosymbol',
[
'name' => esc_html__( 'Product price without currency sign.', 'rank-math' ),
'description' => esc_html__( 'Product price of the current product without currency sign', 'rank-math' ),
'variable' => 'rm_price_nosymbol',
'example' => 'rm_price_nosymbol_call_back()',
],
'rm_price_nosymbol_call_back'
);
});
function rm_price_nosymbol_call_back() {
$product = wc_get_product();
$price = $product->get_price();
return $price;
}
Hope that helps. please let us know if you have questions.
Hello,
We are super happy that we have addressed your concern. If you have any other questions in the future, know that we are here to help you.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.