product:price:amount does not display on variable products

#377185
  • Resolved Ternaga store
    Rank Math free

    hi Rankmath Team,

    in order to connect my shop on facebook pixel, I need to display the product:price:amount and product:price:currency tags, except that on variable products, the latter are not displayed.

    would it be possible to help me on this?

    Cheers

Viewing 1 replies (of 1 total)
  • Nigel
    Rank Math business

    Hello,

    Thank you for contacting Rank Math for help with your WooCommerce meta tags.

    To display the price and amount metatags you will need to customize the following code snippet and add it to your (child) theme functions.php file:

    
    add_action( 'rank_math/head', function() {
        if ( ! is_product() ) {
            return;
        }
        echo '<meta property="product:price:amount" content="22" />';
    }, 99 );
    

    You will need to edit the snippet to dynamically pull the correct price depending on your store setup.
    You will also need to create a similar snippet for the meta product currency.

    Hope that helps. Please let us know if you have questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘product:price:amount does not display on variable products’ is closed to new replies.