Magento不允许像ä这样的特殊角色

时间:2012-10-03 06:34:43

标签: php magento

我在我的magento商店上传了我的产品的csv。在CSV中,我的产品名称包含ä等特殊字符。但在前端,这些角色正在显示一些像h这样的html标签 “& auml;”。我想避免这样的特征。有没有办法解决这个问题。

...谢谢

2 个答案:

答案 0 :(得分:3)

尝试这样可能会帮助您显示产品名称

<?php 

    html_entity_decode(htmlentities(utf8_decode(strip_tags($_newProduct['name']))));

   // where $_newProduct is the collection of product
 ?>

或尝试这样的事情

解决这些问题的方法是添加

AddDefaultCharset Off

在magento根目录的.htaccess文件中。如果您仍然遇到问题,请选择:

AddDefaultCharset UTF-8

OR

转到.htaccess文件并从

中删除#
AddDefaultCharset UTF-8

以.txt格式打开您的csv文件,在UTF-8下打开另存为,然后以magento导入数据

你的特殊角色也会在magento admin中导入,没有任何错误

希望它会帮助你

答案 1 :(得分:2)

感谢您的回复。我只使用了html_entity_decode(); 。它给了我正确的输出。感谢。

相关问题