Replace substring in view fields

Главная » Blog » Replace substring in view fields

In the dasmebel web site, which I have already told in previous post, I needed to conclude “Characteristics” word in noindex. But it is located not in its own field but with product information. For decision of this task I used php ф-ции str_replace function.
First of all we handle view field:

$characteristics = str_replace('<p><strong>Характеристики: </strong></p>', '<noindex><p><strong>Характеристики: </strong></p></noindex>', $fields['field_specs_value']->content);

And now we print it

print '<div class="cat-product-specs">' . $characteristics . '</div>'; // аннотация описания товара

Pin It on Pinterest

Share This