You can try this, rather than renaming all your products..
In get_categories.php, look for the function str_rep($row){
, rename it to function str_rep1($row){
Paste the following code just above this function.
Code:
function str_rep($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_array($row)) {
foreach($row as $key => $value) {
$row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
}
} elseif (is_string($row)) {
$row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
}
return $row;
}
so you end up with :
Code:
function str_rep($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_array($row)) {
foreach($row as $key => $value) {
$row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
}
} elseif (is_string($row)) {
$row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
}
return $row;
}
function str_rep1($row){
$row = str_replace('&', '&', $row);
$row = str_replace('&', '&', $row);
$row = str_replace('>', '>', $row);
$row = str_replace('<', '<', $row);
return $row;
}
This will allow the XML to complete, on removing the WHOLE product name where there is a special character it cant replace.
eg.. Product name = Penne
á Candela Pasta from Naples 500g returns an empty product name because of the á
So, I ran the get_categories.php, with the replacement function str_rep, went through it, noting all products without a product name, just id.
eg..<item text=
"" id="p_6102" im0="leaf.gif" im1="leaf.gif" im2="leaf.gif"/>
then looked to find the offending character, replacing it using the following function, as I believe, the only replacement that takes place using the original function, is the last one in the order, so I ended up with the following.
Code:
function str_rep1($row, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_array($row)) {
foreach($row as $key => $value) {
$row[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
}
} elseif (is_string($row)) {
$row = htmlspecialchars(htmlspecialchars_decode($row, $quote_style), $quote_style, $charset);
}
return $row;
}
function str_rep($row){
$spec_cs = array('ú', 'î', 'á', 'é', '£'); // These are the only Special Characters I needed to replace!!
$specialarray=array('ú', 'í', 'á', 'é', '£');
$row1 = str_replace($spec_cs, $specialarray, $row);
$row = str_rep1($row1);
return $row;
Hope this helps..