Добрый день, ранее мне помогли сделать вложенность производителей во вкладку /brands/производитель, решил этот же код добавить на другой сайт, но у него структура seo_pro отличается от стандартной, и теперь все страницы редиректят во вкладку /brands, как быть?
if (count($data)) {
$link .= '&' . urldecode(http_build_query($data, '', '&'));
}
$queries = array();
$brand = false; //Переменная для определения, что работаем с производителями
foreach ($data as $key => $value) {
switch ($key) {
case 'manufacturer_id'://случай с производителем
$brand = true;
$queries[] = $key . '=' . $value;
unset($data[$key]);
$postfix = 1;
break;
case 'product_id':
//case 'manufacturer_id':
case 'category_id':
case 'information_id':
case 'order_id':
case 'download_id':
case 'search':
case 'sub_category':
case 'description':
// Compatibility with Shopencart News/Blog:
case 'news_id':
case 'author':
case 'ncat':
// Compatibility with VDF News (villagedefrance)
case 'news_id':
case 'posts_id':
// Compatibility with unknown Blog:
case 'blog_id':
case 'blog_category_id':
case 'blogpath':
$queries[] = $key . '=' . $value;
unset($data[$key]);
$postfix = 1;
break;
case 'page':
if($value == 1) {
unset($data[$key]);
} else {
$queries[] = $key . '=' . $value;
}
break;
case 'path':
// ATTN: user can set any path: path=2_4_1_2_3
$category_path = explode('_', $value);
// find real category path:
$category_id = end($category_path);
$categories = $this->getPathByCategory($category_id);
// save all categories queries to find later their aliases
$categories = explode('_', $categories);
foreach ($categories as $category) {
$queries[] = 'category_id=' . $category;
}
unset($data[$key]);
break;
default:
break;
}
}
Видимо здесь что-то не так
if ($seo_url == '') return $link;
$seo_url = $code . trim($seo_url, '/');
if ($brand) {
$seo_url = "brands/" . $seo_url;
}