Jump to content

How to automatically update product links?


Recommended Posts

I installed a third language and updated my database field "link_rewrite" in the table ps_product_lang through a script. I did so with my second language too. With the second language everything worked fine.

 

But this time it did not work. The links appear correct. But when I click on a product-link a blank page appears.

 

What can I do?

Link to comment
Share on other sites

what kind of script you used? can you show it please?

 

<?php

$datei = file_get_contents('C:/files/ps_product_lang.txt');

$reihe = explode("\n", $datei);

foreach($reihe as $linie) {
$inhalt = explode(';', $linie);
$titel = str_replace(array('"""', '"'), '', $inhalt[9]);
$titel = str_replace("'", "", $titel);
$metaTitel = str_replace(' ', '-', $titel);
$metaTitel = str_replace(',', '-', $metaTitel);
$id = trim(str_replace('"', '', $inhalt[0]));

echo "UPDATE ps_product_lang SET meta_title = 'Grossiste Bijoux: $titel', description = '{$inhalt[6]}', description_short = '{$inhalt[6]}' WHERE id_lang = 4 AND id_product = $id;\n";
}

I then pasted the echo result into phpmyadmin and executed the mysql commands. That worked and link_rewrite was changed. It is just that when I click a product link a blank page shows.

 

I could go into admin and generate the links manually but I have over 2000 products. That is too time consuming.

Edited by Barama (see edit history)
Link to comment
Share on other sites

When I turn on the error messages I get the following warning: 

 

Warning: Header may not contain more than a single header, new line detected in /home8/bbr/public_html/pp/classes/Tools.php on line 130

 

Line 130 is inside the "redirectLink($url)" function. It says

 

header('Location: '.$url);

 

on line 130.

Link to comment
Share on other sites

×
×
  • Create New...