1. mrblonde
  2. RO CSVI
  3. Monday, 29 May 2017
  4.  Subscribe via email
Hi,

I'm in the process of migrating product from a Joomla 2.5.28/VirtueMart 2.0.26d site and importing into a Joomla 3.7.2/VirtueMart 3.2.2 site.

On the Joomla 2.5 site I've installed CSVI 5.11. Everything exports OK except the product_s_desc doesn't include the line breaks which on the site <br> is used. When I open the exported CSV file in OpenOffice for Mac the description just shows with white spaces where a line break should be. An example CSV is attached.

In the CSVI export configuration I have:
Export Type - CSV
Field Delimiter - ,
Text Enclosure - "
Include column headers - Yes
Excel CSV - No

Not surprisingly importing this CSV into Joomla 3/CSVI Pro 7.1.0 doesn't show line breaks either.

I'm sure there's something I'm doing wrong but can't find anything that would resolve it.

Regards,
Julian.
Accepted Answer Pending Moderation
Hello Julian,
From what i can see is that <br> tags in product_s_desc field has been stripped and that is creating empty space in place of it. Check on the rules running on the export template, could be because of any replacement rule set for product_s_desc field. Can you also post a screenshot on how product_s_desc stored in your database to check?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Tharuna,

I'm not sure where rules in CSVI v5 (free) are defined but have been through all config settings in the export template as well as Options, Maintenance and Settings and can't see anything that would be stripping them out. I certainly haven't created any rules that I know of. All I've done is installed CSVI into Joomla 2.5 and created a simple export template for VirtueMart products.

Using the first product in the supplied example CSV I've attached a screenshot of the database entry for that product's product_s_desc field from phpMyAdmin and a screenshot showing how it looks on the front end. I can't see any line breaks in the database however something is adding them because of all the <br> breaks on the front end.

The rendered source code for the short description is pasted below:

<div class="product-short-description">
Genuine Lexmark C792 Extra High Yield Return Program Toner - Yellow<br>
To suit Lexmark C792DE<br>
Rated Yield of 20,000 pages<br>
<br>
Price Excludes GST. </div>

Regards,
Julian.
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Julian,
The screenshot explains why you dont see <br> tags in your export file. CSVI don't do any processing on fields and exports whats in database. I read somewhere in VirtueMart forums that the HTML tags are stripped for product_s_desc field in VM 2 version and when saved to database. As of frontend, i can only think that there must be code in VirtueMart to convert spaces to these <br> to display on frontend.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi Tharuna,

Yes I thought the same when I saw how the table in the database was showing without line breaks.

Not an ideal situation but can't be helped. Although out of the scope of this forum can you think of any hacks to get around it? I thought of running a find and replace in OpenOffice where if it finds a word with a capital letter in the middle (where a line break should be), it manually adds a <br> before the capital letter. Unfortunately I have no idea whether it's possible or how to even do it.

Regards,
Julian.
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Julian,
You can try using a replacement rule in CSVI 5 version and with regex. I have no great knowledge on regular expressions but something like '~^[A-Z]~' should find the capital letters in given string. Use this regex in Find field, Replace field should be <br> and method should be Regular expression in your replacement rule. Apply this rule on product_s_desc and run the export. See if it helps.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi Tharuna,

Thank you so much for that. The regex you suggested didn't work however it has put me on track (and a whole lot I've learned today) so have been playing with some alternatives.

I'm not quite there yet but hopefully can figure it out.

Regards,
Julian.
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hello Julian,

Looking at your PhpMyAdmin screenshot the short description does have carriage returns and linefeeds. Give this regex a try:
/\r\n/ 

Use this in the find box and in the replace box put the <br /> tag. See if that helps.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hi Roland,

You are a genius! " /\r\n/ " worked first time and for this specific task has made CSVI an even more powerful extension than I first thought.

Thank you both for your help and support.

Regards,
Julian.
  1. more than a month ago
  2. RO CSVI
  3. # 8
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!