Situation: PHP-based CMS (OpenCart 2.0.3.1) -> category page -> outputs the product names via:
<?php echo $product['name']; ?>
Problem: need to wrap a portion of the product name, to the next line. For example, what currently displays as 20-inch Blue Widget For Golfers
should display as
20-inch Blue
Widget for Golfers
So every product that has the word "Widget" (or "AnotherKeyword" in it), should have a <br>
before it.
How can this be done?
P.S. Changing the product name itself to include a <br>
or <br>
doesn't work, since OpenCart displays whatever is in the Product Name field literally, ignoring HTML. (Unless someone can point me in the direction of "how to echo the $product[name] but actually process the HTML in it").
widget`? – u_mulder Jan 06 '17 at 19:00
` ...unless I can somehow change the `echo $product['name']` to process the HTML tags? That would solve my problem, as a work-around. (I would still have to insert the "
" into every product name, but it's doable). I would prefer to have a solution that doesn't involve adding extra junk into the actual product data though... – TomJones999 Jan 06 '17 at 20:23