Magento Forum

How to import/export Product descriptions with html in them
 
mikefifield
Member
 
Avatar
Total Posts:  49
Joined:  2008-05-24
 

All of my product descriptions have html in them. I am trying to export and then import them to a different server but when I export the descriptions magento converts all the html tags into html entities like these: 

&amp
gt;

However when I import the products into the new server the html entities do not get converted back into html.

I have searched everywhere and cant seem to find a fix for this. Has anyone figured out how to import/export there products without this happening?

Thanks!!

Mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
Grut
Sr. Member
 
Total Posts:  164
Joined:  2009-12-03
Ukraine
 

You can export products and descriptions with Store Manager for Magento correctly.

Look at this screenshot. This is step 5 of “Import/Export Products” Wizard. As you can see, this tool allows you to configure and export any data you need.

I added csv file to this post. Therefore you can see that all html tags have been exported correctly. Further you can import your data to another Magento store properly.

Admit, Store Manager for Magento is commercial product, but there is trial version which means that you can use it one month for free. So if you need to import/export once, be my guest!

Hope I was helpful smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Grut
Sr. Member
 
Total Posts:  164
Joined:  2009-12-03
Ukraine
 
Biscuit1001 - 27 June 2010 08:16 PM

Grut - 15 June 2010 06:50 AM
Hope I was helpful smile

Not one bit. The OP asked a specific question, and you try to hawk your product. The forums are for user-to-user help, not for free advertising for your commercial product.

Check this:

Admit, Store Manager for Magento is commercial product, but there is trial version which means that you can use it one month for free. So if you need to import/export once, be my guest!

I don’t ask him to buy smth. He had a problem - I just suggested solution. My software allows to solve his issue fast, quality and free. So what’s the problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
solanadesign
Jr. Member
 
Total Posts:  6
Joined:  2010-05-28
 

No more squabbling…

Does someone have an answer for this very important and annoying issue?

 
Magento Community Magento Community
Magento Community
Magento Community
 
videohead
Jr. Member
 
Total Posts:  22
Joined:  2010-10-14
 

These are special entities in HTML.
http://htmlhelp.com/reference/html40/entities/special.html

You could do this with some capable PHP or a regular expressions editor, or just use a decent text editor and find and replace these characters with their safe equivalents. In the world of character formatting, this is not a big deal.
For example - find & replace with and
Find & gt; and replace with greater than.

This is not a bug, most database and web systems have character registries. Learn a bit more about UTF encoding and character encoding in general, you’ll complain less about Magento and more about other, less elegant db systems.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mkk_kashif
Jr. Member
 
Total Posts:  25
Joined:  2010-12-22
 

Solution:

Go to Module -> Controller, e.g.: app/code/local/google/events/controllers/adminhtml/EventsController

Find, and replace following Method:
Only one line added and commented in code.

