-
Hi,
there is a price mismatch due to taxes. There was already an issue about this on Github: https://github.com/woocommerce/woocommerce/issues/18852There is also a workaround for this problem:
function priceWithTaxesSEO( $markup, $product ) {
if ( is_product() ) {
$precioConIVA = (float)$markup['offers'][0]['price'] + ( (float)$markup['offers'][0]['price'] * 0.21 );
$precioConIVA = number_format($precioConIVA, 2, '.', '');$markup['offers'][0]['price'] = $precioConIVA;
$markup['offers'][0]['priceSpecification']['price'] = $precioConIVA;
// Especifica si el impuesto al valor agregado (IVA) aplicable está incluido en la especificación de precio o no.
$markup['offers'][0]['priceSpecification']['valueAddedTaxIncluded'] = 'true';
}return $markup;
}
add_filter( 'woocommerce_structured_data_product', 'priceWithTaxesSEO', 100, 2 );Since Rank Math overwrites the structured data, this workaround does not work.
Can you please tell me how to override the behavior of Rank Math?
You must be logged in to reply to this ticket.