FranciscoVillen Posted May 20, 2016 Share Posted May 20, 2016 Hi mates, I'm using SQL Manager to export some info of products. In my query I want to replace the newlines for br html tag. So, I use something like this in the sql sentence: (REPLACE(pl.description_short, '\r\n','<br />')) But SQL Manager is stripping html tags in the field description_short when the CSV file is generated. Do someone know a way to avoid that SQL manager strips html?. Best regards. Link to comment Share on other sites More sharing options...
tuk66 Posted May 20, 2016 Share Posted May 20, 2016 Have you tried to use < instead of <? 1 Link to comment Share on other sites More sharing options...
FranciscoVillen Posted May 20, 2016 Author Share Posted May 20, 2016 Hi Took if I put <br> the sql manager doesn't remove it. But should it work as the <br> tag?, and there is another problem with < you are using the character ; which is problematic in a CSV file with fields separated by ; Is it possible that SQL manager generate a CSV with a distinct character to separate fields? Link to comment Share on other sites More sharing options...
tuk66 Posted May 21, 2016 Share Posted May 21, 2016 ; is no problem as long as it is enclosed between quotation marks. 1 Link to comment Share on other sites More sharing options...
FranciscoVillen Posted May 23, 2016 Author Share Posted May 23, 2016 Thanks Tuk, I didn't know that. I have reached the code where the tags are stripped. It is in /controllers/admin/AdminRequestSqlController.php in the function generateExport it have inside a fputs call: strip_tags($result[$name]) Changing for: $result[$name] It will avoid that html tags in description to be stripped. I have done the change in the folder override, so it won't be removed if prestashop is updated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now