• Resolved vtrn

    (@vtrn)


    Hello, I use the default schema of WooCommerce in RankMath
    I want the price field in the schema to become 0 in some products
    Please give the code

    (I want it to look like we entered the product price as 0 – so if it needs to be changed anywhere else, please let me know)

Viewing 1 replies (of 1 total)
  • Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @vtrn,

    Thank you so much for getting in touch.

    Please refer to this filter code to set your product’s price to 0 in the schema:
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) { if ( ! is_product() ) { return $entity; } $entity['offers']['price'] = 0; return $entity; } );
    You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

Viewing 1 replies (of 1 total)

The topic ‘price’ is closed to new replies.