protected function _sendUploadResponse($fileName$content$contentType='application/octet-stream'{
        $content 
str_replace('&''&'$content); /*Only this new line added*/
        
$response $this->getResponse();
        
$response->setHeader('HTTP/1.1 200 OK''');
        
$response->setHeader('Pragma''public'true);
        
$response->setHeader('Cache-Control''must-revalidate, post-check=0, pre-check=0'true);
        
$response->setHeader('Content-Disposition''attachment; filename=' $fileName);
        
$response->setHeader('Last-Modified'date('r'));
        
$response->setHeader('Accept-Ranges''bytes');
        
$response->setHeader('Content-Length'strlen($content));
        
$response->setHeader('Content-type'$contentType'text/xml; charset=UTF-8');
        
$response->setBody($content);     
        
$response->sendResponse();
        die;
    
}
Thanks,

Kashif

 
Magento Community Magento Community
Magento Community
Magento Community
 
torsti
Jr. Member
 
Total Posts:  14
Joined:  2010-07-26
 

I have the same Problem with XML Export - it converts all HTML Tags to Escape Sequences - e.g.
<p> is shown in XML File as <p>
This happens in Description and short Description.

1.6.2.0 works well on the same Server, 1.7.0.2 does not. So i guess it is a new “Feature” (Bug) .

After importing an Export all Tags are not shown as Tags, they all be shown as Escape Sequences.

Any Solutions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
torsti
Jr. Member
 
Total Posts:  14
Joined:  2010-07-26
 
mkk_kashif - 09 August 2012 09:21 PM

Solution:

Go to Module -> Controller, e.g.: app/code/local/google/events/controllers/adminhtml/EventsController

Find, and replace following Method:
Only one line added and commented in code.

protected function _sendUploadResponse($fileName$content$contentType='application/octet-stream'{
        $content 
str_replace('&amp;''&'$content); /*Only this new line added*/
        
$response $this->getResponse();
        
$response->setHeader('HTTP/1.1 200 OK''');
        
$response->setHeader('Pragma''public'true);
        
$response->setHeader('Cache-Control''must-revalidate, post-check=0, pre-check=0'true);
        
$response->setHeader('Content-Disposition''attachment; filename=' $fileName);
        
$response->setHeader('Last-Modified'date('r'));
        
$response->setHeader('Accept-Ranges''bytes');
        
$response->setHeader('Content-Length'strlen($content));
        
$response->setHeader('Content-type'$contentType'text/xml; charset=UTF-8');
        
$response->setBody($content);     
        
$response->sendResponse();
        die;
    
}
Thanks,

Kashif

I tried to use this for my Exportproblem but i sould not find the right File on 1.7.0.2 - please tell me where i have to look for this code, in which file is the export generated?

 
Magento Community Magento Community
Magento Community
Magento Community
 
palumbosrl
Jr. Member
 
Total Posts:  8
Joined:  2012-12-07
 

Same problem for me,any helps?
thanks

torsti - 28 September 2012 01:48 AM

mkk_kashif - 09 August 2012 09:21 PM
Solution:

Go to Module -> Controller, e.g.: app/code/local/google/events/controllers/adminhtml/EventsController

Find, and replace following Method:
Only one line added and commented in code.
protected function _sendUploadResponse($fileName$content$contentType='application/octet-stream'{
        $content 
str_replace('&amp;''&'$content); /*Only this new line added*/
        
$response $this->getResponse();
        
$response->setHeader('HTTP/1.1 200 OK''');
        
$response->setHeader('Pragma''public'true);
        
$response->setHeader('Cache-Control''must-revalidate, post-check=0, pre-check=0'true);
        
$response->setHeader('Content-Disposition''attachment; filename=' $fileName);
        
$response->setHeader('Last-Modified'date('r'));
        
$response->setHeader('Accept-Ranges''bytes');
        
$response->setHeader('Content-Length'strlen($content));
        
$response->setHeader('Content-type'$contentType'text/xml; charset=UTF-8');
        
$response->setBody($content);     
        
$response->sendResponse();
        die;
    
}
Thanks,

Kashif

I tried to use this for my Exportproblem but i sould not find the right File on 1.7.0.2 - please tell me where i have to look for this code, in which file is the export generated?

 
Magento Community Magento Community
Magento Community
Magento Community
 
torsti
Jr. Member
 
Total Posts:  14
Joined:  2010-07-26
 
mkk_kashif - 09 August 2012 09:21 PM

Solution:

Go to Module -> Controller, e.g.: app/code/local/google/events/controllers/adminhtml/EventsController

Find, and replace following Method:
Only one line added and commented in code.

protected function _sendUploadResponse($fileName$content$contentType='application/octet-stream'{
        $content 
str_replace('&amp;''&'$content); /*Only this new line added*/
        
$response $this->getResponse();
        
$response->setHeader('HTTP/1.1 200 OK''');
        
$response->setHeader('Pragma''public'true);
        
$response->setHeader('Cache-Control''must-revalidate, post-check=0, pre-check=0'true);
        
$response->setHeader('Content-Disposition''attachment; filename=' $fileName);
        
$response->setHeader('Last-Modified'date('r'));
        
$response->setHeader('Accept-Ranges''bytes');
        
$response->setHeader('Content-Length'strlen($content));
        
$response->setHeader('Content-type'$contentType'text/xml; charset=UTF-8');
        
$response->setBody($content);     
        
$response->sendResponse();
        die;
    
}
Thanks,

Kashif

I searched for File like you said in
app/code/local/google/events/controllers/adminhtml/EventsController
and found some in
\app\code\core\Mage\ImportExport\controllers\Adminhtml\
called ExportController.php and ImportController.php

But there is no Code like yours.

It would be helpful for me if you can tell me in which File i have to edit the code if Export of Magento gaves me Chars like “& gt;” instead of “<”

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top