I've got a option name called Front Screen (Glass Only) for the radio type options and I would like to add a line break or br html tag to the name so it would look like the following on the product page
Front Screen
(Glass Only)
£price
Is that possible to do in opencart 3.0.4.0?
Front Screen
(Glass Only)
£price
Is that possible to do in opencart 3.0.4.0?
Last edited by ianhaney50 on Wed Jun 25, 2025 10:28 pm, edited 1 time in total.
Front Screen<br>(Glass Only)
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Try
{{ option_value.name|raw }}
{{ option_value.name|raw }}
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
You won't be able to get the < and > past the PHP htmlentities() type functions. You'll need to modify the code.ianhaney50 wrote: ↑Wed Jun 25, 2025 5:01 amThank you, I tried that but still got Front Screen<br>(Glass Only)
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
What file would I need to modify and what code would I need to look for please?paulfeakins wrote: ↑Wed Jun 25, 2025 6:02 pmYou won't be able to get the < and > past the PHP htmlentities() type functions. You'll need to modify the code.ianhaney50 wrote: ↑Wed Jun 25, 2025 5:01 amThank you, I tried that but still got Front Screen<br>(Glass Only)
You could try something like the following.
Code: Select all
{{ option_value.name|replace({'(': '<br>('}) }}
Thank you, I worked it out a different way that looks to have worked, I changed the database to the following as it was putting <br> in the database as &lt;br&gt; so updated it using the following sql in phpmyadminADD Creative wrote: ↑Wed Jun 25, 2025 7:25 pmYou could try something like the following.Code: Select all
{{ option_value.name|replace({'(': '<br>('}) }}
Code: Select all
UPDATE oc_option_value_description
SET name = REPLACE(name, '&lt;br&gt;', '<br>')
WHERE name LIKE '%&lt;br&gt;%';
Code: Select all
{{ option_value.name|raw }}
Great!
Got an urgent question that’s keeping you up at night? There might just be a magical inbox ready to help: khnaz35@gmail.com
Enjoy nature
Who is online
Users browsing this forum: No registered users and 71 guests