Skip to content

Commit 2508a6d

Browse files
committed
fix: fix bug in searchKeyword
1 parent 104987e commit 2508a6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

model/common/seo.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function get_category_by_url($url) {
1010

1111
if ( '/' . $keyword == $url )
1212

13-
return array('id' => $category->term_id, 'type' => $category->taxonomy);
13+
return array('id' => $category->term_id, 'slug' => $category->slug, 'type' => $category->taxonomy);
1414
}
1515
return false;
1616
}
@@ -31,12 +31,14 @@ public function searchKeyword($url) {
3131
if ($search) {
3232
if ($search['type'] == 'category') {
3333
$type = 'blog-category';
34+
$search = $search['id'];
3435
} else if($search['type'] == 'pwb-brand') {
3536
$type = 'manufacturer';
37+
$search = $search['slug'];
3638
} else {
3739
$type='category';
40+
$search = $search['id'];
3841
}
39-
$search = $search['id'];
4042
} else {
4143
$search = '';
4244
}

0 commit comments

Comments
 (0)