Post by ianhaney » Fri Apr 21, 2017 5:27 am

Hi

The product description is being pulled in from a excel spreadsheet from a supplier but in the excel spreadsheet the description does not have any full stops so was seeing if there could be a way using php or javascript could automatically add full stops in and after each full stop add a new line, an example of the issue is on the following URL, The site is built using opencart 2.0.3.1

https://www.onestopappliances.co.uk/DOM ... hine-white

Thank you in advance

Newbie

Posts

Joined
Sun Jun 24, 2012 2:30 am

Post by uksitebuilder » Fri Apr 21, 2017 3:07 pm


ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Newbie

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by ianhaney » Fri Apr 21, 2017 4:50 pm

Is there any other way apart from doing it in the Excel spreadsheet as have altered products since and would overwrite the amendments if had to import the excel spreadsheet again

Newbie

Posts

Joined
Sun Jun 24, 2012 2:30 am

User avatar
Newbie

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by ianhaney » Fri Apr 21, 2017 5:26 pm

Hi artcore

I looked at that link last night but I was unsure what file to modify, I thought it might be the catalog/controller/product/product.php file but in that file I am unsure where to add the coding?

Newbie

Posts

Joined
Sun Jun 24, 2012 2:30 am

Post by artcore » Fri Apr 21, 2017 7:10 pm

Try the controller:

Code: Select all

$data['description'] = html_entity_decode(nl2br($product_info['description']), ENT_QUOTES, 'UTF-8');
If the description contains no newlines it wouldn't work and you have to change the excel.

User avatar
Newbie

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: sculptex and 50 guests