seo urls + buy_now + ksort -- resolved
Hi again, I have the same bug as everybody , the "buy_now" bug.
http://www.oscommerce-fr.info/forum/index....st&p=269362
I don't know if I have the latest patched version of SEO
but anyway while re-reading "parse_parameters" I found out that the order of parameters is very relevant
(better to print a product url than a path url) and was sorted only by a 'krsort' .
which does not make sense...
So this code is to properly sort parameters by importance.
(please check : 'manufacturers_id','info_id','articles_id','products_id','pID','cPath','tPath' )
fix, change :
function parse_parameters($page, $params, &$separator){
$p = @explode('&', $params);
krsort($p);
by this code :
function parse_parameters($page, $params, &$separator){
$params = str_replace('&','&', $params); //gk clic-france.com : pfff
$p = array();//stack parameters in seokeyorder (and unknown keys queued)
$tseokeyorder=array('tPath','cPath','pID','products_id','articles_id','info_id','manufacturers_id');
foreach($tseokeyorder as $seokeyorder)
foreach(@explode('&', $params) as $pseo)
if (preg_match("/^$seokeyorder=/",$pseo))
array_push($p,$pseo);
foreach(@explode('&', $params) as $pseo){
$is_seokeyorder=false;
foreach($tseokeyorder as $seokeyorder)
if (preg_match("/^$seokeyorder=/",$pseo))
$is_seokeyorder=true;
if (!$is_seokeyorder)
array_push($p,$pseo);
}
by the way this is where y change & amp ; in the url (sigh..)
Guy Kastenbaum -- http://www.clic-france.com