add_filter( 'woocommerce_structured_data_product_offer', function( $offer, $product ) {
if ( is_array( $offer ) && isset( $offer['@type'] ) ) {
if ( $offer['@type'] === 'Offer' ) {
$offer['priceCurrency'] = 'TRY';
return $offer;
}
if ( $offer['@type'] === 'AggregateOffer' ) {
$offer['priceCurrency'] = 'TRY';
if ( isset( $offer['offers'] ) && is_array( $offer['offers'] ) ) {
foreach ( $offer['offers'] as $i => $inner ) {
if ( is_array( $inner ) ) {
$offer['offers'][ $i ]['priceCurrency'] = 'TRY';
}
}
}
return $offer;
}
}
if ( is_array( $offer ) ) {
$keys = array_keys( $offer );
$is_list = $keys === range( 0, count( $offer ) - 1 );
if ( $is_list ) {
foreach ( $offer as $i => $maybe ) {
if ( is_array( $maybe ) ) {
$offer[ $i ]['priceCurrency'] = 'TRY';
}
}
return $offer;
}
$offer['priceCurrency'] = 'TRY';
}
return $offer;
}, 999, 2 );Yukarıdaki kodu functions.php'ye ekleyip, cache'leri temizleyip,
https://validator.schema.org/ adresinde url'yi bir daha test edebilir misin?